nmealib 0.0.4
NMEA 0183/NMEA 2000 parsing library
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
nmealib::nmea0183::RMB Class Reference

Represents a parsed NMEA 0183 RMB (Recommended Minimum Navigation Information) sentence. More...

#include <rmb.h>

Inheritance diagram for nmealib::nmea0183::RMB:
Inheritance graph
[legend]
Collaboration diagram for nmealib::nmea0183::RMB:
Collaboration graph
[legend]

Public Member Functions

 RMB (std::string talkerId, char status, double crossTrackErrorNm, char directionToSteer, std::string originWaypointId, std::string destinationWaypointId, double destinationLatitude, char destinationLatitudeHemisphere, double destinationLongitude, char destinationLongitudeHemisphere, double rangeToDestinationNm, double bearingToDestinationTrue, double destinationClosingVelocityKnots, char arrivalStatus, std::optional< char > faaModeIndicator=std::nullopt)
 Construct an RMB message from individual field values.
 
 RMB (const RMB &)=default
 
RMBoperator= (const RMB &)=default
 
 RMB (RMB &&) noexcept=default
 
RMBoperator= (RMB &&) noexcept=default
 
 ~RMB () override=default
 
std::unique_ptr< nmealib::Messageclone () const override
 Create a polymorphic copy of this RMB message.
 
char getStatus () const noexcept
 Get status indicator ('A' active, 'V' invalid).
 
double getCrossTrackErrorNm () const noexcept
 Get cross track error in nautical miles.
 
char getDirectionToSteer () const noexcept
 Get direction to steer ('L' or 'R').
 
std::string getOriginWaypointId () const noexcept
 Get origin waypoint identifier.
 
std::string getDestinationWaypointId () const noexcept
 Get destination waypoint identifier.
 
double getDestinationLatitude () const noexcept
 Get destination waypoint latitude in decimal degrees.
 
char getDestinationLatitudeHemisphere () const noexcept
 Get destination latitude hemisphere indicator ('N' or 'S').
 
double getDestinationLongitude () const noexcept
 Get destination waypoint longitude in decimal degrees.
 
char getDestinationLongitudeHemisphere () const noexcept
 Get destination longitude hemisphere indicator ('E' or 'W').
 
double getRangeToDestinationNm () const noexcept
 Get range to destination in nautical miles.
 
double getBearingToDestinationTrue () const noexcept
 Get bearing to destination in true degrees.
 
double getDestinationClosingVelocityKnots () const noexcept
 Get destination closing velocity in knots.
 
char getArrivalStatus () const noexcept
 Get arrival status ('A' arrived, 'V' not arrived).
 
bool hasFaaModeIndicator () const noexcept
 Return whether FAA mode indicator is present.
 
std::optional< char > getFaaModeIndicator () const noexcept
 Get optional FAA mode indicator (NMEA 2.3+).
 
std::string getStringContent (bool verbose) const noexcept override
 Return a human-readable string representation of this message.
 
bool operator== (const RMB &other) const noexcept
 Compare two RMB messages for equality.
 
- Public Member Functions inherited from nmealib::nmea0183::Message0183
 Message0183 (const Message0183 &)=default
 Copy constructor.
 
Message0183operator= (const Message0183 &)=default
 Copy assignment operator.
 
 Message0183 (Message0183 &&) noexcept=default
 Move constructor.
 
Message0183operator= (Message0183 &&) noexcept=default
 Move assignment operator.
 
 ~Message0183 () override=default
 Destructor.
 
char getStartChar () const noexcept
 Returns the start character of the NMEA 0183 sentence.
 
std::string getTalker () const noexcept
 Returns the talker identifier extracted from the sentence.
 
std::string getSentenceType () const noexcept
 Returns the sentence type identifier extracted from the sentence.
 
std::string getPayload () const noexcept
 Returns the payload of the NMEA 0183 sentence.
 
std::string getChecksumStr () const
 Get the checksum string extracted from the raw sentence.
 
std::string getCalculatedChecksumStr () const noexcept
 Get the calculated checksum string for the sentence payload.
 
std::string serialize () const override
 Returns the wire-format representation of the NMEA 0183 sentence, that is, the raw information that was passed when the message was created.
 
bool operator== (const Message0183 &other) const noexcept
 Compares two Message0183 objects for equality based on their content and timestamp.
 
bool validate () const noexcept override
 Returns whether the message is valid or not.
 
- Public Member Functions inherited from nmealib::Message
 Message ()
 
 Message (std::string raw, Type type=Type::Unknown, TimePoint ts=std::chrono::system_clock::now()) noexcept
 
virtual ~Message ()
 
 Message (const Message &)=default
 
Messageoperator= (const Message &)=default
 
 Message (Message &&) noexcept=default
 
Messageoperator= (Message &&) noexcept=default
 
Type getType () const noexcept
 Returns the message type.
 
const std::string & getRawData () const noexcept
 Returns the raw, unmodified data string as received.
 
