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

NMEA0183 basic parsing common parts: More...

#include <comm_drv_n0183.h>

Inheritance diagram for CommDriverN0183:
AbstractCommDriver CommDriverN0183AndroidBT CommDriverN0183AndroidInt CommDriverN0183Net CommDriverN0183Serial

Public Member Functions

 CommDriverN0183 (NavAddr::Bus b, const std::string &s)
 
bool SendMessage (std::shared_ptr< const NavMsg > msg, std::shared_ptr< const NavAddr > addr) override=0
 
virtual const ConnectionParamsGetParams () const =0
 
void SetListener (DriverListener &l) override
 Set the entity which will receive incoming data.
 
virtual std::shared_ptr< NavAddrGetAddress ()
 
- Public Member Functions inherited from AbstractCommDriver
virtual std::pair< CommStatus, std::string > Clone ()
 Create a new virtual interface using a new instance of this driver.
 
std::string Key () const
 
virtual std::unordered_map< std::string, std::string > GetAttributes () const
 

Protected Member Functions

void SendToListener (const std::string &payload, DriverListener &listener, const ConnectionParams &params)
 Wrap argument string in NavMsg pointer, forward to listener.
 
- Protected Member Functions inherited from AbstractCommDriver
 AbstractCommDriver (NavAddr::Bus b)
 
 AbstractCommDriver (NavAddr::Bus b, const std::string &s)
 

Additional Inherited Members

- Public Attributes inherited from AbstractCommDriver
const NavAddr::Bus bus
 
const std::string iface
 Physical device for 0183, else a unique string.
 
std::unordered_map< std::string, std::string > attributes
 

Detailed Description

NMEA0183 basic parsing common parts:

  • Input is processed as lines.
  • Lines missing an initial '$' or '!' are marked as garbage.
  • Anything preceding first '$' or '!', including v4 tags, is silently dropped.
  • Sentences without checksum are allowed.
  • Sentences without checksum longer than 128 chars are marked as garbage.
  • Sentences with an incorrect checksum are marked as such.
  • Sentences filtered by input filters are marked as such.

For messages which are not garbage the driver guarantees that

  1. First characted is '$' or '!'-
  2. For messages without checksum: the length is <= 128 chars.

Definition at line 54 of file comm_drv_n0183.h.

Constructor & Destructor Documentation

◆ CommDriverN0183() [1/2]

CommDriverN0183::CommDriverN0183 ( )

Definition at line 65 of file comm_drv_n0183.cpp.

◆ CommDriverN0183() [2/2]

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

Definition at line 67 of file comm_drv_n0183.cpp.

Member Function Documentation

◆ GetAddress()

virtual std::shared_ptr< NavAddr > CommDriverN0183::GetAddress ( )
inlinevirtual

Definition at line 68 of file comm_drv_n0183.h.

◆ SendMessage()

bool CommDriverN0183::SendMessage ( std::shared_ptr< const NavMsg msg,
std::shared_ptr< const NavAddr addr 
)
overridepure virtual

Implements AbstractCommDriver.

◆ SendToListener()

void CommDriverN0183::SendToListener ( const std::string &  payload,
DriverListener listener,
const ConnectionParams params 
)
protected

Wrap argument string in NavMsg pointer, forward to listener.

Definition at line 72 of file comm_drv_n0183.cpp.

◆ SetListener()

void CommDriverN0183::SetListener ( DriverListener l)
inlineoverridevirtual

Set the entity which will receive incoming data.

By default, such data is ignored

Reimplemented from AbstractCommDriver.

Definition at line 66 of file comm_drv_n0183.h.


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