SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
|
The websocket connection to the Signal K server. More...
#include <sensesp/net/ws_client.h>
Additional Inherited Members | |
Static Public Member Functions inherited from sensesp::Startable | |
static void | start_all () |
Public Attributes inherited from sensesp::Configurable | |
const String | config_path_ |
Protected Member Functions inherited from sensesp::Configurable | |
virtual void | load_configuration () |
Protected Attributes inherited from sensesp::Configurable | |
String | description_ = "" |
int | sort_order_ = 1000 |
Protected Attributes inherited from sensesp::ValueProducer< WSConnectionState > | |
WSConnectionState | output |
The websocket connection to the Signal K server.
Definition at line 31 of file ws_client.h.
sensesp::WSClient::WSClient | ( | String | config_path, |
SKDeltaQueue * | sk_delta_queue, | ||
String | server_address, | ||
uint16_t | server_port | ||
) |
void sensesp::WSClient::connect | ( | ) |
|
overridevirtual |
Returns a configuration schema that specifies the key/value pairs that can be expected when calling get_configuration(), or are expected by set_configuration(). The schema will be in JSON Schema format
Reimplemented from sensesp::Configurable.
Definition at line 660 of file ws_client.cpp.
|
finaloverridevirtual |
Returns the current configuration data as a JsonObject. In general, the current state of local member variables are saved to a new object created with JsonDocument::as<JsonObject>() and returned.
Reimplemented from sensesp::Configurable.
Definition at line 640 of file ws_client.cpp.
String sensesp::WSClient::get_connection_status | ( | ) |
Get a String representation of the current connection state.
Definition at line 690 of file ws_client.cpp.
|
inline |
Return a delta update ValueProducer that produces the number of sent deltas (ordinarily always 1)
Definition at line 53 of file ws_client.h.
Definition at line 42 of file ws_client.h.
Definition at line 43 of file ws_client.h.
bool sensesp::WSClient::is_connected | ( | ) |
Definition at line 617 of file ws_client.cpp.
void sensesp::WSClient::loop | ( | ) |
Called when the websocket connection is established.
Called in the websocket task context.
payload |
Definition at line 152 of file ws_client.cpp.
void sensesp::WSClient::on_disconnected | ( | ) |
Called when the websocket connection is disconnected.
This method is called in the websocket task context.
Definition at line 120 of file ws_client.cpp.
void sensesp::WSClient::on_error | ( | ) |
Called when the websocket connection encounters an error.
Called in the websocket task context.
Definition at line 140 of file ws_client.cpp.
Called when the websocket receives a delta.
Called in the websocket task context.
payload |
Definition at line 209 of file ws_client.cpp.
void sensesp::WSClient::on_receive_put | ( | DynamicJsonDocument & | message | ) |
Called when a PUT event is received.
Called in the websocket task context.
message |
Definition at line 311 of file ws_client.cpp.
void sensesp::WSClient::on_receive_updates | ( | DynamicJsonDocument & | message | ) |
Called when a delta update is received.
Called in the websocket task context.
message |
Definition at line 243 of file ws_client.cpp.
void sensesp::WSClient::restart | ( | ) |
Definition at line 621 of file ws_client.cpp.
void sensesp::WSClient::send_delta | ( | ) |
Definition at line 628 of file ws_client.cpp.
Send some processed data to the websocket.
Sends the specified payload to the server over the websocket this client is connected to. If no connection currently exist, the call is safely ignored.
Called in the websocket task context.
payload |
Definition at line 359 of file ws_client.cpp.
|
finaloverridevirtual |
Sets the current state of local member variables using the data stored in config.
Reimplemented from sensesp::Configurable.
Definition at line 662 of file ws_client.cpp.
|
overridevirtual |
Called during the initialization process. Override this method to add runtime initialization code to your class
Reimplemented from sensesp::Startable.
Definition at line 102 of file ws_client.cpp.