Public Member Functions | Static Private Attributes | List of all members
nmea::ProtocolHandler Class Reference

The protocol handler for a different NMEA data types. More...

#include <nmea_protocolhandler.h>

Inheritance diagram for nmea::ProtocolHandler:
Inheritance graph
[legend]

Public Member Functions

XsMessage convertToMessage (MessageLocation &location, const XsByteArray &raw) const override
 Converts raw data using location into a XsMessage object. More...
 
MessageLocation findMessage (XsProtocolType &type, const XsByteArray &raw) const override
 Find the first message in the raw byte stream. More...
 
int maximumMessageSize () const override
 
int minimumMessageSize () const override
 
 ProtocolHandler ()
 Default constructor. More...
 
int type () const override
 
virtual ~ProtocolHandler () throw ()
 Deafult destructor. More...
 
- Public Member Functions inherited from IProtocolHandler
virtual void ignoreMaximumMessageSize (bool ignore)
 Tells the protocol handler to ignore/expand its maximum message size. More...
 
virtual bool setEnable (bool enable)
 Enables or disables the protocol handler if supported. A disabled protocol handler ignores and discards all data provided through the findMessage function. More...
 
virtual ~IProtocolHandler ()
 Destructor. More...
 

Static Private Attributes

static const int MAXIMUM_MESSAGE_SIZE = 128
 
static const int MINIMUM_MESSAGE_SIZE = 16
 

Detailed Description

The protocol handler for a different NMEA data types.

Definition at line 76 of file nmea_protocolhandler.h.

Constructor & Destructor Documentation

◆ ProtocolHandler()

ProtocolHandler::ProtocolHandler ( )

Default constructor.

Definition at line 84 of file nmea_protocolhandler.cpp.

◆ ~ProtocolHandler()

ProtocolHandler::~ProtocolHandler ( )
throw (
)
virtual

Deafult destructor.

Definition at line 90 of file nmea_protocolhandler.cpp.

Member Function Documentation

◆ convertToMessage()

XsMessage ProtocolHandler::convertToMessage ( MessageLocation location,
const XsByteArray raw 
) const
overridevirtual

Converts raw data using location into a XsMessage object.

Parameters
locationThe location of a message to convert from raw data.
rawThe raw byte stream.
Returns
A XsMessage object that was converted from raw byte stream.

Implements IProtocolHandler.

Definition at line 151 of file nmea_protocolhandler.cpp.

◆ findMessage()

MessageLocation ProtocolHandler::findMessage ( XsProtocolType type,
const XsByteArray raw 
) const
overridevirtual

Find the first message in the raw byte stream.

This function scans raw for a sequence of bytes that can contain a full message. It returns the location and total byte size of the message so that the caller can remove those bytes from the stream. The return value can also describe that a partial message has been found. Return values:

  • startpos >= 0 and size > 0: A full message with size has been found at startpos.
  • startpos >= 0 and size == 0: The start of a message has been found at startpos, but the size could not yet be determined.
  • startpos >= 0 and size < 0: The start of a message has been found at startpos, and the size of the full message is at least -size.
  • startpos < 0: No messages have been found.
Parameters
typeThe protocol type that was used.
rawThe raw byte stream to analyze.
Returns
A MessageLocation object that describes what was found.

Implements IProtocolHandler.

Definition at line 96 of file nmea_protocolhandler.cpp.

◆ maximumMessageSize()

int ProtocolHandler::maximumMessageSize ( ) const
overridevirtual
Returns
The maximum message size

Implements IProtocolHandler.

Definition at line 167 of file nmea_protocolhandler.cpp.

◆ minimumMessageSize()

int ProtocolHandler::minimumMessageSize ( ) const
overridevirtual
Returns
The minimum message size

Implements IProtocolHandler.

Definition at line 160 of file nmea_protocolhandler.cpp.

◆ type()

int ProtocolHandler::type ( ) const
overridevirtual
Returns
The type of the protocol

Implements IProtocolHandler.

Definition at line 173 of file nmea_protocolhandler.cpp.

Member Data Documentation

◆ MAXIMUM_MESSAGE_SIZE

const int nmea::ProtocolHandler::MAXIMUM_MESSAGE_SIZE = 128
staticprivate

Definition at line 90 of file nmea_protocolhandler.h.

◆ MINIMUM_MESSAGE_SIZE

const int nmea::ProtocolHandler::MINIMUM_MESSAGE_SIZE = 16
staticprivate

Definition at line 89 of file nmea_protocolhandler.h.


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


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:22