AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
isobus::NMEA2000Messages::RateOfTurn Class Reference

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< ControlFunctionget_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< ControlFunctionsenderControlFunction
 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.
 

Detailed Description

Represents the data sent in the NMEA2K PGN 127251 (0x1F113)

Definition at line 142 of file nmea2000_message_definitions.hpp.

Constructor & Destructor Documentation

◆ RateOfTurn()

isobus::NMEA2000Messages::RateOfTurn::RateOfTurn ( std::shared_ptr< ControlFunction > source)
explicit

Constructor for a RateOfTurn message data object.

Parameters
[in]sourceThe control function sending the message

Definition at line 160 of file nmea2000_message_definitions.cpp.

Member Function Documentation

◆ deserialize()

bool isobus::NMEA2000Messages::RateOfTurn::deserialize ( const CANMessage & receivedMessage)

Deserializes a CAN message to populate this object's contents. Updates the timestamp when called.

Parameters
[in]receivedMessageThe CAN message to parse when deserializing
Returns
True if the message was successfully deserialized and the data content was different than the stored content.

Definition at line 225 of file nmea2000_message_definitions.cpp.

Here is the call graph for this function:

◆ get_control_function()

std::shared_ptr< ControlFunction > isobus::NMEA2000Messages::RateOfTurn::get_control_function ( ) const

Returns the control function sending this instance of this message.

Returns
The control function sending this instance of this message

Definition at line 165 of file nmea2000_message_definitions.cpp.

◆ get_rate_of_turn()

double isobus::NMEA2000Messages::RateOfTurn::get_rate_of_turn ( ) const

Returns the rate of turn of the vessel/vehicle in rad/s.

Returns
The rate of turn of the vessel/vehicle in rad/s

Definition at line 187 of file nmea2000_message_definitions.cpp.

◆ get_raw_rate_of_turn()

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.

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.

◆ get_sequence_id()

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.

Returns
The sequence ID for this message

Definition at line 199 of file nmea2000_message_definitions.cpp.

◆ get_timeout()

std::uint32_t isobus::NMEA2000Messages::RateOfTurn::get_timeout ( )
static

Returns the timeout (the sending interval) for this message in milliseconds.

Returns
This message's timeout (the sending interval) in milliseconds

Definition at line 246 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

◆ get_timestamp()

std::uint32_t isobus::NMEA2000Messages::RateOfTurn::get_timestamp ( ) const

Returns a timestamp in milliseconds corresponding to when the message was last sent or received.

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.

◆ serialize()

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.

Parameters
[in]bufferA buffer to serialize the message data into

Definition at line 211 of file nmea2000_message_definitions.cpp.

◆ set_rate_of_turn()

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.

Parameters
[in]turnRateThe rate of turn to set, in units of 1/32 x 10E-6 rad/s
Returns
true if the value that was set was different from the stored value

Definition at line 192 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

◆ set_sequence_id()

bool isobus::NMEA2000Messages::RateOfTurn::set_sequence_id ( std::uint8_t sequenceNumber)

Sets the sequence ID for this message.

Parameters
[in]sequenceNumberThe sequence number to set. Max value is 252.
Returns
true if the value that was set was different from the stored value

Definition at line 204 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

◆ set_timestamp()

bool isobus::NMEA2000Messages::RateOfTurn::set_timestamp ( std::uint32_t timestamp)

Sets the time in milliseconds when the message was last sent or received.

Parameters
[in]timestampThe timestamp (in milliseconds) to set for when this message was sent or received
Returns
true if the value that was set was different from the stored value

Definition at line 175 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ CYCLIC_MESSAGE_RATE_MS

constexpr std::uint32_t isobus::NMEA2000Messages::RateOfTurn::CYCLIC_MESSAGE_RATE_MS = 100
staticconstexprprivate

The interval in milliseconds on which this message should be sent/received.

Definition at line 198 of file nmea2000_message_definitions.hpp.

◆ messageTimestamp_ms

std::uint32_t isobus::NMEA2000Messages::RateOfTurn::messageTimestamp_ms = 0
private

A timestamp in milliseconds when this message was last sent or received.

Definition at line 201 of file nmea2000_message_definitions.hpp.

◆ rateOfTurn

std::int32_t isobus::NMEA2000Messages::RateOfTurn::rateOfTurn = 0
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.

◆ senderControlFunction

std::shared_ptr<ControlFunction> isobus::NMEA2000Messages::RateOfTurn::senderControlFunction
private

The sender of the message data.

Definition at line 200 of file nmea2000_message_definitions.hpp.

◆ sequenceID

std::uint8_t isobus::NMEA2000Messages::RateOfTurn::sequenceID = 0
private

The sequence identifier field is used to tie related PGNs together. Somewhat arbitrary.

Definition at line 203 of file nmea2000_message_definitions.hpp.


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