TimePoint getTimestamp () const noexcept
 Returns the timestamp associated with this message.
 
bool operator== (const Message &other) const noexcept
 Compares two Message objects for equality based on their content.
 

Friends

class Nmea0183Factory
 
class MessageRegistry
 

Additional Inherited Members

- Public Types inherited from nmealib::Message
enum class  Type { Unknown , NMEA0183 , NMEA2000 }
 Defines the type of NMEA message, allowing for differentiation between various standards. More...
 
using TimePoint = std::chrono::system_clock::time_point
 
- Static Public Member Functions inherited from nmealib::nmea0183::Message0183
static double convertNmeaCoordinateToDecimalDegrees (const std::string &nmeaCoordinate)
 Converts an NMEA coordinate in ddmm.mmmm / dddmm.mmmm format to decimal degrees.
 
- Static Public Member Functions inherited from nmealib::Message
static std::string typeToString (Type t)
 Converts a Message::Type enum value to its string representation.
 
- Protected Member Functions inherited from nmealib::nmea0183::Message0183
std::string toString (bool verbose) const noexcept
 Provides the common string representation for every NMEA 0183 message, which can be used by derived classes to implement their own getStringContent method.
 
- Protected Member Functions inherited from nmealib::Message
void setType (Type t) noexcept
 Sets the message type.
 
void setRaw (std::string r) noexcept
 Sets the raw data string.
 
void setTimestamp (TimePoint ts) noexcept
 Sets the message timestamp.
 
- Static Protected Member Functions inherited from nmealib::nmea0183::Message0183
static std::unique_ptr< Message0183create (const std::string &raw, TimePoint ts=std::chrono::system_clock::now())
 Protected factory method to create a Message0183 from a raw sentence string.
 
- Protected Attributes inherited from nmealib::nmea0183::Message0183
char startChar_
 
std::string talker_
 
std::string sentenceType_
 
std::string payload_
 
std::string checksumStr_
 
std::string calculatedChecksumStr_
 
- Protected Attributes inherited from nmealib::Message
std::string rawData_
 
Type type_ {Type::Unknown}
 
TimePoint timestamp_ {}
 

Detailed Description

Represents a parsed NMEA 0183 RMB (Recommended Minimum Navigation Information) sentence.

RMB is emitted when a destination waypoint is active and carries cross-track error, waypoint IDs, destination coordinates, range/bearing, closing velocity, arrival status, and (for NMEA 2.3+) an optional FAA mode indicator.

Sentence formats:

$--RMB,A,x.x,a,c--c,c--c,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,A*hh<CR><LF>
$--RMB,A,x.x,a,c--c,c--c,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,A,m*hh<CR><LF>
Represents a parsed NMEA 0183 RMB (Recommended Minimum Navigation Information) sentence.
Definition rmb.h:41

Definition at line 41 of file rmb.h.

Constructor & Destructor Documentation

◆ RMB() [1/3]

nmealib::nmea0183::RMB::RMB ( std::string  talkerId,
char  status,
double  crossTrackErrorNm,
char  directionToSteer,
std::string  originWaypointId,
std::string  destinationWaypointId,
double  destinationLatitude,
char  destinationLatitudeHemisphere,
double  destinationLongitude,
char  destinationLongitudeHemisphere,
double  rangeToDestinationNm,
double  bearingToDestinationTrue,
double  destinationClosingVelocityKnots,
char  arrivalStatus,
std::optional< char >  faaModeIndicator = std::nullopt 
)

Construct an RMB message from individual field values.

Latitude and longitude are expected in decimal degrees and are serialized to NMEA coordinate format in the wire sentence.

Parameters
talkerIdTwo-character talker identifier.
statusData status indicator ('A' active, 'V' invalid).
crossTrackErrorNmCross track error in nautical miles.
directionToSteerDirection to steer ('L' or 'R').
originWaypointIdOrigin waypoint identifier.
destinationWaypointIdDestination waypoint identifier.
destinationLatitudeDestination waypoint latitude in decimal degrees.
destinationLatitudeHemisphereLatitude hemisphere indicator ('N' or 'S').
destinationLongitudeDestination waypoint longitude in decimal degrees.
destinationLongitudeHemisphereLongitude hemisphere indicator ('E' or 'W').
rangeToDestinationNmRange to destination in nautical miles.
bearingToDestinationTrueBearing to destination in true degrees.
destinationClosingVelocityKnotsDestination closing velocity in knots.
arrivalStatusArrival status ('A' arrived, 'V' not arrived).
faaModeIndicatorOptional FAA mode indicator (NMEA 2.3+).

Definition at line 112 of file rmb.cpp.

◆ RMB() [2/3]

nmealib::nmea0183::RMB::RMB ( const RMB )
default

◆ RMB() [3/3]

nmealib::nmea0183::RMB::RMB ( RMB &&  )
defaultnoexcept

◆ ~RMB()

nmealib::nmea0183::RMB::~RMB ( )
overridedefault

Member Function Documentation

◆ clone()

