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

Driver for NMEA200 messages over serial connections. More...

#include <comm_drv_n2k_serial.h>

Inheritance diagram for CommDriverN2KSerial:
CommDriverN2K AbstractCommDriver

Public Member Functions

 CommDriverN2KSerial (const ConnectionParams *params, DriverListener &listener)
 
void Activate () override
 Register driver and possibly do other post-ctor steps. More...
 
void SetListener (DriverListener &l) override
 Set the entity which will receive incoming data. More...
 
bool Open ()
 
void Close ()
 
bool SendMessage (std::shared_ptr< const NavMsg > msg, std::shared_ptr< const NavAddr > addr) override
 
int SetTXPGN (int pgn) override
 
void SetSecThreadActive (void)
 
void SetSecThreadInActive (void)
 
bool IsSecThreadActive () const
 
void SetSecondaryThread (CommDriverN2KSerialThread *secondary_Thread)
 
CommDriverN2KSerialThreadGetSecondaryThread ()
 
void SetThreadRunFlag (int run)
 
void handle_N2K_SERIAL_RAW (CommDriverN2KSerialEvent &event)
 
- Public Member Functions inherited from CommDriverN2K
 CommDriverN2K (const std::string &s="n2k0")
 
virtual bool SendMessage (std::shared_ptr< const NavMsg > msg, std::shared_ptr< const NavAddr > addr)=0
 
virtual void SetListener (DriverListener &l) override
 Set the entity which will receive incoming data. More...
 
virtual std::shared_ptr< NavAddrGetAddress (const N2kName &name)
 
virtual int SetTXPGN (int pgn)
 
- 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
 

Public Attributes

int m_Thread_run_flag
 
- 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 NMEA200 messages over serial connections.

Definition at line 55 of file comm_drv_n2k_serial.h.

Constructor & Destructor Documentation

◆ CommDriverN2KSerial()

CommDriverN2KSerial::CommDriverN2KSerial ( const ConnectionParams params,
DriverListener listener 
)

Definition at line 210 of file comm_drv_n2k_serial.cpp.

◆ ~CommDriverN2KSerial()

CommDriverN2KSerial::~CommDriverN2KSerial ( )
virtual

Definition at line 271 of file comm_drv_n2k_serial.cpp.

Member Function Documentation

◆ Activate()

void CommDriverN2KSerial::Activate ( )
overridevirtual

Register driver and possibly do other post-ctor steps.

Implements AbstractCommDriver.

Definition at line 317 of file comm_drv_n2k_serial.cpp.

◆ Close()

void CommDriverN2KSerial::Close ( )

Definition at line 290 of file comm_drv_n2k_serial.cpp.

◆ GetSecondaryThread()

CommDriverN2KSerialThread * CommDriverN2KSerial::GetSecondaryThread ( )
inline

Definition at line 85 of file comm_drv_n2k_serial.h.

◆ handle_N2K_SERIAL_RAW()

void CommDriverN2KSerial::handle_N2K_SERIAL_RAW ( CommDriverN2KSerialEvent event)

Definition at line 421 of file comm_drv_n2k_serial.cpp.

◆ IsSecThreadActive()

bool CommDriverN2KSerial::IsSecThreadActive ( ) const
inline

Definition at line 80 of file comm_drv_n2k_serial.h.

◆ Open()

bool CommDriverN2KSerial::Open ( )

Definition at line 275 of file comm_drv_n2k_serial.cpp.

◆ SendMessage()

bool CommDriverN2KSerial::SendMessage ( std::shared_ptr< const NavMsg msg,
std::shared_ptr< const NavAddr addr 
)
overridevirtual

Implements CommDriverN2K.

Definition at line 322 of file comm_drv_n2k_serial.cpp.

◆ SetListener()

void CommDriverN2KSerial::SetListener ( DriverListener l)
inlineoverridevirtual

Set the entity which will receive incoming data.

By default, such data is ignored

Reimplemented from CommDriverN2K.

Definition at line 65 of file comm_drv_n2k_serial.h.

◆ SetSecondaryThread()

void CommDriverN2KSerial::SetSecondaryThread ( CommDriverN2KSerialThread secondary_Thread)
inline

Definition at line 82 of file comm_drv_n2k_serial.h.

◆ SetSecThreadActive()

void CommDriverN2KSerial::SetSecThreadActive ( void  )
inline

Definition at line 78 of file comm_drv_n2k_serial.h.

◆ SetSecThreadInActive()

void CommDriverN2KSerial::SetSecThreadInActive ( void  )
inline

Definition at line 79 of file comm_drv_n2k_serial.h.

◆ SetThreadRunFlag()

void CommDriverN2KSerial::SetThreadRunFlag ( int  run)
inline

Definition at line 88 of file comm_drv_n2k_serial.h.

◆ SetTXPGN()

int CommDriverN2KSerial::SetTXPGN ( int  pgn)
overridevirtual

Reimplemented from CommDriverN2K.

Definition at line 539 of file comm_drv_n2k_serial.cpp.

Member Data Documentation

◆ m_Thread_run_flag

int CommDriverN2KSerial::m_Thread_run_flag

Definition at line 92 of file comm_drv_n2k_serial.h.


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