diff --git a/examples/freertos_tasks.cpp b/examples/freertos_tasks.cpp index 8a07a6a70..33c17b232 100644 --- a/examples/freertos_tasks.cpp +++ b/examples/freertos_tasks.cpp @@ -7,7 +7,7 @@ #include "sensesp/net/discovery.h" #include "sensesp/net/http_server.h" #include "sensesp/net/networking.h" -#include "sensesp/net/ws_client.h" +#include "sensesp/signalk/signalk_ws_client.h" #include "sensesp/sensors/digital_input.h" #include "sensesp/signalk/signalk_delta_queue.h" #include "sensesp/signalk/signalk_output.h" @@ -50,10 +50,10 @@ void setup() { auto sk_delta_queue_ = new SKDeltaQueue(); // create the websocket client - auto ws_client_ = new WSClient("/system/sk", sk_delta_queue_, "", 0); + auto ws_client_ = new SKWSClient("/system/sk", sk_delta_queue_, "", 0); - ws_client_->connect_to(new LambdaConsumer( - [](WSConnectionState input) { debugD("WSConnectionState: %d", input); })); + ws_client_->connect_to(new LambdaConsumer( + [](SKWSConnectionState input) { debugD("SKWSConnectionState: %d", input); })); // create the MDNS discovery object auto mdns_discovery_ = new MDNSDiscovery(); diff --git a/src/sensesp/controllers/system_status_controller.cpp b/src/sensesp/controllers/system_status_controller.cpp index e664bfe70..4b88af7a2 100644 --- a/src/sensesp/controllers/system_status_controller.cpp +++ b/src/sensesp/controllers/system_status_controller.cpp @@ -15,7 +15,7 @@ void SystemStatusController::set(WiFiState new_value, break; case WiFiState::kWifiConnectedToAP: case WiFiState::kWifiAPModeActivated: - this->update_state(SystemStatus::kWSDisconnected); + this->update_state(SystemStatus::kSKWSDisconnected); break; case WiFiState::kWifiManagerActivated: this->update_state(SystemStatus::kWifiManagerActivated); @@ -23,25 +23,25 @@ void SystemStatusController::set(WiFiState new_value, } } -void SystemStatusController::set(WSConnectionState new_value, +void SystemStatusController::set(SKWSConnectionState new_value, uint8_t input_channel) { switch (new_value) { - case WSConnectionState::kWSDisconnected: + case SKWSConnectionState::kSKWSDisconnected: if (current_state_ != SystemStatus::kWifiDisconnected && current_state_ != SystemStatus::kWifiNoAP && current_state_ != SystemStatus::kWifiManagerActivated) { // Wifi disconnection states override the higher level protocol state - this->update_state(SystemStatus::kWSDisconnected); + this->update_state(SystemStatus::kSKWSDisconnected); } break; - case WSConnectionState::kWSConnecting: - this->update_state(SystemStatus::kWSConnecting); + case SKWSConnectionState::kSKWSConnecting: + this->update_state(SystemStatus::kSKWSConnecting); break; - case WSConnectionState::kWSAuthorizing: - this->update_state(SystemStatus::kWSAuthorizing); + case SKWSConnectionState::kSKWSAuthorizing: + this->update_state(SystemStatus::kSKWSAuthorizing); break; - case WSConnectionState::kWSConnected: - this->update_state(SystemStatus::kWSConnected); + case SKWSConnectionState::kSKWSConnected: + this->update_state(SystemStatus::kSKWSConnected); break; } } diff --git a/src/sensesp/controllers/system_status_controller.h b/src/sensesp/controllers/system_status_controller.h index fbaca419e..0f7e8de09 100644 --- a/src/sensesp/controllers/system_status_controller.h +++ b/src/sensesp/controllers/system_status_controller.h @@ -2,7 +2,7 @@ #define _SYSTEM_STATUS_CONTROLLER_H_ #include "sensesp/net/networking.h" -#include "sensesp/net/ws_client.h" +#include "sensesp/signalk/signalk_ws_client.h" #include "sensesp/system/valueproducer.h" namespace sensesp { @@ -11,10 +11,10 @@ enum class SystemStatus { kWifiNoAP = 100, kWifiDisconnected, kWifiManagerActivated, - kWSDisconnected, - kWSAuthorizing, - kWSConnecting, - kWSConnected + kSKWSDisconnected, + kSKWSAuthorizing, + kSKWSConnecting, + kSKWSConnected }; /** @@ -25,7 +25,7 @@ enum class SystemStatus { * an event occurs. */ class SystemStatusController : public ValueConsumer, - public ValueConsumer, + public ValueConsumer, public ValueProducer { public: SystemStatusController() {} @@ -34,9 +34,9 @@ class SystemStatusController : public ValueConsumer, /// state updates) virtual void set(WiFiState new_value, uint8_t input_channel = 0) override; - /// ValueConsumer interface for ValueConsumer - /// (WSClient object state updates) - virtual void set(WSConnectionState new_value, + /// ValueConsumer interface for ValueConsumer + /// (SKWSClient object state updates) + virtual void set(SKWSConnectionState new_value, uint8_t input_channel = 0) override; protected: diff --git a/src/sensesp/signalk/signalk_delta_queue.h b/src/sensesp/signalk/signalk_delta_queue.h index 0c6f993b8..91664303e 100644 --- a/src/sensesp/signalk/signalk_delta_queue.h +++ b/src/sensesp/signalk/signalk_delta_queue.h @@ -11,7 +11,7 @@ namespace sensesp { * @brief Signal K delta queue * * This class implements a Signal K delta queue. There should be a unique queue - * for each possible output channel (WSClient, NMEA 2000 messages, + * for each possible output channel (SKWSClient, NMEA 2000 messages, * carrier pigeons). */ class SKDeltaQueue { diff --git a/src/sensesp/net/ws_client.cpp b/src/sensesp/signalk/signalk_ws_client.cpp similarity index 86% rename from src/sensesp/net/ws_client.cpp rename to src/sensesp/signalk/signalk_ws_client.cpp index 506f43d69..fc458139b 100644 --- a/src/sensesp/net/ws_client.cpp +++ b/src/sensesp/signalk/signalk_ws_client.cpp @@ -1,4 +1,4 @@ -#include "ws_client.h" +#include "signalk_ws_client.h" #include #include @@ -18,7 +18,7 @@ namespace sensesp { constexpr int ws_client_task_stack_size = 8192; -WSClient* ws_client; +SKWSClient* ws_client; static const char* kRequestPermission = "readwrite"; @@ -74,17 +74,17 @@ static void websocket_event_handler(void* handler_args, esp_event_base_t base, } } -WSClient::WSClient(String config_path, SKDeltaQueue* sk_delta_queue, +SKWSClient::SKWSClient(String config_path, SKDeltaQueue* sk_delta_queue, String server_address, uint16_t server_port, bool use_mdns) : Configurable{config_path, "/System/Signal K Settings", 200}, sk_delta_queue_{sk_delta_queue}, conf_server_address_{server_address}, conf_server_port_{server_port}, use_mdns_{use_mdns} { - // a WSClient object observes its own connection_state_ member + // a SKWSClient object observes its own connection_state_ member // and simply passes through any notification it emits. As a result, // whenever the value of connection_state_ is updated, observers of the - // WSClient object get automatically notified. + // SKWSClient object get automatically notified. this->connection_state_.attach( [this]() { this->emit(this->connection_state_.get()); }); @@ -100,15 +100,15 @@ WSClient::WSClient(String config_path, SKDeltaQueue* sk_delta_queue, delta_tx_tick_producer_.connect_to(&delta_tx_count_producer_); ReactESP::app->onDelay(0, [this]() { - debugD("Starting WSClient"); - xTaskCreate(ExecuteWebSocketTask, "WSClient", ws_client_task_stack_size, + debugD("Starting SKWSClient"); + xTaskCreate(ExecuteWebSocketTask, "SKWSClient", ws_client_task_stack_size, this, 1, NULL); MDNS.addService("signalk-sensesp", "tcp", 80); }); } -void WSClient::connect_loop() { - if (this->get_connection_state() == WSConnectionState::kWSDisconnected) { +void SKWSClient::connect_loop() { + if (this->get_connection_state() == SKWSConnectionState::kSKWSDisconnected) { this->connect(); } } @@ -119,8 +119,8 @@ void WSClient::connect_loop() { * This method is called in the websocket task context. * */ -void WSClient::on_disconnected() { - if (this->get_connection_state() == WSConnectionState::kWSConnecting && +void SKWSClient::on_disconnected() { + if (this->get_connection_state() == SKWSConnectionState::kSKWSConnecting && server_detected_ && !token_test_success_) { // Going from connecting directly to disconnect when we // know we have found and talked to the server usually means @@ -129,7 +129,7 @@ void WSClient::on_disconnected() { auth_token_ = NULL_AUTH_TOKEN; save_configuration(); } - this->set_connection_state(WSConnectionState::kWSDisconnected); + this->set_connection_state(SKWSConnectionState::kSKWSDisconnected); server_detected_ = false; } @@ -139,8 +139,8 @@ void WSClient::on_disconnected() { * Called in the websocket task context. * */ -void WSClient::on_error() { - this->set_connection_state(WSConnectionState::kWSDisconnected); +void SKWSClient::on_error() { + this->set_connection_state(SKWSConnectionState::kSKWSDisconnected); debugW("Websocket client error."); } @@ -149,8 +149,8 @@ void WSClient::on_error() { * * Called in the websocket task context. */ -void WSClient::on_connected() { - this->set_connection_state(WSConnectionState::kWSConnected); +void SKWSClient::on_connected() { + this->set_connection_state(SKWSConnectionState::kSKWSConnected); this->sk_delta_queue_->reset_meta_send(); debugI("Subscribing to Signal K listeners..."); this->subscribe_listeners(); @@ -162,7 +162,7 @@ void WSClient::on_connected() { * Called in the websocket task context. * */ -void WSClient::subscribe_listeners() { +void SKWSClient::subscribe_listeners() { bool output_available = false; JsonDocument subscription; subscription["context"] = "vessels.self"; @@ -206,7 +206,7 @@ void WSClient::subscribe_listeners() { * * @param payload */ -void WSClient::on_receive_delta(uint8_t* payload) { +void SKWSClient::on_receive_delta(uint8_t* payload) { #ifdef SIGNALK_PRINT_RCV_DELTA debugD("Websocket payload received: %s", (char*)payload); #endif @@ -240,7 +240,7 @@ void WSClient::on_receive_delta(uint8_t* payload) { * * @param message */ -void WSClient::on_receive_updates(JsonDocument& message) { +void SKWSClient::on_receive_updates(JsonDocument& message) { // Process updates from subscriptions... JsonArray updates = message["updates"]; @@ -269,7 +269,7 @@ void WSClient::on_receive_updates(JsonDocument& message) { * This method is called in the main task context. * */ -void WSClient::process_received_updates() { +void SKWSClient::process_received_updates() { SKListener::take_semaphore(); const std::vector& listeners = SKListener::get_listeners(); @@ -310,7 +310,7 @@ void WSClient::process_received_updates() { * * @param message */ -void WSClient::on_receive_put(JsonDocument& message) { +void SKWSClient::on_receive_put(JsonDocument& message) { // Process PUT requests... JsonArray puts = message["put"]; size_t response_count = 0; @@ -359,14 +359,14 @@ void WSClient::on_receive_put(JsonDocument& message) { * * @param payload */ -void WSClient::sendTXT(String& payload) { - if (get_connection_state() == WSConnectionState::kWSConnected) { +void SKWSClient::sendTXT(String& payload) { + if (get_connection_state() == SKWSConnectionState::kSKWSConnected) { esp_websocket_client_send_text(this->client_, payload.c_str(), payload.length(), portMAX_DELAY); } } -bool WSClient::get_mdns_service(String& server_address, uint16_t& server_port) { +bool SKWSClient::get_mdns_service(String& server_address, uint16_t& server_port) { // get IP address using an mDNS query int n = MDNS.queryService("signalk-ws", "tcp"); if (n == 0) { @@ -380,8 +380,8 @@ bool WSClient::get_mdns_service(String& server_address, uint16_t& server_port) { } } -void WSClient::connect() { - if (get_connection_state() != WSConnectionState::kWSDisconnected) { +void SKWSClient::connect() { + if (get_connection_state() != SKWSConnectionState::kSKWSDisconnected) { return; } @@ -394,7 +394,7 @@ void WSClient::connect() { debugI("Initiating websocket connection with server..."); - set_connection_state(WSConnectionState::kWSAuthorizing); + set_connection_state(SKWSConnectionState::kSKWSAuthorizing); if (use_mdns_) { if (!get_mdns_service(this->server_address_, this->server_port_)) { debugE("No Signal K server found in network when using mDNS service!"); @@ -415,7 +415,7 @@ void WSClient::connect() { debugD( "Websocket is not connecting to Signal K server because host and " "port are not defined."); - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); return; } @@ -437,7 +437,7 @@ void WSClient::connect() { this->test_token(this->server_address_, this->server_port_); } -void WSClient::test_token(const String server_address, +void SKWSClient::test_token(const String server_address, const uint16_t server_port) { // FIXME: implement async HTTP client! HTTPClient http; @@ -471,15 +471,15 @@ void WSClient::test_token(const String server_address, this->client_id_ = ""; this->send_access_request(server_address, server_port); } else { - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); } } else { debugE("GET... failed, error: %s\n", http.errorToString(http_code).c_str()); - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); } } -void WSClient::send_access_request(const String server_address, +void SKWSClient::send_access_request(const String server_address, const uint16_t server_port) { debugD("Preparing a new access request"); if (client_id_ == "") { @@ -514,7 +514,7 @@ void WSClient::send_access_request(const String server_address, if (httpCode != 202) { debugW("Can't handle response %d to access request.", httpCode); debugD("%s", payload.c_str()); - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); client_id_ = ""; return; } @@ -526,7 +526,7 @@ void WSClient::send_access_request(const String server_address, if (state != "PENDING") { debugW("Got unknown state: %s", state.c_str()); - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); client_id_ = ""; return; } @@ -539,7 +539,7 @@ void WSClient::send_access_request(const String server_address, this->poll_access_request(server_address, server_port, this->polling_href_); } -void WSClient::poll_access_request(const String server_address, +void SKWSClient::poll_access_request(const String server_address, const uint16_t server_port, const String href) { debugD("Polling SK Server for authentication token"); @@ -562,7 +562,7 @@ void WSClient::poll_access_request(const String server_address, String state = doc["state"]; debugD("%s", state.c_str()); if (state == "PENDING") { - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); delay(5000); return; } else if (state == "COMPLETED") { @@ -576,7 +576,7 @@ void WSClient::poll_access_request(const String server_address, if (permission == "DENIED") { debugW("Permission denied"); - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); return; } else if (permission == "APPROVED") { debugI("Permission granted"); @@ -596,19 +596,19 @@ void WSClient::poll_access_request(const String server_address, debugD("Got 500, probably a non-existing request."); polling_href_ = ""; save_configuration(); - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); return; } // any other HTTP status code debugW("Can't handle response %d to pending access request.\n", httpCode); - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); return; } } -void WSClient::connect_ws(const String host, const uint16_t port) { +void SKWSClient::connect_ws(const String host, const uint16_t port) { String path = "/signalk/v1/stream?subscribe=none"; - set_connection_state(WSConnectionState::kWSConnecting); + set_connection_state(SKWSConnectionState::kSKWSConnecting); esp_err_t error; @@ -640,20 +640,20 @@ void WSClient::connect_ws(const String host, const uint16_t port) { debugD("Websocket client started."); } -bool WSClient::is_connected() { - return get_connection_state() == WSConnectionState::kWSConnected; +bool SKWSClient::is_connected() { + return get_connection_state() == SKWSConnectionState::kSKWSConnected; } -void WSClient::restart() { - if (get_connection_state() == WSConnectionState::kWSConnected) { +void SKWSClient::restart() { + if (get_connection_state() == SKWSConnectionState::kSKWSConnected) { esp_websocket_client_close(this->client_, portMAX_DELAY); - set_connection_state(WSConnectionState::kWSDisconnected); + set_connection_state(SKWSConnectionState::kSKWSDisconnected); } } -void WSClient::send_delta() { +void SKWSClient::send_delta() { String output; - if (get_connection_state() == WSConnectionState::kWSConnected) { + if (get_connection_state() == SKWSConnectionState::kSKWSConnected) { if (sk_delta_queue_->data_available()) { sk_delta_queue_->get_delta(output); esp_websocket_client_send_text(this->client_, output.c_str(), @@ -664,7 +664,7 @@ void WSClient::send_delta() { } } -void WSClient::get_configuration(JsonObject& root) { +void SKWSClient::get_configuration(JsonObject& root) { root["sk_address"] = this->conf_server_address_; root["sk_port"] = this->conf_server_port_; root["use_mdns"] = this->use_mdns_; @@ -674,7 +674,7 @@ void WSClient::get_configuration(JsonObject& root) { root["polling_href"] = this->polling_href_; } -bool WSClient::set_configuration(const JsonObject& config) { +bool SKWSClient::set_configuration(const JsonObject& config) { if (config.containsKey("sk_address")) { this->conf_server_address_ = config["sk_address"].as(); } @@ -702,16 +702,16 @@ bool WSClient::set_configuration(const JsonObject& config) { * * @return String */ -String WSClient::get_connection_status() { +String SKWSClient::get_connection_status() { auto state = get_connection_state(); switch (state) { - case WSConnectionState::kWSAuthorizing: + case SKWSConnectionState::kSKWSAuthorizing: return "Authorizing with SignalK"; - case WSConnectionState::kWSConnected: + case SKWSConnectionState::kSKWSConnected: return "Connected"; - case WSConnectionState::kWSConnecting: + case SKWSConnectionState::kSKWSConnecting: return "Connecting"; - case WSConnectionState::kWSDisconnected: + case SKWSConnectionState::kSKWSDisconnected: return "Disconnected"; } diff --git a/src/sensesp/net/ws_client.h b/src/sensesp/signalk/signalk_ws_client.h similarity index 84% rename from src/sensesp/net/ws_client.h rename to src/sensesp/signalk/signalk_ws_client.h index a75e31b4f..de9f68389 100644 --- a/src/sensesp/net/ws_client.h +++ b/src/sensesp/signalk/signalk_ws_client.h @@ -1,5 +1,5 @@ -#ifndef _ws_client_H_ -#define _ws_client_H_ +#ifndef SENSESP_SRC_SENSESP_SIGNALK_SIGNALK_WS_CLIENT_H_ +#define SENSESP_SRC_SENSESP_SIGNALK_SIGNALK_WS_CLIENT_H_ #include #include @@ -19,24 +19,24 @@ namespace sensesp { static const char* NULL_AUTH_TOKEN = ""; -enum class WSConnectionState { - kWSDisconnected, - kWSAuthorizing, - kWSConnecting, - kWSConnected +enum class SKWSConnectionState { + kSKWSDisconnected, + kSKWSAuthorizing, + kSKWSConnecting, + kSKWSConnected }; /** * @brief The websocket connection to the Signal K server. * @see SensESPApp */ -class WSClient : public Configurable, - public ValueProducer { +class SKWSClient : public Configurable, + public ValueProducer { public: ///////////////////////////////////////////////////////// // main task methods - WSClient(String config_path, SKDeltaQueue* sk_delta_queue, + SKWSClient(String config_path, SKDeltaQueue* sk_delta_queue, String server_address, uint16_t server_port, bool use_mdns = true); const String get_server_address() const { return server_address_; } @@ -65,7 +65,7 @@ class WSClient : public Configurable, String get_connection_status(); ///////////////////////////////////////////////////////// - // WSClient task methods + // SKWSClient task methods void on_disconnected(); void on_error(); @@ -101,13 +101,13 @@ class WSClient : public Configurable, bool server_detected_ = false; bool token_test_success_ = false; - TaskQueueProducer connection_state_ = - TaskQueueProducer(WSConnectionState::kWSDisconnected, + TaskQueueProducer connection_state_ = + TaskQueueProducer(SKWSConnectionState::kSKWSDisconnected, ReactESP::app); /// task_connection_state is used to track the internal task state which might /// be out of sync with the published connection state. - WSConnectionState task_connection_state_ = WSConnectionState::kWSDisconnected; + SKWSConnectionState task_connection_state_ = SKWSConnectionState::kSKWSDisconnected; WiFiClient wifi_client_; esp_websocket_client_handle_t client_; @@ -143,7 +143,7 @@ class WSClient : public Configurable, void process_received_updates(); ///////////////////////////////////////////////////////// - // WSClient task methods + // SKWSClient task methods void connect_loop(); void test_token(const String host, const uint16_t port); @@ -154,11 +154,11 @@ class WSClient : public Configurable, void subscribe_listeners(); bool get_mdns_service(String& server_address, uint16_t& server_port); - void set_connection_state(WSConnectionState state) { + void set_connection_state(SKWSConnectionState state) { task_connection_state_ = state; connection_state_.set(state); } - WSConnectionState get_connection_state() { return task_connection_state_; } + SKWSConnectionState get_connection_state() { return task_connection_state_; } }; } // namespace sensesp diff --git a/src/sensesp/system/led_blinker.h b/src/sensesp/system/led_blinker.h index 71b9116bd..b7dd4112e 100644 --- a/src/sensesp/system/led_blinker.h +++ b/src/sensesp/system/led_blinker.h @@ -1,9 +1,9 @@ -#ifndef _led_blinker_H_ -#define _led_blinker_H_ +#ifndef SENSESP_SRC_SENSESP_SYSTEM_LED_BLINKER_H_ +#define SENSESP_SRC_SENSESP_SYSTEM_LED_BLINKER_H_ #include -#include "sensesp/net/ws_client.h" +#include "sensesp/signalk/signalk_ws_client.h" namespace sensesp { diff --git a/src/sensesp/system/system_status_led.cpp b/src/sensesp/system/system_status_led.cpp index c7c70c0ab..e770821c2 100644 --- a/src/sensesp/system/system_status_led.cpp +++ b/src/sensesp/system/system_status_led.cpp @@ -67,16 +67,16 @@ void SystemStatusLed::set(SystemStatus new_value, uint8_t input_channel) { case SystemStatus::kWifiManagerActivated: this->set_wifimanager_activated(); break; - case SystemStatus::kWSDisconnected: + case SystemStatus::kSKWSDisconnected: this->set_ws_disconnected(); break; - case SystemStatus::kWSConnecting: + case SystemStatus::kSKWSConnecting: this->set_ws_connecting(); break; - case SystemStatus::kWSAuthorizing: + case SystemStatus::kSKWSAuthorizing: this->set_ws_authorizing(); break; - case SystemStatus::kWSConnected: + case SystemStatus::kSKWSConnected: this->set_ws_connected(); break; } diff --git a/src/sensesp/system/system_status_led.h b/src/sensesp/system/system_status_led.h index 4bf167b2e..7830cec07 100644 --- a/src/sensesp/system/system_status_led.h +++ b/src/sensesp/system/system_status_led.h @@ -1,5 +1,5 @@ -#ifndef _LED_CONTROLLER_H_ -#define _LED_CONTROLLER_H_ +#ifndef SENSESP_SRC_SENSESP_SYSTEM_SYSTEM_STATUS_LED_H_ +#define SENSESP_SRC_SENSESP_SYSTEM_SYSTEM_STATUS_LED_H_ #include "lambda_consumer.h" #include "led_blinker.h" diff --git a/src/sensesp_app.cpp b/src/sensesp_app.cpp index 753148708..1f961be75 100644 --- a/src/sensesp_app.cpp +++ b/src/sensesp_app.cpp @@ -55,7 +55,7 @@ void SensESPApp::setup() { // create the websocket client bool use_mdns = sk_server_address_ == ""; this->ws_client_ = - new WSClient("/System/Signal K Settings", sk_delta_queue_, + new SKWSClient("/System/Signal K Settings", sk_delta_queue_, sk_server_address_, sk_server_port_, use_mdns); // connect the system status controller diff --git a/src/sensesp_app.h b/src/sensesp_app.h index 6997476f8..16e5d2793 100644 --- a/src/sensesp_app.h +++ b/src/sensesp_app.h @@ -19,7 +19,7 @@ #include "sensesp/net/web/base_command_handler.h" #include "sensesp/net/web/config_handler.h" #include "sensesp/net/web/static_file_handler.h" -#include "sensesp/net/ws_client.h" +#include "sensesp/signalk/signalk_ws_client.h" #include "sensesp/sensesp_version.h" #include "sensesp/sensors/sensor.h" #include "sensesp/signalk/signalk_delta_queue.h" @@ -60,7 +60,7 @@ class SensESPApp : public SensESPBaseApp { return &(this->system_status_controller_); } Networking* get_networking() { return this->networking_; } - WSClient* get_ws_client() { return this->ws_client_; } + SKWSClient* get_ws_client() { return this->ws_client_; } protected: /** @@ -135,7 +135,7 @@ class SensESPApp : public SensESPBaseApp { Networking* networking_ = NULL; OTA* ota_; SKDeltaQueue* sk_delta_queue_; - WSClient* ws_client_; + SKWSClient* ws_client_; UIOutput* sensesp_version_ui_output_ = new UIOutput( "SenseESP version", kSensESPVersion, "Software", 1900);