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

Abstract driver interface for NMEA2000 messages. More...

#include <comm_drv_n2k.h>

Inheritance diagram for CommDriverN2K:
AbstractCommDriver CommDriverN2KSerial CommDriverN2KSocketCAN CommDriverN2KSocketCanImpl

Public Member Functions

 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
 

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
 
- Protected Member Functions inherited from AbstractCommDriver
 AbstractCommDriver (NavAddr::Bus b)
 
 AbstractCommDriver (NavAddr::Bus b, const std::string &s)
 

Detailed Description

Abstract driver interface for NMEA2000 messages.

Definition at line 33 of file comm_drv_n2k.h.

Constructor & Destructor Documentation

◆ CommDriverN2K()

CommDriverN2K::CommDriverN2K ( const std::string &  s = "n2k0")

Definition at line 40 of file comm_drv_n2k.cpp.

◆ ~CommDriverN2K()

CommDriverN2K::~CommDriverN2K ( )
virtual

Definition at line 43 of file comm_drv_n2k.cpp.

Member Function Documentation

◆ GetAddress()

std::shared_ptr< NavAddr > CommDriverN2K::GetAddress ( const N2kName name)
virtual

Definition at line 50 of file comm_drv_n2k.cpp.

◆ SendMessage()

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

Implements AbstractCommDriver.

Definition at line 45 of file comm_drv_n2k.cpp.

◆ SetListener()

void CommDriverN2K::SetListener ( DriverListener l)
overridevirtual

Set the entity which will receive incoming data.

By default, such data is ignored

Reimplemented from AbstractCommDriver.

Reimplemented in CommDriverN2KSerial, and CommDriverN2KSocketCAN.

Definition at line 48 of file comm_drv_n2k.cpp.

◆ SetTXPGN()

virtual int CommDriverN2K::SetTXPGN ( int  pgn)
inlinevirtual

Definition at line 43 of file comm_drv_n2k.h.


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