summaryrefslogtreecommitdiffstats
path: root/docs/qafbwebsocketclient.md
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-01-04 14:31:42 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-01-16 08:45:56 +0000
commitb7e6dbef56913fa43ea23b842ebe2933d9e0477e (patch)
tree06292d4cbc5acf1eb8da4ca9eabec10dafc274b3 /docs/qafbwebsocketclient.md
parent2e36a74fa8ae2a4b8e06f7752c3876f32a8dcbb3 (diff)
Add functions reference documentationguppy_6.99.4guppy/6.99.46.99.4
Only JSON helpers functions were documented before this commits. This add a description for every function of the afb-helpers library. Bug-AGL: SPEC-2114 Change-Id: I3ae941841ef4ad8e345dd4cd6bc012f6596eadc2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'docs/qafbwebsocketclient.md')
-rw-r--r--docs/qafbwebsocketclient.md39
1 files changed, 39 insertions, 0 deletions
diff --git a/docs/qafbwebsocketclient.md b/docs/qafbwebsocketclient.md
new file mode 100644
index 0000000..5a6a3da
--- /dev/null
+++ b/docs/qafbwebsocketclient.md
@@ -0,0 +1,39 @@
+# A WebSocket client to an Application Framework Binder
+
+## 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.