26#ifndef _COMMDRIVERN2KSERIAL_H
27#define _COMMDRIVERN2KSERIAL_H
31#include "comm_drv_n2k.h"
32#include "conn_params.h"
34#ifndef __OCPN__ANDROID__
35#include "serial/serial.h"
38#define OUT_QUEUE_LENGTH 20
39#define MAX_OUT_QUEUE_MESSAGE_LENGTH 200
42#define STARTOFTEXT 0x02
45#define MsgTypeN2kData 0x93
46#define MsgTypeN2kRequest 0x94
70 bool SendMessage(std::shared_ptr<const NavMsg> msg,
71 std::shared_ptr<const NavAddr> addr)
override;
73 int SetTXPGN(
int pgn)
override;
78 void SetSecThreadActive(
void) { m_bsec_thread_active =
true; }
79 void SetSecThreadInActive(
void) { m_bsec_thread_active =
false; }
80 bool IsSecThreadActive()
const {
return m_bsec_thread_active; }
83 m_pSecondary_Thread = secondary_Thread;
86 return m_pSecondary_Thread;
88 void SetThreadRunFlag(
int run) { m_Thread_run_flag = run; }
92 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;
Internal event worker thread -> main driver.
Driver for NMEA200 messages over serial connections.
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.
Abstract driver interface for NMEA2000 messages.
Interface implemented by transport layer and possible other parties like test code which should handl...