3 title: Qt AFB Websocket client
5 https://git.automotivelinux.org/src/libafb-helpers/plain/docs/qafbwebsocketclient.md?h=master
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/afb-helpers-function-references-afb-helpers-book.yml -->
10 # A WebSocket client to an Application Framework Binder
12 ## QAfbWebsocketClient(QObject* parent = nullptr)
16 * `parent`: Parent object.
18 ## QAbstractSocket::SocketError error()
20 Get and return the last error code.
22 ## QString errorString()
24 Get and return the last error as a string.
28 Check if connection is ready or not.
30 Returns `true` if the connected is ready to read and write, `false` otherwise.
32 ## void call(const QString& api, const QString& verb, const QJsonValue& arg = QJsonValue(), closure_t closure = nullptr)
34 Call an api's verb with an argument.
37 * `verb`: Verb to call.
38 * `arg`: Argument to pass.
39 * `closure`: callback function to call at the verb reply
41 ## void QAfbWebsocketClient::sendTextMessage(QString msg)
43 Send a text message over the websocket.
45 This is use for test only, you should not use this method because it sent text
46 **as-is**, so you have to follow the binder's protocol by your self.
48 * `msg`: Message to send.