◆ JsonWebClient()
Constructor, initializing all members
- Parameters
-
netClient | a object implementing Client interface to access the network. Using a Client implementing ssl feature will result in https otherwise http. |
host | Host to connect to |
port | Port to connect to |
callBackObject | Object passed to the callbacks, shall not be 0 |
JWC_CALLBACK_MESSAGE_SIGNATURE | Callback called on receiving a message / valid json data |
JWC_CALLBACK_ERROR_SIGNATURE | Callback called on error while receiving |
◆ fire()
bool JsonWebClient::fire |
( |
String |
commands[], |
|
|
int |
count |
|
) |
| |
Executes a list of commands.
- Parameters
-
[in] | commands[] | list of commands |
[in] | count | of commands |
- Returns
- Return true on success
Sends a list of commands to the server by calling println() for each command and flush() at the end of list. The commands shall follow the http protocol.
◆ loop()
bool JsonWebClient::loop |
( |
| ) |
|
Method to poll client processing.
- Returns
- True is an internal action was executed.
Method to poll client processing, shall be called in each main loop()
◆ processHeader()
bool JsonWebClient::processHeader |
( |
| ) |
|
|
private |
Process a header.
- Returns
- Returns true while headers found in underlying Client
Read a header from NetClient and process it.
◆ processJson()
bool JsonWebClient::processJson |
( |
| ) |
|
|
private |
Process JSON.
- Returns
- Returns true on success
Reads data from underlying Client and process it by ArduinoJSON
◆ reConnect()
void JsonWebClient::reConnect |
( |
| ) |
|
|
private |
Reconnects to host.
- Returns
- Return nothing
Reconnects to host, skips open connection
◆ state()
Current state of the client.
- Returns
- The current state as a JwcClientState
Make the current state of the client public accessible.
◆ stop()
bool JsonWebClient::stop |
( |
| ) |
|
Stops the client.
- Returns
- True
Stops the underlying client connection and reset client state to JwcClientState::unconnected
◆ CallBackObject
void* JsonWebClient::CallBackObject |
|
private |
Object passed to the callbacks
◆ ContentLength
long JsonWebClient::ContentLength = JWC_BUFF_SIZE |
|
private |
Content length stored during header processing
◆ Host
String JsonWebClient::Host |
|
private |
◆ HttpStatusOk
bool JsonWebClient::HttpStatusOk = false |
|
private |
Indicate if Http 200 Ok header was found
◆ JWC_CALLBACK_ERROR_SIGNATURE
JsonWebClient::JWC_CALLBACK_ERROR_SIGNATURE |
|
private |
Callback called on error while receiving
◆ JWC_CALLBACK_MESSAGE_SIGNATURE
JsonWebClient::JWC_CALLBACK_MESSAGE_SIGNATURE |
|
private |
Callback called on receiving a message / valid json data
◆ NetClient
Client* JsonWebClient::NetClient |
|
private |
Client used to access the net (depends on hardware)
◆ Port
◆ State
Current state of the client
The documentation for this class was generated from the following files: