diff options
author | 2020-11-30 03:44:47 +0530 | |
---|---|---|
committer | 2020-12-07 19:57:24 +0000 | |
commit | 05f50b5c65de6027429e74c6f8dff53c86fff512 (patch) | |
tree | 7ec499ebd8400d197ff58f63701f47e74b1116ef /docs/3_Developer_Guides/4_AFB_Helper_Guide/6_Qt_AFB_Websocket_client.md | |
parent | 7e585755f20d148f50969a9a25639f4892e8da60 (diff) |
Added AFB Helper Guide in Developer Guides
Revised and added AFB Helper Guide as a part of Developer Guides.
Bug-AGL: [SPEC-3633]
Signed-off-by: Shankho Boron Ghosh <shankhoghosh123@gmail.com>
Change-Id: I3df9265ae0570e987d80bc4bd2d3d14e7743b26a
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/documentation/+/25665
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tested-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'docs/3_Developer_Guides/4_AFB_Helper_Guide/6_Qt_AFB_Websocket_client.md')
-rw-r--r-- | docs/3_Developer_Guides/4_AFB_Helper_Guide/6_Qt_AFB_Websocket_client.md | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/docs/3_Developer_Guides/4_AFB_Helper_Guide/6_Qt_AFB_Websocket_client.md b/docs/3_Developer_Guides/4_AFB_Helper_Guide/6_Qt_AFB_Websocket_client.md new file mode 100644 index 0000000..5572548 --- /dev/null +++ b/docs/3_Developer_Guides/4_AFB_Helper_Guide/6_Qt_AFB_Websocket_client.md @@ -0,0 +1,41 @@ +--- +title: Qt AFB Websocket client +--- + +## QAfbWebsocketClient(QObject* parent = nullptr) + +Default constructor. + +* `parent`: Parent object. + +## QAbstractSocket::SocketError error() + +Get and return the last error code. + +## QString errorString() + +Get and return the last error as a string. + +## bool isValid() + +Check if connection is ready or not. + +Returns `true` if the connected is ready to read and write, `false` otherwise. + +## void call(const QString& api, const QString& verb, const QJsonValue& arg = QJsonValue(), closure_t closure = nullptr) + +Call an api's verb with an argument. + +* `api`: Api to call. +* `verb`: Verb to call. +* `arg`: Argument to pass. +* `closure`: callback function to call at the verb reply + +## void QAfbWebsocketClient::sendTextMessage(QString msg) + +Send a text message over the websocket. + +This is use for test only, you should not use this method because it sent text +**as-is**, so you have to follow the binder's protocol by your self. + +* `msg`: Message to send.
\ No newline at end of file |