OpenCPN Partial API docs
Loading...
Searching...
No Matches
CommDriverSignalKNet Class Reference

Driver for SignalK messages over TCP/IP. More...

#include <comm_drv_signalk_net.h>

Inheritance diagram for CommDriverSignalKNet:
CommDriverSignalK AbstractCommDriver

Public Member Functions

 CommDriverSignalKNet (const ConnectionParams *params, DriverListener &l)
 
void Open ()
 
void Close ()
 
void SetThreadRunning (bool active)
 
void SetThreadRunFlag (int run)
 
void ResetWatchdog ()
 
void SetWatchdog (int n)
 
void Activate () override
 Register driver and possibly do other post-ctor steps. More...
 
void handle_SK_sentence (CommDriverSignalKNetEvent &event)
 
void handleUpdate (const rapidjson::Value &update)
 
void updateItem (const rapidjson::Value &item, wxString &sfixtime)
 
void OpenWebSocket ()
 
void CloseWebSocket ()
 
bool IsThreadRunning ()
 
- Public Member Functions inherited from CommDriverSignalK
 CommDriverSignalK (const std::string &s="sk0")
 
virtual bool SendMessage (std::shared_ptr< const NavMsg > msg, std::shared_ptr< const NavAddr > addr) override
 
virtual void SetListener (DriverListener &l) override
 Set the entity which will receive incoming data. More...
 
virtual std::shared_ptr< NavAddrGetAddress (const NavAddrSignalK &name)
 
- Public Member Functions inherited from AbstractCommDriver
virtual bool SendMessage (std::shared_ptr< const NavMsg > msg, std::shared_ptr< const NavAddr > addr)=0
 
virtual void Activate ()=0
 Register driver in the driver Registry. More...
 
virtual void SetListener (DriverListener &l)
 Set the entity which will receive incoming data. More...
 
virtual std::pair< CommStatus, std::string > Clone ()
 Create a new virtual interface using a new instance of this driver. More...
 
std::string Key () const
 
virtual std::unordered_map< std::string, std::string > GetAttributes () const
 

Static Public Member Functions

static bool DiscoverSKServer (wxString &ip, int &port, int tSec)
 
static bool DiscoverSKServer (std::string serviceIdent, wxString &ip, int &port, int tSec)
 

Public Attributes

std::string m_self
 
std::string m_context
 
bool m_bsec_thread_active
 
int m_Thread_run_flag
 
ConnectionParams m_params
 
DriverListenerm_listener
 
- Public Attributes inherited from AbstractCommDriver
const NavAddr::Bus bus
 
const std::string iface
 Physical device for 0183, else a unique string. More...
 
std::unordered_map< std::string, std::string > attributes
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractCommDriver
 AbstractCommDriver (NavAddr::Bus b)
 
 AbstractCommDriver (NavAddr::Bus b, const std::string &s)
 

Detailed Description

Driver for SignalK messages over TCP/IP.

Definition at line 57 of file comm_drv_signalk_net.h.

Constructor & Destructor Documentation

◆ CommDriverSignalKNet()

CommDriverSignalKNet::CommDriverSignalKNet ( const ConnectionParams params,
DriverListener l 
)

Definition at line 214 of file comm_drv_signalk_net.cpp.

◆ ~CommDriverSignalKNet()

CommDriverSignalKNet::~CommDriverSignalKNet ( )
virtual

Definition at line 234 of file comm_drv_signalk_net.cpp.

Member Function Documentation

◆ Activate()

void CommDriverSignalKNet::Activate ( )
overridevirtual

Register driver and possibly do other post-ctor steps.

Implements AbstractCommDriver.

Definition at line 238 of file comm_drv_signalk_net.cpp.

◆ Close()

void CommDriverSignalKNet::Close ( )

Definition at line 272 of file comm_drv_signalk_net.cpp.

◆ CloseWebSocket()

void CommDriverSignalKNet::CloseWebSocket ( )

Definition at line 298 of file comm_drv_signalk_net.cpp.

◆ handle_SK_sentence()

void CommDriverSignalKNet::handle_SK_sentence ( CommDriverSignalKNetEvent event)

Definition at line 336 of file comm_drv_signalk_net.cpp.

◆ IsThreadRunning()

bool CommDriverSignalKNet::IsThreadRunning ( )
inline

Definition at line 83 of file comm_drv_signalk_net.h.

◆ Open()

void CommDriverSignalKNet::Open ( void  )

Definition at line 242 of file comm_drv_signalk_net.cpp.

◆ OpenWebSocket()

void CommDriverSignalKNet::OpenWebSocket ( )

Definition at line 276 of file comm_drv_signalk_net.cpp.

◆ ResetWatchdog()

void CommDriverSignalKNet::ResetWatchdog ( )
inline

Definition at line 71 of file comm_drv_signalk_net.h.

◆ SetThreadRunFlag()

void CommDriverSignalKNet::SetThreadRunFlag ( int  run)
inline

Definition at line 70 of file comm_drv_signalk_net.h.

◆ SetThreadRunning()

void CommDriverSignalKNet::SetThreadRunning ( bool  active)
inline

Definition at line 69 of file comm_drv_signalk_net.h.

◆ SetWatchdog()

void CommDriverSignalKNet::SetWatchdog ( int  n)
inline

Definition at line 72 of file comm_drv_signalk_net.h.

Member Data Documentation

◆ m_bsec_thread_active

bool CommDriverSignalKNet::m_bsec_thread_active

Definition at line 88 of file comm_drv_signalk_net.h.

◆ m_context

std::string CommDriverSignalKNet::m_context

Definition at line 86 of file comm_drv_signalk_net.h.

◆ m_listener

DriverListener& CommDriverSignalKNet::m_listener

Definition at line 92 of file comm_drv_signalk_net.h.

◆ m_params

ConnectionParams CommDriverSignalKNet::m_params

Definition at line 91 of file comm_drv_signalk_net.h.

◆ m_self

std::string CommDriverSignalKNet::m_self

Definition at line 85 of file comm_drv_signalk_net.h.

◆ m_Thread_run_flag

int CommDriverSignalKNet::m_Thread_run_flag

Definition at line 90 of file comm_drv_signalk_net.h.


The documentation for this class was generated from the following files: