OpenCPN Partial API docs
AbstractCommDriver Class Referenceabstract

Common interface for all drivers. More...

#include <comm_driver.h>

Inheritance diagram for AbstractCommDriver:
CommDriverN0183 CommDriverN2K CommDriverSignalK FileCommDriver CommDriverN0183AndroidBT CommDriverN0183AndroidInt CommDriverN0183Net CommDriverN0183Serial CommDriverN2KNet CommDriverN2KSerial CommDriverN2KSocketCAN CommDriverSignalKNet

Public Member Functions

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.
 
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

const NavAddr::Bus bus
 
const std::string iface
 Physical device for 0183, else a unique string.
 
std::unordered_map< std::string, std::string > attributes
 

Protected Member Functions

 AbstractCommDriver (NavAddr::Bus b)
 
 AbstractCommDriver (NavAddr::Bus b, const std::string &s)
 

Detailed Description

Common interface for all drivers.


Definition at line 57 of file comm_driver.h.

Member Function Documentation

◆ Clone()

virtual std::pair<CommStatus, std::string> AbstractCommDriver::Clone ( )
inlinevirtual

Create a new virtual interface using a new instance of this driver.

A successful return guarantees that the new driver is registered in the device registry and activated.

Returns
<CommStatus::ok, interface> on success else <error_code, message>.

Definition at line 81 of file comm_driver.h.

◆ SetListener()

virtual void AbstractCommDriver::SetListener ( DriverListener l)
inlinevirtual

Set the entity which will receive incoming data.

By default, such data is ignored

Reimplemented in CommDriverSignalK, CommDriverN2KSocketCAN, CommDriverN2KSerial, CommDriverN2KNet, CommDriverN2K, and CommDriverN0183.

Definition at line 72 of file comm_driver.h.


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