NMEAParser
NMEA Parser Library - Monte Variakojis @VisualGPS
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CNMEASentenceBase Class Referenceabstract

This is the base class for every NMEA sentence. More...

#include <NMEASentenceBase.h>

Inheritance diagram for CNMEASentenceBase:
CNMEASentenceGGA CNMEASentenceGSA CNMEASentenceGSV CNMEASentenceRMC

Public Member Functions

 CNMEASentenceBase ()
 
 ~CNMEASentenceBase ()
 
virtual CNMEAParserData::ERROR_E ProcessSentence (char *pCmd, char *pData)=0
 Process the data from the specific NMEA sentence. More...
 
virtual void ResetData (void)=0
 Clears the sentence specific data to a default value. More...
 

Static Public Attributes

static const int c_nMaxField = 256
 Maximum field length. More...
 

Protected Member Functions

CNMEAParserData::ERROR_E GetField (char *pData, char *pField, int nFieldNum, int nMaxFieldLen)
 This function will get the specified field in a NMEA string. More...
 

Protected Attributes

unsigned int m_uRxCount
 Receive count. More...
 

Private Attributes

std::string m_strSentenceID
 Sentence ID, ie: GGA, RMC, etc... More...
 
CNMEAParserData::TALKER_ID_E m_nTalkerID
 Talker ID, ie: GP, GN, etc... More...
 

Detailed Description

This is the base class for every NMEA sentence.

Definition at line 34 of file NMEASentenceBase.h.

Constructor & Destructor Documentation

◆ CNMEASentenceBase()

CNMEASentenceBase::CNMEASentenceBase ( )

Definition at line 29 of file NMEASentenceBase.cpp.

◆ ~CNMEASentenceBase()

CNMEASentenceBase::~CNMEASentenceBase ( )

Definition at line 35 of file NMEASentenceBase.cpp.

Member Function Documentation

◆ GetField()

CNMEAParserData::ERROR_E CNMEASentenceBase::GetField ( char *  pData,
char *  pField,
int  nFieldNum,
int  nMaxFieldLen 
)
protected

This function will get the specified field in a NMEA string.

Parameters
pData- Pointer to NMEA string
pField- pointer to returned field
nFieldNum- Field offset to get
nMaxFieldLen- Maximum of bytes pFiled can handle

Definition at line 39 of file NMEASentenceBase.cpp.

◆ ProcessSentence()

virtual CNMEAParserData::ERROR_E CNMEASentenceBase::ProcessSentence ( char *  pCmd,
char *  pData 
)
pure virtual

Process the data from the specific NMEA sentence.

This method was made into a pure virtual to force the child class to define the sentence processor. You must redefine this method to process the specific data. See CNMEASentenceGGA::ProcessSentence() child class method for an example.

Parameters
pCmdTalker command
pDataComma separated talker data string.
Returns
ERROR_OK if successful

Implemented in CNMEASentenceRMC, CNMEASentenceGGA, CNMEASentenceGSA, and CNMEASentenceGSV.

◆ ResetData()

virtual void CNMEASentenceBase::ResetData ( void  )
pure virtual

Clears the sentence specific data to a default value.

This method was made into a pure virtual to force the child class to define the sentence processor. You must redefine this method to process the specific data. See CNMEASentenceGGA::ResetData() child class method for an example.

Implemented in CNMEASentenceRMC, CNMEASentenceGGA, CNMEASentenceGSA, and CNMEASentenceGSV.

Member Data Documentation

◆ c_nMaxField

const int CNMEASentenceBase::c_nMaxField = 256
static

Maximum field length.

Definition at line 37 of file NMEASentenceBase.h.

◆ m_nTalkerID

CNMEAParserData::TALKER_ID_E CNMEASentenceBase::m_nTalkerID
private

Talker ID, ie: GP, GN, etc...

Definition at line 41 of file NMEASentenceBase.h.

◆ m_strSentenceID

std::string CNMEASentenceBase::m_strSentenceID
private

Sentence ID, ie: GGA, RMC, etc...

Definition at line 40 of file NMEASentenceBase.h.

◆ m_uRxCount

unsigned int CNMEASentenceBase::m_uRxCount
protected

Receive count.

Definition at line 44 of file NMEASentenceBase.h.


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