26 #ifndef _COMMDRIVERN2KSERIAL_H
27 #define _COMMDRIVERN2KSERIAL_H
31 #include <wx/thread.h>
34 #include "model/comm_drv_n2k.h"
35 #include "model/conn_params.h"
38 #include "serial/serial.h"
41 #define OUT_QUEUE_LENGTH 20
42 #define MAX_OUT_QUEUE_MESSAGE_LENGTH 200
45 #define STARTOFTEXT 0x02
46 #define ENDOFTEXT 0x03
48 #define MsgTypeN2kData 0x93
49 #define MsgTypeN2kRequest 0x94
69 bool SendMessage(std::shared_ptr<const NavMsg> msg,
70 std::shared_ptr<const NavAddr> addr)
override;
72 int SetTXPGN(
int pgn)
override;
77 void SetSecThreadActive(
void) { m_bsec_thread_active =
true; }
78 void SetSecThreadInActive(
void) { m_bsec_thread_active =
false; }
79 bool IsSecThreadActive()
const {
return m_bsec_thread_active; }
82 m_pSecondary_Thread = secondary_Thread;
85 return m_pSecondary_Thread;
87 void SetThreadRunFlag(
int run) { m_Thread_run_flag = run; }
92 std::atomic_int m_Thread_run_flag;
95 void ProcessManagementPacket(std::vector<unsigned char> *payload);
96 int SendMgmtMsg(
unsigned char *
string,
size_t string_size,
97 unsigned char cmd_code,
98 int timeout_msec,
bool *response_flag);
101 std::string m_portstring;
102 std::string m_BaudRate;
106 bool m_bsec_thread_active;
117 std::string m_device_common_name;
119 int m_manufacturers_code;
void Activate() override
Register driver and possibly do other post-ctor steps.
void SetListener(DriverListener &l) override
Set the entity which will receive incoming data.
Interface implemented by transport layer and possible other parties like test code which should handl...