From b7e6dbef56913fa43ea23b842ebe2933d9e0477e Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 4 Jan 2019 14:31:42 +0100 Subject: Add functions reference documentation 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 --- docs/qafbwebsocketclient.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 docs/qafbwebsocketclient.md (limited to 'docs/qafbwebsocketclient.md') 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. -- cgit 1.2.3-korg