std::unique_ptr< nmealib::Message > nmealib::nmea0183::RMB::clone ( ) const
overridevirtual

Create a polymorphic copy of this RMB message.

Returns
std::unique_ptr<nmealib::Message> A heap-allocated copy of this object.

Reimplemented from nmealib::nmea0183::Message0183.

Definition at line 157 of file rmb.cpp.

◆ getArrivalStatus()

char nmealib::nmea0183::RMB::getArrivalStatus ( ) const
noexcept

Get arrival status ('A' arrived, 'V' not arrived).

Definition at line 295 of file rmb.cpp.

◆ getBearingToDestinationTrue()

double nmealib::nmea0183::RMB::getBearingToDestinationTrue ( ) const
noexcept

Get bearing to destination in true degrees.

Definition at line 287 of file rmb.cpp.

◆ getCrossTrackErrorNm()

double nmealib::nmea0183::RMB::getCrossTrackErrorNm ( ) const
noexcept

Get cross track error in nautical miles.

Definition at line 251 of file rmb.cpp.

◆ getDestinationClosingVelocityKnots()

double nmealib::nmea0183::RMB::getDestinationClosingVelocityKnots ( ) const
noexcept

Get destination closing velocity in knots.

Definition at line 291 of file rmb.cpp.

◆ getDestinationLatitude()

double nmealib::nmea0183::RMB::getDestinationLatitude ( ) const
noexcept

Get destination waypoint latitude in decimal degrees.

Definition at line 267 of file rmb.cpp.

◆ getDestinationLatitudeHemisphere()

char nmealib::nmea0183::RMB::getDestinationLatitudeHemisphere ( ) const
noexcept

Get destination latitude hemisphere indicator ('N' or 'S').

Definition at line 271 of file rmb.cpp.

◆ getDestinationLongitude()

double nmealib::nmea0183::RMB::getDestinationLongitude ( ) const
noexcept

Get destination waypoint longitude in decimal degrees.

Definition at line 275 of file rmb.cpp.

◆ getDestinationLongitudeHemisphere()

char nmealib::nmea0183::RMB::getDestinationLongitudeHemisphere ( ) const
noexcept

Get destination longitude hemisphere indicator ('E' or 'W').

Definition at line 279 of file rmb.cpp.

◆ getDestinationWaypointId()

std::string nmealib::nmea0183::RMB::getDestinationWaypointId ( ) const
noexcept

Get destination waypoint identifier.

Definition at line 263 of file rmb.cpp.

◆ getDirectionToSteer()

char nmealib::nmea0183::RMB::getDirectionToSteer ( ) const
noexcept

Get direction to steer ('L' or 'R').

Definition at line 255 of file rmb.cpp.

◆ getFaaModeIndicator()

std::optional< char > nmealib::nmea0183::RMB::getFaaModeIndicator ( ) const
noexcept

Get optional FAA mode indicator (NMEA 2.3+).

Definition at line 303 of file rmb.cpp.

◆ getOriginWaypointId()

std::string nmealib::nmea0183::RMB::getOriginWaypointId ( ) const
noexcept

Get origin waypoint identifier.

Definition at line 259 of file rmb.cpp.

◆ getRangeToDestinationNm()

double nmealib::nmea0183::RMB::getRangeToDestinationNm ( ) const
noexcept

Get range to destination in nautical miles.

Definition at line 283 of file rmb.cpp.

◆ getStatus()

char nmealib::nmea0183::RMB::getStatus ( ) const
noexcept

Get status indicator ('A' active, 'V' invalid).

Definition at line 247 of file rmb.cpp.

◆ getStringContent()

std::string nmealib::nmea0183::RMB::getStringContent ( bool  verbose) const
overridevirtualnoexcept

Return a human-readable string representation of this message.

Parameters
verboseWhen true, returns a multi-line detailed representation.
Returns
std::string Formatted string content.

Reimplemented from nmealib::nmea0183::Message0183.

Definition at line 161 of file rmb.cpp.

◆ hasFaaModeIndicator()

bool nmealib::nmea0183::RMB::hasFaaModeIndicator ( ) const
noexcept

Return whether FAA mode indicator is present.

Definition at line 299 of file rmb.cpp.

◆ operator=() [1/2]

RMB & nmealib::nmea0183::RMB::operator= ( const RMB )
default

◆ operator=() [2/2]

RMB & nmealib::nmea0183::RMB::operator= ( RMB &&  )
defaultnoexcept

◆ operator==()

bool nmealib::nmea0183::RMB::operator== ( const RMB other) const
noexcept

Compare two RMB messages for equality.

Equality delegates to Message0183::operator==.

Parameters
otherThe RMB message to compare with.
Returns
bool true if equal, false otherwise.

Definition at line 307 of file rmb.cpp.

Friends And Related Symbol Documentation

◆ MessageRegistry

friend class MessageRegistry
friend

Definition at line 198 of file rmb.h.

◆ Nmea0183Factory

friend class Nmea0183Factory
friend

Definition at line 197 of file rmb.h.


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