AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
A NMEA2000 message that describes datum (reference frame) information. PGN 129044 (0x1F814) A common one might be the WGS84 datum or the NSRS, for example. More...
#include <nmea2000_message_definitions.hpp>
Public Member Functions | |
Datum (std::shared_ptr< ControlFunction > source) | |
Constructor for a Datum message data object. | |
std::shared_ptr< ControlFunction > | get_control_function () const |
Returns the control function sending this instance of this message. | |
std::string | get_local_datum () const |
Returns the 4 character ascii datum code. | |
bool | set_local_datum (const std::string &datum) |
Sets the local datum's 4 character ascii datum code. | |
std::string | get_reference_datum () const |
Returns the 4 character ascii datum code that identifies the reference datum. | |
bool | set_reference_datum (const std::string &datum) |
Sets the 4 character ascii datum code that identifies the reference datum. | |
std::int32_t | get_raw_delta_latitude () const |
Returns latitude offset of position in the local datum from the position in the reference datum. In units of 1x10E-7 degrees. | |
double | get_delta_latitude () const |
Returns latitude offset of position in the local datum from the position in the reference datum. In units of degrees. | |
bool | set_delta_latitude (std::int32_t delta) |
Sets latitude offset of position in the local datum from the position in the reference datum in units of 1x10E-7 degrees. | |
std::int32_t | get_raw_delta_longitude () const |
Returns longitude offset of position in the local datum from the position in the reference datum. In units of 1x10E-7 degrees. | |
double | get_delta_longitude () const |
Returns longitude offset of position in the local datum from the position in the reference datum. In units of degrees. | |
bool | set_delta_longitude (std::int32_t delta) |
Sets longitude offset of position in the local datum from the position in the reference datum in units of 1x10E-7 degrees. | |
std::int32_t | get_raw_delta_altitude () const |
Returns the altitude offset of position in the local datum relative to the position in the reference datum in units of The altitude delta in units of 0.01 meters. | |
float | get_delta_altitude () const |
Returns the altitude offset of position in the local datum relative to the position in the reference datum in units of The altitude delta in units of meters. | |
bool | set_delta_altitude (std::int32_t delta) |
Sets the altitude offset of position in the local datum relative to the position in the reference datum in units of The altitude delta in units of 0.01 meters. | |
std::uint32_t | get_timestamp () const |
Returns a timestamp in milliseconds corresponding to when the message was last sent or received. | |
bool | set_timestamp (std::uint32_t timestamp) |
Sets the time in milliseconds when the message was last sent or received. | |
void | serialize (std::vector< std::uint8_t > &buffer) const |
Serializes the current state of this object into a buffer to be sent on the CAN bus. | |
bool | deserialize (const CANMessage &receivedMessage) |
Deserializes a CAN message to populate this object's contents. Updates the timestamp when called. | |
Static Public Member Functions | |
static std::uint32_t | get_timeout () |
Returns the timeout (the sending interval) for this message in milliseconds. | |
Private Attributes | |
std::shared_ptr< ControlFunction > | senderControlFunction |
The sender of the message data. | |
std::string | localDatum |
A 4 character ascii datum code. The first three chars are the datum ID.The fourth char is the local datum subdivision code or a null character if it is unknown or unused. | |
std::string | referenceDatum |
A 4 character ascii datum code that identifies the reference datum. | |
std::int32_t | deltaLatitude = 0 |
Position in the local datum is offset from the position in the reference datum as indicated by this latitude delta. In units of 1x10E-7 degrees. | |
std::int32_t | deltaLongitude = 0 |
Position in the local datum is offset from the position in the reference datum as indicated by this longitude delta. In units of 1x10E-7 degrees. | |
std::int32_t | deltaAltitude = 0 |
The altitude delta in units of 0.01 meters. Positive values indicate Up. | |
std::uint32_t | messageTimestamp_ms = 0 |
A timestamp in milliseconds when this message was last sent or received. | |
Static Private Attributes | |
static constexpr std::uint32_t | CYCLIC_MESSAGE_RATE_MS = 10000 |
The transmit interval for this message as specified in NMEA2000. | |
static constexpr std::uint8_t | LENGTH_BYTES = 20 |
The size of this message in bytes. | |
static constexpr std::uint8_t | DATUM_STRING_LENGTHS = 4 |
The size of the datum codes in bytes. | |
A NMEA2000 message that describes datum (reference frame) information. PGN 129044 (0x1F814) A common one might be the WGS84 datum or the NSRS, for example.
This provides local geodetic datum and datum offsets from a reference datum. This PGN is used to define the datum to which a position location output by the same device in other PGNs is referenced.
Definition at line 775 of file nmea2000_message_definitions.hpp.
|
explicit |
Constructor for a Datum message data object.
[in] | source | The control function sending the message |
Definition at line 985 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::Datum::deserialize | ( | const CANMessage & | receivedMessage | ) |
Deserializes a CAN message to populate this object's contents. Updates the timestamp when called.
[in] | receivedMessage | The CAN message to parse when deserializing |
Definition at line 1120 of file nmea2000_message_definitions.cpp.
std::shared_ptr< ControlFunction > isobus::NMEA2000Messages::Datum::get_control_function | ( | ) | const |
Returns the control function sending this instance of this message.
Definition at line 992 of file nmea2000_message_definitions.cpp.
float isobus::NMEA2000Messages::Datum::get_delta_altitude | ( | ) | const |
Returns the altitude offset of position in the local datum relative to the position in the reference datum in units of The altitude delta in units of meters.
Definition at line 1082 of file nmea2000_message_definitions.cpp.
double isobus::NMEA2000Messages::Datum::get_delta_latitude | ( | ) | const |
Returns latitude offset of position in the local datum from the position in the reference datum. In units of degrees.
Definition at line 1048 of file nmea2000_message_definitions.cpp.
double isobus::NMEA2000Messages::Datum::get_delta_longitude | ( | ) | const |
Returns longitude offset of position in the local datum from the position in the reference datum. In units of degrees.
Definition at line 1060 of file nmea2000_message_definitions.cpp.
std::string isobus::NMEA2000Messages::Datum::get_local_datum | ( | ) | const |
Returns the 4 character ascii datum code.
Definition at line 1009 of file nmea2000_message_definitions.cpp.
std::int32_t isobus::NMEA2000Messages::Datum::get_raw_delta_altitude | ( | ) | const |
Returns the altitude offset of position in the local datum relative to the position in the reference datum in units of The altitude delta in units of 0.01 meters.
Definition at line 1077 of file nmea2000_message_definitions.cpp.
std::int32_t isobus::NMEA2000Messages::Datum::get_raw_delta_latitude | ( | ) | const |
Returns latitude offset of position in the local datum from the position in the reference datum. In units of 1x10E-7 degrees.
Definition at line 1043 of file nmea2000_message_definitions.cpp.
std::int32_t isobus::NMEA2000Messages::Datum::get_raw_delta_longitude | ( | ) | const |
Returns longitude offset of position in the local datum from the position in the reference datum. In units of 1x10E-7 degrees.
Definition at line 1065 of file nmea2000_message_definitions.cpp.
std::string isobus::NMEA2000Messages::Datum::get_reference_datum | ( | ) | const |
Returns the 4 character ascii datum code that identifies the reference datum.
Definition at line 1026 of file nmea2000_message_definitions.cpp.
|
static |
Returns the timeout (the sending interval) for this message in milliseconds.
Definition at line 1149 of file nmea2000_message_definitions.cpp.
std::uint32_t isobus::NMEA2000Messages::Datum::get_timestamp | ( | ) | const |
Returns a timestamp in milliseconds corresponding to when the message was last sent or received.
Definition at line 997 of file nmea2000_message_definitions.cpp.
void isobus::NMEA2000Messages::Datum::serialize | ( | std::vector< std::uint8_t > & | buffer | ) | const |
Serializes the current state of this object into a buffer to be sent on the CAN bus.
[in] | buffer | A buffer to serialize the message data into |
Definition at line 1094 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::Datum::set_delta_altitude | ( | std::int32_t | delta | ) |
Sets the altitude offset of position in the local datum relative to the position in the reference datum in units of The altitude delta in units of 0.01 meters.
[in] | delta | The altitude delta to set in units of 0.01 meters |
Definition at line 1087 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::Datum::set_delta_latitude | ( | std::int32_t | delta | ) |
Sets latitude offset of position in the local datum from the position in the reference datum in units of 1x10E-7 degrees.
[in] | delta | The latitude offset to set in units of 1x10E-7 degrees |
Definition at line 1053 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::Datum::set_delta_longitude | ( | std::int32_t | delta | ) |
Sets longitude offset of position in the local datum from the position in the reference datum in units of 1x10E-7 degrees.
[in] | delta | The longitude offset to set in units of 1x10E-7 degrees |
Definition at line 1070 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::Datum::set_local_datum | ( | const std::string & | datum | ) |
Sets the local datum's 4 character ascii datum code.
[in] | datum | The datum code to set |
Definition at line 1014 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::Datum::set_reference_datum | ( | const std::string & | datum | ) |
Sets the 4 character ascii datum code that identifies the reference datum.
[in] | datum | The datum code to set, must be 4 characters |
Definition at line 1031 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::Datum::set_timestamp | ( | std::uint32_t | timestamp | ) |
Sets the time in milliseconds when the message was last sent or received.
[in] | timestamp | The timestamp (in milliseconds) to set for when this message was sent or received |
Definition at line 1002 of file nmea2000_message_definitions.cpp.
|
staticconstexprprivate |
The transmit interval for this message as specified in NMEA2000.
Definition at line 866 of file nmea2000_message_definitions.hpp.
|
staticconstexprprivate |
The size of the datum codes in bytes.
Definition at line 868 of file nmea2000_message_definitions.hpp.
|
private |
The altitude delta in units of 0.01 meters. Positive values indicate Up.
Definition at line 875 of file nmea2000_message_definitions.hpp.
|
private |
Position in the local datum is offset from the position in the reference datum as indicated by this latitude delta. In units of 1x10E-7 degrees.
Definition at line 873 of file nmea2000_message_definitions.hpp.
|
private |
Position in the local datum is offset from the position in the reference datum as indicated by this longitude delta. In units of 1x10E-7 degrees.
Definition at line 874 of file nmea2000_message_definitions.hpp.
|
staticconstexprprivate |
The size of this message in bytes.
Definition at line 867 of file nmea2000_message_definitions.hpp.
|
private |
A 4 character ascii datum code. The first three chars are the datum ID.The fourth char is the local datum subdivision code or a null character if it is unknown or unused.
Definition at line 871 of file nmea2000_message_definitions.hpp.
|
private |
A timestamp in milliseconds when this message was last sent or received.
Definition at line 876 of file nmea2000_message_definitions.hpp.
|
private |
A 4 character ascii datum code that identifies the reference datum.
Definition at line 872 of file nmea2000_message_definitions.hpp.
|
private |
The sender of the message data.
Definition at line 870 of file nmea2000_message_definitions.hpp.