26#ifndef _COMMDRIVERN0183NET_H
27#define _COMMDRIVERN0183NET_H
35#include "comm_drv_n0183.h"
37#include <wx/datetime.h>
44#define GSocket GlibGSocket
52#include <sys/socket.h>
53#include <netinet/in.h>
72 bool SetOutputSocketOptions(wxSocketBase* tsock);
73 bool SendSentenceNetwork(
const wxString& payload);
74 void OnServerSocketEvent(wxSocketEvent& event);
75 void OnTimerSocket(wxTimerEvent& event);
76 void OnSocketEvent(wxSocketEvent& event);
77 void OpenNetworkGPSD();
78 void OpenNetworkTCP(
unsigned int addr);
79 void OpenNetworkUDP(
unsigned int addr);
80 void OnSocketReadWatchdogTimer(wxTimerEvent& event);
82 bool SendMessage(std::shared_ptr<const NavMsg> msg,
83 std::shared_ptr<const NavAddr> addr)
override;
84 wxSocketBase* GetSock()
const {
return m_sock; }
91 wxString GetNetPort()
const {
return m_net_port; }
92 wxIPV4address GetAddr()
const {
return m_addr; }
93 wxTimer* GetSocketThreadWatchdogTimer() {
94 return &m_socketread_watchdog_timer;
96 wxTimer* GetSocketTimer() {
return &m_socket_timer; }
97 void SetSock(wxSocketBase* sock) { m_sock = sock; }
98 void SetTSock(wxSocketBase* sock) { m_tsock = sock; }
99 wxSocketBase* GetTSock()
const {
return m_tsock; }
100 void SetSockServer(wxSocketServer* sock) { m_socket_server = sock; }
101 wxSocketServer* GetSockServer()
const {
return m_socket_server; }
102 void SetMulticast(
bool multicast) { m_is_multicast = multicast; }
103 bool GetMulticast()
const {
return m_is_multicast; }
105 NetworkProtocol GetProtocol() {
return m_net_protocol; }
106 void SetBrxConnectEvent(
bool event) { m_brx_connect_event = event; }
107 bool GetBrxConnectEvent() {
return m_brx_connect_event; }
109 void SetConnectTime(wxDateTime time) { m_connect_time = time; }
110 wxDateTime GetConnectTime() {
return m_connect_time; }
112 dsPortType GetPortType()
const {
return m_io_select; }
113 wxString GetPort()
const {
return m_portstring; }
115 ConnectionType GetConnectionType()
const {
return m_connection_type; }
117 bool ChecksumOK(
const std::string& sentence);
118 void SetOk(
bool ok) { m_bok = ok; };
121 NetworkProtocol m_net_protocol;
122 wxIPV4address m_addr;
123 wxSocketBase* m_sock;
124 wxSocketBase* m_tsock;
125 wxSocketServer* m_socket_server;
131 std::string m_sock_buffer;
132 wxString m_portstring;
133 dsPortType m_io_select;
134 wxDateTime m_connect_time;
135 bool m_brx_connect_event;
136 bool m_bchecksumCheck;
137 ConnectionType m_connection_type;
139 wxTimer m_socket_timer;
140 wxTimer m_socketread_watchdog_timer;
144 DECLARE_EVENT_TABLE()
Internal wxEvent worker thread – main driver.
Driver for NMEA0183 over TCP/IP.
Abstract NMEA0183 drivers common parts.
Interface implemented by transport layer and possible other parties like test code which should handl...