36#include <wx/datetime.h>
40#include "rapidjson/fwd.h"
41#include "conn_params.h"
42#include "comm_drv_signalk.h"
44#define SIGNALK_SOCKET_ID 5011
45#define N_DOG_TIMEOUT 5
46#define N_DOG_TIMEOUT_RECONNECT 10
48#define TIMER_SOCKET 9006
50static const double ms_to_knot_factor = 1.9438444924406;
53class OCPN_WebSocketMessageHandler;
64 static bool DiscoverSKServer(wxString &ip,
int &port,
int tSec);
65 static bool DiscoverSKServer(std::string serviceIdent, wxString &ip,
69 void SetThreadRunning(
bool active) { m_threadActive = active; }
70 void SetThreadRunFlag(
int run) { m_Thread_run_flag = run; }
71 void ResetWatchdog() { m_dog_value = N_DOG_TIMEOUT; }
72 void SetWatchdog(
int n) { m_dog_value = n; }
78 void handleUpdate(
const rapidjson::Value &update);
79 void updateItem(
const rapidjson::Value &item, wxString &sfixtime);
82 void CloseWebSocket();
83 bool IsThreadRunning() {
return m_threadActive; }
86 std::string m_context;
88 bool m_bsec_thread_active;
90 int m_Thread_run_flag;
96 wxIPV4address GetAddr()
const {
return m_addr; }
100 wxTimer m_socketread_watchdog_timer;
101 wxTimer *GetSocketThreadWatchdogTimer() {
102 return &m_socketread_watchdog_timer;
105 OCPN_WebSocketMessageHandler *m_eventHandler;
111 bool SetOutputSocketOptions(wxSocketBase *sock);
Internal event worker thread -> main driver.
Driver for SignalK messages over TCP/IP.
void Activate() override
Register driver and possibly do other post-ctor steps.
Abstract SignalK driver interface.
Interface implemented by transport layer and possible other parties like test code which should handl...