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

Represents the data sent in the NMEA2K PGN 129026 (0x1F802) More...

#include <nmea2000_message_definitions.hpp>

Public Types

enum class  CourseOverGroundReference : std::uint8_t { True = 0 , Magnetic = 1 , Error = 2 , NotApplicableOrNull = 3 }
 Enumerates the references to which the course may be relative to. More...
 

Public Member Functions

 CourseOverGroundSpeedOverGroundRapidUpdate (std::shared_ptr< ControlFunction > source)
 Constructor for a CourseOverGroundSpeedOverGroundRapidUpdate 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::uint16_t get_raw_course_over_ground () const
 Returns the course over ground in its base units of 0.0001 radians (between 0 and 2 pi radians)
 
float get_course_over_ground () const
 Returns the course over ground in units of radians.
 
bool set_course_over_ground (std::uint16_t course)
 Sets the course over ground in units of 0.0001 radians.
 
std::uint16_t get_raw_speed_over_ground () const
 Returns the speed over ground in units of 0.01 meters per second.
 
float get_speed_over_ground () const
 Returns the speed over ground in units of meters per second.
 
bool set_speed_over_ground (std::uint16_t speed)
 Sets the speed over ground in units of 0.01 meters per second.
 
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.
 
CourseOverGroundReference get_course_over_ground_reference () const
 Returns the reference to which the course over ground is relative.
 
bool set_course_over_ground_reference (CourseOverGroundReference reference)
 Sets the reference to which the course over ground is relative.
 
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::uint16_t courseOverGround = 0
 This field contains the direction of the path over ground actually followed by the vessel in 0.0001 radians between 0 and 2pi rad.
 
std::uint16_t speedOverGround = 0
 This field contains the speed of the vessel in 0.01 m/s.
 
std::uint8_t sequenceID = 0
 The sequence identifier field is used to tie related PGNs together. Somewhat arbitrary.
 
CourseOverGroundReference cogReference = CourseOverGroundReference::NotApplicableOrNull
 Used to indicate the reference for the course over ground, ie true or magnetic north.
 

Static Private Attributes

static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS = 250
 The transmit interval for this message as specified in NMEA2000.
 

Detailed Description

Represents the data sent in the NMEA2K PGN 129026 (0x1F802)

Definition at line 278 of file nmea2000_message_definitions.hpp.

Member Enumeration Documentation

◆ CourseOverGroundReference

Enumerates the references to which the course may be relative to.

Enumerator
True 

True north.

Magnetic 

Magnetic North.

Definition at line 282 of file nmea2000_message_definitions.hpp.

Constructor & Destructor Documentation

◆ CourseOverGroundSpeedOverGroundRapidUpdate()

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

Constructor for a CourseOverGroundSpeedOverGroundRapidUpdate message data object.

Parameters
[in]sourceThe control function sending/receiving this message

Definition at line 351 of file nmea2000_message_definitions.cpp.

Member Function Documentation

◆ deserialize()

bool isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::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 445 of file nmea2000_message_definitions.cpp.

Here is the call graph for this function:

◆ get_control_function()

std::shared_ptr< ControlFunction > isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::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 356 of file nmea2000_message_definitions.cpp.

◆ get_course_over_ground()

float isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::get_course_over_ground ( ) const

Returns the course over ground in units of radians.

Returns
Course over ground in units of radians

Definition at line 378 of file nmea2000_message_definitions.cpp.

◆ get_course_over_ground_reference()

CourseOverGroundSpeedOverGroundRapidUpdate::CourseOverGroundReference isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::get_course_over_ground_reference ( ) const

Returns the reference to which the course over ground is relative.

Returns
The reference to which the course is relative

Definition at line 419 of file nmea2000_message_definitions.cpp.

◆ get_raw_course_over_ground()

std::uint16_t isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::get_raw_course_over_ground ( ) const

Returns the course over ground in its base units of 0.0001 radians (between 0 and 2 pi radians)

Returns
The course over ground in its base units of 0.0001 radians

Definition at line 373 of file nmea2000_message_definitions.cpp.

◆ get_raw_speed_over_ground()

std::uint16_t isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::get_raw_speed_over_ground ( ) const

Returns the speed over ground in units of 0.01 meters per second.

Returns
The speed over ground in units of 0.01 meters per second

Definition at line 390 of file nmea2000_message_definitions.cpp.

◆ get_sequence_id()

std::uint8_t isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::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 407 of file nmea2000_message_definitions.cpp.

◆ get_speed_over_ground()

float isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::get_speed_over_ground ( ) const

Returns the speed over ground in units of meters per second.

Returns
The speed over ground in units of meters per second

Definition at line 395 of file nmea2000_message_definitions.cpp.

◆ get_timeout()

std::uint32_t isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::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 464 of file nmea2000_message_definitions.cpp.

◆ get_timestamp()

std::uint32_t isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::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 361 of file nmea2000_message_definitions.cpp.

◆ serialize()

void isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::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 431 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

◆ set_course_over_ground()

bool isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::set_course_over_ground ( std::uint16_t course)

Sets the course over ground in units of 0.0001 radians.

Parameters
[in]courseThe course to set, in 0.0001 radians
Returns
True if the value that was set differed from the stored value, otherwise false

Definition at line 383 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

◆ set_course_over_ground_reference()

bool isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::set_course_over_ground_reference ( CourseOverGroundReference reference)

Sets the reference to which the course over ground is relative.

Parameters
[in]referenceThe reference to set (as enumerated in CourseOverGroundReference)
Returns
True if the value that was set differed from the stored value, otherwise false

Definition at line 424 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

◆ set_sequence_id()

bool isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::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 differed from the stored value, otherwise false

Definition at line 412 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

◆ set_speed_over_ground()

bool isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::set_speed_over_ground ( std::uint16_t speed)

Sets the speed over ground in units of 0.01 meters per second.

Parameters
[in]speedThe speed to set, in 0.01 m/s
Returns
True if the value that was set differed from the stored value, otherwise false

Definition at line 400 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

◆ set_timestamp()

bool isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::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 differed from the stored value, otherwise false

Definition at line 366 of file nmea2000_message_definitions.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ cogReference

CourseOverGroundReference isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::cogReference = CourseOverGroundReference::NotApplicableOrNull
private

Used to indicate the reference for the course over ground, ie true or magnetic north.

Definition at line 372 of file nmea2000_message_definitions.hpp.

◆ courseOverGround

std::uint16_t isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::courseOverGround = 0
private

This field contains the direction of the path over ground actually followed by the vessel in 0.0001 radians between 0 and 2pi rad.

Definition at line 369 of file nmea2000_message_definitions.hpp.

◆ CYCLIC_MESSAGE_RATE_MS

constexpr std::uint32_t isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::CYCLIC_MESSAGE_RATE_MS = 250
staticconstexprprivate

The transmit interval for this message as specified in NMEA2000.

Definition at line 365 of file nmea2000_message_definitions.hpp.

◆ messageTimestamp_ms

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

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

Definition at line 368 of file nmea2000_message_definitions.hpp.

◆ senderControlFunction

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

The sender of the message data.

Definition at line 367 of file nmea2000_message_definitions.hpp.

◆ sequenceID

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

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

Definition at line 371 of file nmea2000_message_definitions.hpp.

◆ speedOverGround

std::uint16_t isobus::NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate::speedOverGround = 0
private

This field contains the speed of the vessel in 0.01 m/s.

Definition at line 370 of file nmea2000_message_definitions.hpp.


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