AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
Represents the data sent in the NMEA2K PGN 127251 (0x1F113) More...
#include <nmea2000_message_definitions.hpp>
Public Member Functions | |
RateOfTurn (std::shared_ptr< ControlFunction > source) | |
Constructor for a RateOfTurn message data object. | |
std::shared_ptr< ControlFunction > | get_control_function () const |
Returns the control function sending this instance of this message. | |
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. | |
std::int32_t | get_raw_rate_of_turn () const |
Returns the rate of turn of the vessel/vehicle in units of 1/32 x 10E-6 rad/s. | |
double | get_rate_of_turn () const |
Returns the rate of turn of the vessel/vehicle in rad/s. | |
bool | set_rate_of_turn (std::int32_t turnRate) |
Sets the rate of turn in units of 1/32 x 10E-6 rad/s. | |
std::uint8_t | get_sequence_id () const |
Returns the sequence ID. This is used to associate data within other PGNs with this message. | |
bool | set_sequence_id (std::uint8_t sequenceNumber) |
Sets the sequence ID for this message. | |
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::uint32_t | messageTimestamp_ms = 0 |
A timestamp in milliseconds when this message was last sent or received. | |
std::int32_t | rateOfTurn = 0 |
The rate of turn in 1/32 * 10e-6 rad/s. Positive values indicate turning right (starboard) relative to the vehicle's reference point. | |
std::uint8_t | sequenceID = 0 |
The sequence identifier field is used to tie related PGNs together. Somewhat arbitrary. | |
Static Private Attributes | |
static constexpr std::uint32_t | CYCLIC_MESSAGE_RATE_MS = 100 |
The interval in milliseconds on which this message should be sent/received. | |
Represents the data sent in the NMEA2K PGN 127251 (0x1F113)
Definition at line 142 of file nmea2000_message_definitions.hpp.
|
explicit |
Constructor for a RateOfTurn message data object.
[in] | source | The control function sending the message |
Definition at line 160 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::RateOfTurn::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 225 of file nmea2000_message_definitions.cpp.
std::shared_ptr< ControlFunction > isobus::NMEA2000Messages::RateOfTurn::get_control_function | ( | ) | const |
Returns the control function sending this instance of this message.
Definition at line 165 of file nmea2000_message_definitions.cpp.
double isobus::NMEA2000Messages::RateOfTurn::get_rate_of_turn | ( | ) | const |
Returns the rate of turn of the vessel/vehicle in rad/s.
Definition at line 187 of file nmea2000_message_definitions.cpp.
std::int32_t isobus::NMEA2000Messages::RateOfTurn::get_raw_rate_of_turn | ( | ) | const |
Returns the rate of turn of the vessel/vehicle in units of 1/32 x 10E-6 rad/s.
Definition at line 182 of file nmea2000_message_definitions.cpp.
std::uint8_t isobus::NMEA2000Messages::RateOfTurn::get_sequence_id | ( | ) | const |
Returns the sequence ID. This is used to associate data within other PGNs with this message.
Definition at line 199 of file nmea2000_message_definitions.cpp.
|
static |
Returns the timeout (the sending interval) for this message in milliseconds.
Definition at line 246 of file nmea2000_message_definitions.cpp.
std::uint32_t isobus::NMEA2000Messages::RateOfTurn::get_timestamp | ( | ) | const |
Returns a timestamp in milliseconds corresponding to when the message was last sent or received.
Definition at line 170 of file nmea2000_message_definitions.cpp.
void isobus::NMEA2000Messages::RateOfTurn::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 211 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::RateOfTurn::set_rate_of_turn | ( | std::int32_t | turnRate | ) |
Sets the rate of turn in units of 1/32 x 10E-6 rad/s.
[in] | turnRate | The rate of turn to set, in units of 1/32 x 10E-6 rad/s |
Definition at line 192 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::RateOfTurn::set_sequence_id | ( | std::uint8_t | sequenceNumber | ) |
Sets the sequence ID for this message.
[in] | sequenceNumber | The sequence number to set. Max value is 252. |
Definition at line 204 of file nmea2000_message_definitions.cpp.
bool isobus::NMEA2000Messages::RateOfTurn::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 175 of file nmea2000_message_definitions.cpp.
|
staticconstexprprivate |
The interval in milliseconds on which this message should be sent/received.
Definition at line 198 of file nmea2000_message_definitions.hpp.
|
private |
A timestamp in milliseconds when this message was last sent or received.
Definition at line 201 of file nmea2000_message_definitions.hpp.
|
private |
The rate of turn in 1/32 * 10e-6 rad/s. Positive values indicate turning right (starboard) relative to the vehicle's reference point.
Definition at line 202 of file nmea2000_message_definitions.hpp.
|
private |
The sender of the message data.
Definition at line 200 of file nmea2000_message_definitions.hpp.
|
private |
The sequence identifier field is used to tie related PGNs together. Somewhat arbitrary.
Definition at line 203 of file nmea2000_message_definitions.hpp.