Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::comms::nmea0183 Namespace Reference

Classes

class  Nmea0183CommunicationController
 
class  Nmea0183CommunicationControllerFrame
 
class  Nmea0183CommunicationProtocol
 
struct  NmeaChannelBinding
 Contains the information pertaining a single NMEA fild/Channel pairing in a nmea0183 communication. More...
 
struct  NmeaMessage
 NMEA message class. More...
 

Enumerations

enum class  Pole { True , Magnetic }
 Kinds of North pole. More...
 
enum class  eFieldType {
  Boolean , Hexadecimal , Integer , Decimal ,
  String , NorthPole , Coordinate , Time ,
  Date
}
 

Functions

std::string nmeaChecksum (const std::string &completeMsg)
 Compute the checksum of a message for NMEA0183.
 
double degreesToDecimal (const int32_t degrees, const double minutes, const int32_t seconds=0)
 Converts degress, minutes and seconds to decimal geometric degrees.
 
std::vector< std::string > splitStringBy (const std::string &sentence, const char delimiter)
 
bool getCoordinates (std::string array, double &decimalDegrees)
 Converts a string with the format "D*MM.MMMM" to decimal degrees.
 
std::optional< bool > nmea0183FieldToBoolean (std::string_view data)
 Converts a NMEA0183 field to a boolean.
 
std::optional< uint16_t > nmea0183FieldToInteger (std::string_view data)
 Converts a NMEA0183 field to an integer.
 
std::optional< float > nmea0183FieldToFloat (std::string_view data)
 Converts a NMEA0183 field to a float.
 
std::optional< std::string > nmea0183FieldToTime (std::string_view data)
 Converts a NMEA0183 time field to a string representation of day time.
 
std::optional< iv::comms::nmea0183::PolenmeaField0183ToPole (std::string_view data)
 Converts a NMEA0183 field to a Pole.
 
std::optional< iv::types::channelValueprocessValue (std::string_view stringValue, iv::comms::nmea0183::eFieldType nmeaFieldType)
 parses the value of a NMEA0183 field according to it's type
 

Enumeration Type Documentation

◆ eFieldType

Enumerator
Boolean 
Hexadecimal 
Integer 
Decimal 
String 
NorthPole 
Coordinate 
Time 
Date 

◆ Pole

enum class iv::comms::nmea0183::Pole
strong

Kinds of North pole.

Enumerator
True 
Magnetic 

Function Documentation

◆ degreesToDecimal()

double iv::comms::nmea0183::degreesToDecimal ( const int32_t degrees,
const double minutes,
const int32_t seconds = 0 )
inlinenodiscard

Converts degress, minutes and seconds to decimal geometric degrees.

Parameters
degreesdegrees
minutesminutes
secondsseconds, optional
Returns
The decimal geometric degrees

◆ getCoordinates()

bool iv::comms::nmea0183::getCoordinates ( std::string array,
double & decimalDegrees )
inlinenodiscard

Converts a string with the format "D*MM.MMMM" to decimal degrees.

Parameters
arraystring with the format "D*DMM.MMMM", the number of digits representig degrees is variable
decimalDegreesoutput variable with the result
Returns
true if the conversion was successful, false otherwise

◆ nmea0183FieldToBoolean()

std::optional< bool > iv::comms::nmea0183::nmea0183FieldToBoolean ( std::string_view data)
inlinenodiscard

Converts a NMEA0183 field to a boolean.

Parameters
datafield as a string
Returns
true if the field is "1", false if the field is "0", std::nullopt otherwise

◆ nmea0183FieldToFloat()

std::optional< float > iv::comms::nmea0183::nmea0183FieldToFloat ( std::string_view data)
inlinenodiscard

Converts a NMEA0183 field to a float.

Parameters
datafield as a string
Returns
The float value of the field or std::nullopt if the field is not a valid number

◆ nmea0183FieldToInteger()

std::optional< uint16_t > iv::comms::nmea0183::nmea0183FieldToInteger ( std::string_view data)
inlinenodiscard

Converts a NMEA0183 field to an integer.

Parameters
datafield as a string
Returns
The integer value of the field or std::nullopt if the field is not a valid number

◆ nmea0183FieldToTime()

std::optional< std::string > iv::comms::nmea0183::nmea0183FieldToTime ( std::string_view data)
inlinenodiscard

Converts a NMEA0183 time field to a string representation of day time.

Parameters
datathe field as a string with the format HHMMSS
Returns
A string formated as "Hours: {}, Minutes: {}, Seconds: {}"
Note
This function does not check the validity of the input

◆ nmeaChecksum()

std::string iv::comms::nmea0183::nmeaChecksum ( const std::string & completeMsg)
inline

Compute the checksum of a message for NMEA0183.

Parameters
completeMsgNmea0183 Message without the checksum
Returns
The checksum as std::string

◆ nmeaField0183ToPole()

std::optional< iv::comms::nmea0183::Pole > iv::comms::nmea0183::nmeaField0183ToPole ( std::string_view data)
inlinenodiscard

Converts a NMEA0183 field to a Pole.

Parameters
datafield as a string
Returns
Pole::True if 'T', Pole::Magnetic if 'M', std::nullopt otherwise

◆ processValue()

std::optional< iv::types::channelValue > iv::comms::nmea0183::processValue ( std::string_view stringValue,
iv::comms::nmea0183::eFieldType nmeaFieldType )
inline

parses the value of a NMEA0183 field according to it's type

Parameters
stringValueValue of the field as a string
nmeaFieldTypeType of the filed
Returns

◆ splitStringBy()

std::vector< std::string > iv::comms::nmea0183::splitStringBy ( const std::string & sentence,
const char delimiter )
inline