OpenCPN Partial API docs
Loading...
Searching...
No Matches
CommDriverN2KSocketCAN Class Referenceabstract

Driver for NMEA2000 messages over Linux can drivers. More...

#include <comm_drv_n2k_socketcan.h>

Inheritance diagram for CommDriverN2KSocketCAN:
CommDriverN2K AbstractCommDriver CommDriverN2KSocketCanImpl

Public Member Functions

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 SendMessage (std::shared_ptr< const NavMsg > msg, std::shared_ptr< const NavAddr > addr)=0
 
virtual bool Open ()=0
 
virtual void Close ()=0
 
- 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
 

Static Public Member Functions

static std::shared_ptr< CommDriverN2KSocketCANCreate (const ConnectionParams *params, DriverListener &listener)
 

Protected Member Functions

 CommDriverN2KSocketCAN (const ConnectionParams *params, DriverListener &listener)
 
- Protected Member Functions inherited from AbstractCommDriver
 AbstractCommDriver (NavAddr::Bus b)
 
 AbstractCommDriver (NavAddr::Bus b, const std::string &s)
 

Protected Attributes

ConnectionParams m_params
 
DriverListenerm_listener
 

Additional Inherited Members

- 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
 

Detailed Description

Driver for NMEA2000 messages over Linux can drivers.

Definition at line 36 of file comm_drv_n2k_socketcan.h.

Constructor & Destructor Documentation

◆ ~CommDriverN2KSocketCAN()

CommDriverN2KSocketCAN::~CommDriverN2KSocketCAN ( )
virtual

Definition at line 490 of file comm_drv_n2k_socketcan.cpp.

◆ CommDriverN2KSocketCAN()

CommDriverN2KSocketCAN::CommDriverN2KSocketCAN ( const ConnectionParams params,
DriverListener listener 
)
protected

Definition at line 481 of file comm_drv_n2k_socketcan.cpp.

Member Function Documentation

◆ Activate()

void CommDriverN2KSocketCAN::Activate ( )
overridevirtual

Register driver and possibly do other post-ctor steps.

Implements AbstractCommDriver.

Definition at line 492 of file comm_drv_n2k_socketcan.cpp.

◆ Create()

std::shared_ptr< CommDriverN2KSocketCAN > CommDriverN2KSocketCAN::Create ( const ConnectionParams params,
DriverListener listener 
)
static

Definition at line 277 of file comm_drv_n2k_socketcan.cpp.

◆ SendMessage()

bool CommDriverN2KSocketCAN::SendMessage ( std::shared_ptr< const NavMsg msg,
std::shared_ptr< const NavAddr addr 
)
pure virtual

Implements CommDriverN2K.

◆ SetListener()

void CommDriverN2KSocketCAN::SetListener ( DriverListener l)
inlineoverridevirtual

Set the entity which will receive incoming data.

By default, such data is ignored

Reimplemented from CommDriverN2K.

Definition at line 46 of file comm_drv_n2k_socketcan.h.

Member Data Documentation

◆ m_listener

DriverListener& CommDriverN2KSocketCAN::m_listener
protected

Definition at line 58 of file comm_drv_n2k_socketcan.h.

◆ m_params

ConnectionParams CommDriverN2KSocketCAN::m_params
protected

Definition at line 57 of file comm_drv_n2k_socketcan.h.


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