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

An interface for sending and receiving common NMEA2000 messages on an ISO11783 network. More...

#include <nmea2000_message_interface.hpp>

Collaboration diagram for isobus::NMEA2000MessageInterface:
[legend]

Public Member Functions

 NMEA2000MessageInterface (std::shared_ptr< InternalControlFunction > sendingControlFunction, bool enableSendingCogSogCyclically, bool enableSendingDatumCyclically, bool enableSendingGNSSPositionDataCyclically, bool enableSendingPositionDeltaHighPrecisionRapidUpdateCyclically, bool enableSendingPositionRapidUpdateCyclically, bool enableSendingRateOfTurnCyclically, bool enableSendingVesselHeadingCyclically)
 Constructor for a NMEA2000MessageInterface.
 
 ~NMEA2000MessageInterface ()
 Destructor for a NMEA2000MessageInterface.
 
NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdateget_cog_sog_transmit_message ()
 Returns a CourseOverGroundSpeedOverGroundRapidUpdate object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.
 
NMEA2000Messages::Datumget_datum_transmit_message ()
 Returns a Datum object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.
 
NMEA2000Messages::GNSSPositionDataget_gnss_position_data_transmit_message ()
 Returns a GNSSPositionData object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.
 
NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdateget_position_delta_high_precision_rapid_update_transmit_message ()
 Returns a PositionDeltaHighPrecisionRapidUpdate object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.
 
NMEA2000Messages::PositionRapidUpdateget_position_rapid_update_transmit_message ()
 Returns a PositionRapidUpdate object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.
 
NMEA2000Messages::RateOfTurnget_rate_of_turn_transmit_message ()
 Returns a RateOfTurn object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.
 
NMEA2000Messages::VesselHeadingget_vessel_heading_transmit_message ()
 Returns a VesselHeading object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.
 
std::size_t get_number_received_course_speed_over_ground_message_sources () const
 Returns the number of unique senders of the COG & SOG message.
 
std::size_t get_number_received_datum_message_sources () const
 Returns the number of unique datum message senders.
 
std::size_t get_number_received_gnss_position_data_message_sources () const
 Returns the number of unique GNSS position data message senders.
 
std::size_t get_number_received_position_delta_high_precision_rapid_update_message_sources () const
 Returns the number of unique delta position message senders.
 
std::size_t get_number_received_position_rapid_update_message_sources () const
 Returns the number of unique position rapid update message senders.
 
std::size_t get_number_received_rate_of_turn_message_sources () const
 Returns the number of unique rate of turn message senders.
 
std::size_t get_number_received_vessel_heading_message_sources () const
 Returns the number of unique vessel heading message senders.
 
std::shared_ptr< NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdateget_received_course_speed_over_ground_message (std::size_t index) const
 Returns the content of the COG & SOG message based on the index of the sender. Use this to read the received messages' content.
 
std::shared_ptr< NMEA2000Messages::Datumget_received_datum_message (std::size_t index) const
 Returns the content of the Datum message based on the index of the sender. Use this to read the received messages' content.
 
std::shared_ptr< NMEA2000Messages::GNSSPositionDataget_received_gnss_position_data_message (std::size_t index) const
 Returns the content of the GNSS position data message based on the index of the sender. Use this to read the received messages' content.
 
std::shared_ptr< NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdateget_received_position_delta_high_precision_rapid_update_message (std::size_t index) const
 Returns the content of the position delta high precision rapid update message based on the index of the sender. Use this to read the received messages' content.
 
std::shared_ptr< NMEA2000Messages::PositionRapidUpdateget_received_position_rapid_update_message (std::size_t index) const
 Returns the content of the position rapid update message based on the index of the sender. Use this to read the received messages' content.
 
std::shared_ptr< NMEA2000Messages::RateOfTurnget_received_rate_of_turn_message (std::size_t index) const
 Returns the content of the rate of turn message based on the index of the sender. Use this to read the received messages' content.
 
std::shared_ptr< NMEA2000Messages::VesselHeadingget_received_vessel_heading_message (std::size_t index) const
 Returns the content of the vessel heading message based on the index of the sender. Use this to read the received messages' content.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate >, bool > & get_course_speed_over_ground_rapid_update_event_publisher ()
 Returns an event dispatcher which you can use to get callbacks when new/updated COG & SOG messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::Datum >, bool > & get_datum_event_publisher ()
 Returns an event dispatcher which you can use to get callbacks when new/updated datum messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::GNSSPositionData >, bool > & get_gnss_position_data_event_publisher ()
 Returns an event dispatcher which you can use to get callbacks when new/updated GNSS position data messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdate >, bool > & get_position_delta_high_precision_rapid_update_event_publisher ()
 Returns an event dispatcher which you can use to get callbacks when new/updated position delta high precision rapid update messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::PositionRapidUpdate >, bool > & get_position_rapid_update_event_publisher ()
 Returns an event dispatcher which you can use to get callbacks when new/updated position rapid update messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::RateOfTurn >, bool > & get_rate_of_turn_event_publisher ()
 Returns an event dispatcher which you can use to get callbacks when new/updated rate of turn messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::VesselHeading >, bool > & get_vessel_heading_event_publisher ()
 Returns an event dispatcher which you can use to get callbacks when new/updated vessel heading messages are received.
 
bool get_enable_sending_cog_sog_cyclically () const
 Returns if the interface has cyclic sending of the course/speed over ground message enabled.
 
void set_enable_sending_cog_sog_cyclically (bool enable)
 Instructs the interface to enable or disable sending the course/speed over ground message cyclically.
 
bool get_enable_sending_datum_cyclically () const
 Returns if the interface has cyclic sending of the datum message enabled.
 
void set_enable_sending_datum_cyclically (bool enable)
 Instructs the interface to enable or disable sending the datum data message cyclically.
 
bool get_enable_sending_gnss_position_data_cyclically () const
 Returns if the interface has cyclic sending of the GNSS position data message enabled.
 
void set_enable_sending_gnss_position_data_cyclically (bool enable)
 Instructs the interface to enable or disable sending the GNSS position data message cyclically.
 
bool get_enable_sending_position_delta_high_precision_rapid_update_cyclically () const
 Returns if the interface has cyclic sending of the position delta high precision rapid update message enabled.
 
void set_enable_sending_position_delta_high_precision_rapid_update_cyclically (bool enable)
 Instructs the interface to enable or disable sending the position delta high precision rapid update message cyclically.
 
bool get_enable_sending_position_rapid_update_cyclically () const
 Returns if the interface has cyclic sending of the position rapid update message enabled.
 
void set_enable_sending_position_rapid_update_cyclically (bool enable)
 Instructs the interface to enable or disable sending the position rapid update message cyclically.
 
bool get_enable_sending_rate_of_turn_cyclically () const
 Returns if the interface has cyclic sending of the rate of turn message enabled.
 
void set_enable_sending_rate_of_turn_cyclically (bool enable)
 Instructs the interface to enable or disable sending the rate of turn message cyclically.
 
bool get_enable_sending_vessel_heading_cyclically () const
 Returns if the interface has cyclic sending of the vessel heading message enabled.
 
void set_enable_sending_vessel_heading_cyclically (bool enable)
 Instructs the interface to enable or disable sending the vessel heading message cyclically.
 
void initialize ()
 Initializes the interface. Registers it with the network manager. Must be called before the interface can work properly.
 
bool get_initialized () const
 Returns if initialize has been called.
 
void terminate ()
 Unregisters the interface from the network manager.
 
void update ()
 Updates the diagnostic protocol. Must be called periodically. 50ms Is a good minimum interval for this object.
 

Private Types

enum class  TransmitFlags : std::uint32_t {
  CourseOverGroundSpeedOverGroundRapidUpdate = 0 , Datum , GNSSPositionData , PositionDeltaHighPrecisionRapidUpdate ,
  PositionRapidUpdate , RateOfTurn , VesselHeading , NumberOfFlags
}
 Enumerates a set of flags to manage sending various NMEA2000 messages from this interface. More...
 

Private Member Functions

void check_receive_timeouts ()
 Checks to see if any received messages are timed out and prunes them if needed.
 
void check_transmit_timeouts ()
 Checks to see if any transmit flags need to be set based on the last time the message was sent, if enabled.
 

Static Private Member Functions

static void process_flags (std::uint32_t flag, void *parentPointer)
 A generic callback for a the class to process flags from the ProcessingFlags
 
static void process_rx_message (const CANMessage &message, void *parentPointer)
 Processes a CAN message destined for an instance of this interface.
 

Private Attributes

ProcessingFlags txFlags
 A set of flags used to track what messages need to be transmitted or retried.
 
NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate cogSogTransmitMessage
 Stores a set of data specifically for transmitting the PGN 129026 (0x1F802) if enabled.
 
NMEA2000Messages::Datum datumTransmitMessage
 Stores a set of data specifically for transmitting the PGN 129044 (0x1F814) if enabled.
 
NMEA2000Messages::GNSSPositionData gnssPositionDataTransmitMessage
 Stores a set of data specifically for transmitting the PGN 129029 (0x1F805) if enabled.
 
NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdate positionDeltaHighPrecisionRapidUpdateTransmitMessage
 Stores a set of data specifically for transmitting the PGN 129027 (0x1F803) if enabled.
 
NMEA2000Messages::PositionRapidUpdate positionRapidUpdateTransmitMessage
 Stores a set of data specifically for transmitting the PGN 129025 (0x1F801) if enabled.
 
NMEA2000Messages::RateOfTurn rateOfTurnTransmitMessage
 Stores a set of data specifically for transmitting the PGN 127251 (0x1F113) if enabled.
 
NMEA2000Messages::VesselHeading vesselHeadingTransmitMessage
 Stores a set of data specifically for transmitting the PGN 127250 (0x1F112) if enabled.
 
std::vector< std::shared_ptr< NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate > > receivedCogSogMessages
 Stores all received (and not timed out) sources of the COG & SOG message.
 
std::vector< std::shared_ptr< NMEA2000Messages::Datum > > receivedDatumMessages
 Stores all received (and not timed out) sources of the Datum message.
 
std::vector< std::shared_ptr< NMEA2000Messages::GNSSPositionData > > receivedGNSSPositionDataMessages
 Stores all received (and not timed out) sources of the GNSS position data message.
 
std::vector< std::shared_ptr< NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdate > > receivedPositionDeltaHighPrecisionRapidUpdateMessages
 Stores all received (and not timed out) sources of the position delta message.
 
std::vector< std::shared_ptr< NMEA2000Messages::PositionRapidUpdate > > receivedPositionRapidUpdateMessages
 Stores all received (and not timed out) sources of the position rapid update message.
 
std::vector< std::shared_ptr< NMEA2000Messages::RateOfTurn > > receivedRateOfTurnMessages
 Stores all received (and not timed out) sources of the rate of turn message.
 
std::vector< std::shared_ptr< NMEA2000Messages::VesselHeading > > receivedVesselHeadingMessages
 Stores all received (and not timed out) sources of the vessel heading message.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate >, bool > cogSogEventPublisher
 An event dispatcher for notifying when new guidance machine info messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::Datum >, bool > datumEventPublisher
 An event dispatcher for notifying when new guidance machine info messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::GNSSPositionData >, bool > gnssPositionDataEventPublisher
 An event dispatcher for notifying when new guidance machine info messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdate >, bool > positionDeltaHighPrecisionRapidUpdateEventPublisher
 An event dispatcher for notifying when new guidance machine info messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::PositionRapidUpdate >, bool > positionRapidUpdateEventPublisher
 An event dispatcher for notifying when new guidance machine info messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::RateOfTurn >, bool > rateOfTurnEventPublisher
 An event dispatcher for notifying when new guidance machine info messages are received.
 
EventDispatcher< const std::shared_ptr< NMEA2000Messages::VesselHeading >, bool > vesselHeadingEventPublisher
 An event dispatcher for notifying when new guidance machine info messages are received.
 
bool sendCogSogCyclically
 Determines if the interface will try to send the COG & SOG message cyclically.
 
bool sendDatumCyclically
 Determines if the interface will try to send the Datum message cyclically.
 
bool sendGNSSPositionDataCyclically
 Determines if the interface will try to send the GNSS position data message cyclically.
 
bool sendPositionDeltaHighPrecisionRapidUpdateCyclically
 Determines if the interface will try to send the position delta high precision rapid update message message cyclically.
 
bool sendPositionRapidUpdateCyclically
 Determines if the interface will try to send the position rapid update message cyclically.
 
bool sendRateOfTurnCyclically
 Determines if the interface will try to send the rate of turn message cyclically.
 
bool sendVesselHeadingCyclically
 Determines if the interface will try to send the vessel heading message cyclically.
 
bool initialized = false
 Tracks if initialize has been called.
 

Detailed Description

An interface for sending and receiving common NMEA2000 messages on an ISO11783 network.

Definition at line 29 of file nmea2000_message_interface.hpp.

Member Enumeration Documentation

◆ TransmitFlags

enum class isobus::NMEA2000MessageInterface::TransmitFlags : std::uint32_t
strongprivate

Enumerates a set of flags to manage sending various NMEA2000 messages from this interface.

Definition at line 278 of file nmea2000_message_interface.hpp.

Constructor & Destructor Documentation

◆ NMEA2000MessageInterface()

isobus::NMEA2000MessageInterface::NMEA2000MessageInterface ( std::shared_ptr< InternalControlFunction > sendingControlFunction,
bool enableSendingCogSogCyclically,
bool enableSendingDatumCyclically,
bool enableSendingGNSSPositionDataCyclically,
bool enableSendingPositionDeltaHighPrecisionRapidUpdateCyclically,
bool enableSendingPositionRapidUpdateCyclically,
bool enableSendingRateOfTurnCyclically,
bool enableSendingVesselHeadingCyclically )

Constructor for a NMEA2000MessageInterface.

Parameters
[in]sendingControlFunctionThe control function the interface should use to send messages, or nullptr optionally
[in]enableSendingCogSogCyclicallySet to true for the interface to attempt to send the COG & SOG message cyclically
[in]enableSendingDatumCyclicallySet to true for the interface to attempt to send the Datum message cyclically
[in]enableSendingGNSSPositionDataCyclicallySet to true for the interface to attempt to send the GNSS position data message message cyclically
[in]enableSendingPositionDeltaHighPrecisionRapidUpdateCyclicallySet to true for the interface to attempt to send the position delta message cyclically
[in]enableSendingPositionRapidUpdateCyclicallySet to true for the interface to attempt to send the position rapid update message cyclically
[in]enableSendingRateOfTurnCyclicallySet to true for the interface to attempt to send the rate of turn message cyclically
[in]enableSendingVesselHeadingCyclicallySet to true for the interface to attempt to send the vessel heading message cyclically

Definition at line 32 of file nmea2000_message_interface.cpp.

◆ ~NMEA2000MessageInterface()

isobus::NMEA2000MessageInterface::~NMEA2000MessageInterface ( )

Destructor for a NMEA2000MessageInterface.

Definition at line 58 of file nmea2000_message_interface.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ check_receive_timeouts()

void isobus::NMEA2000MessageInterface::check_receive_timeouts ( )
private

Checks to see if any received messages are timed out and prunes them if needed.

Definition at line 668 of file nmea2000_message_interface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_transmit_timeouts()

void isobus::NMEA2000MessageInterface::check_transmit_timeouts ( )
private

Checks to see if any transmit flags need to be set based on the last time the message was sent, if enabled.

Definition at line 752 of file nmea2000_message_interface.cpp.

Here is the caller graph for this function:

◆ get_cog_sog_transmit_message()

NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate & isobus::NMEA2000MessageInterface::get_cog_sog_transmit_message ( )

Returns a CourseOverGroundSpeedOverGroundRapidUpdate object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.

Returns
CourseOverGroundSpeedOverGroundRapidUpdate used to set the individual signal values sent in the COG & SOG message

Definition at line 63 of file nmea2000_message_interface.cpp.

◆ get_course_speed_over_ground_rapid_update_event_publisher()

EventDispatcher< const std::shared_ptr< NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate >, bool > & isobus::NMEA2000MessageInterface::get_course_speed_over_ground_rapid_update_event_publisher ( )

Returns an event dispatcher which you can use to get callbacks when new/updated COG & SOG messages are received.

Returns
The event publisher for COG & SOG messages

Definition at line 210 of file nmea2000_message_interface.cpp.

◆ get_datum_event_publisher()

EventDispatcher< const std::shared_ptr< NMEA2000Messages::Datum >, bool > & isobus::NMEA2000MessageInterface::get_datum_event_publisher ( )

Returns an event dispatcher which you can use to get callbacks when new/updated datum messages are received.

Returns
The event publisher for datum messages

Definition at line 215 of file nmea2000_message_interface.cpp.

◆ get_datum_transmit_message()

NMEA2000Messages::Datum & isobus::NMEA2000MessageInterface::get_datum_transmit_message ( )

Returns a Datum object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.

Returns
Datum used to set the individual signal values sent in the Datum message

Definition at line 68 of file nmea2000_message_interface.cpp.

◆ get_enable_sending_cog_sog_cyclically()

bool isobus::NMEA2000MessageInterface::get_enable_sending_cog_sog_cyclically ( ) const

Returns if the interface has cyclic sending of the course/speed over ground message enabled.

Returns
True if the interface has cyclic sending of the course/speed over ground message enabled, otherwise false

Definition at line 245 of file nmea2000_message_interface.cpp.

◆ get_enable_sending_datum_cyclically()

bool isobus::NMEA2000MessageInterface::get_enable_sending_datum_cyclically ( ) const

Returns if the interface has cyclic sending of the datum message enabled.

Returns
True if the interface has cyclic sending of the datum message enabled, otherwise false

Definition at line 255 of file nmea2000_message_interface.cpp.

◆ get_enable_sending_gnss_position_data_cyclically()

bool isobus::NMEA2000MessageInterface::get_enable_sending_gnss_position_data_cyclically ( ) const

Returns if the interface has cyclic sending of the GNSS position data message enabled.

Returns
True if the interface has cyclic sending of the GNSS position data message enabled, otherwise false

Definition at line 265 of file nmea2000_message_interface.cpp.

◆ get_enable_sending_position_delta_high_precision_rapid_update_cyclically()

bool isobus::NMEA2000MessageInterface::get_enable_sending_position_delta_high_precision_rapid_update_cyclically ( ) const

Returns if the interface has cyclic sending of the position delta high precision rapid update message enabled.

Returns
True if the interface has cyclic sending of the position delta high precision rapid update message enabled, otherwise false

Definition at line 275 of file nmea2000_message_interface.cpp.

◆ get_enable_sending_position_rapid_update_cyclically()

bool isobus::NMEA2000MessageInterface::get_enable_sending_position_rapid_update_cyclically ( ) const

Returns if the interface has cyclic sending of the position rapid update message enabled.

Returns
True if the interface has cyclic sending of the position rapid update message enabled, otherwise false

Definition at line 285 of file nmea2000_message_interface.cpp.

◆ get_enable_sending_rate_of_turn_cyclically()

bool isobus::NMEA2000MessageInterface::get_enable_sending_rate_of_turn_cyclically ( ) const

Returns if the interface has cyclic sending of the rate of turn message enabled.

Returns
True if the interface has cyclic sending of the rate of turn message enabled, otherwise false

Definition at line 295 of file nmea2000_message_interface.cpp.

◆ get_enable_sending_vessel_heading_cyclically()

bool isobus::NMEA2000MessageInterface::get_enable_sending_vessel_heading_cyclically ( ) const

Returns if the interface has cyclic sending of the vessel heading message enabled.

Returns
True if the interface has cyclic sending of the vessel heading message enabled, otherwise false

Definition at line 305 of file nmea2000_message_interface.cpp.

◆ get_gnss_position_data_event_publisher()

EventDispatcher< const std::shared_ptr< NMEA2000Messages::GNSSPositionData >, bool > & isobus::NMEA2000MessageInterface::get_gnss_position_data_event_publisher ( )

Returns an event dispatcher which you can use to get callbacks when new/updated GNSS position data messages are received.

Returns
The event publisher for GNSS position data messages

Definition at line 220 of file nmea2000_message_interface.cpp.

◆ get_gnss_position_data_transmit_message()

NMEA2000Messages::GNSSPositionData & isobus::NMEA2000MessageInterface::get_gnss_position_data_transmit_message ( )

Returns a GNSSPositionData object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.

Returns
GNSSPositionData used to set the individual signal values sent in the GNSS position data message

Definition at line 73 of file nmea2000_message_interface.cpp.

◆ get_initialized()

bool isobus::NMEA2000MessageInterface::get_initialized ( ) const

Returns if initialize has been called.

Returns
True if initialize has been called, otherwise false. Terminate sets this back to false.

Definition at line 331 of file nmea2000_message_interface.cpp.

◆ get_number_received_course_speed_over_ground_message_sources()

std::size_t isobus::NMEA2000MessageInterface::get_number_received_course_speed_over_ground_message_sources ( ) const

Returns the number of unique senders of the COG & SOG message.

Returns
The number of unique COG & SOG message senders

Definition at line 98 of file nmea2000_message_interface.cpp.

◆ get_number_received_datum_message_sources()

std::size_t isobus::NMEA2000MessageInterface::get_number_received_datum_message_sources ( ) const

Returns the number of unique datum message senders.

Returns
The number of unique datum message senders

Definition at line 103 of file nmea2000_message_interface.cpp.

◆ get_number_received_gnss_position_data_message_sources()

std::size_t isobus::NMEA2000MessageInterface::get_number_received_gnss_position_data_message_sources ( ) const

Returns the number of unique GNSS position data message senders.

Returns
The number of GNSS position data message senders

Definition at line 108 of file nmea2000_message_interface.cpp.

◆ get_number_received_position_delta_high_precision_rapid_update_message_sources()

std::size_t isobus::NMEA2000MessageInterface::get_number_received_position_delta_high_precision_rapid_update_message_sources ( ) const

Returns the number of unique delta position message senders.

Returns
The number of unique position delta high precision rapid update message senders

Definition at line 113 of file nmea2000_message_interface.cpp.

◆ get_number_received_position_rapid_update_message_sources()

std::size_t isobus::NMEA2000MessageInterface::get_number_received_position_rapid_update_message_sources ( ) const

Returns the number of unique position rapid update message senders.

Returns
The number of unique position rapid update message senders

Definition at line 118 of file nmea2000_message_interface.cpp.

◆ get_number_received_rate_of_turn_message_sources()

std::size_t isobus::NMEA2000MessageInterface::get_number_received_rate_of_turn_message_sources ( ) const

Returns the number of unique rate of turn message senders.

Returns
The number of unique rate of turn message senders

Definition at line 123 of file nmea2000_message_interface.cpp.

◆ get_number_received_vessel_heading_message_sources()

std::size_t isobus::NMEA2000MessageInterface::get_number_received_vessel_heading_message_sources ( ) const

Returns the number of unique vessel heading message senders.

Returns
The number of unique vessel heading message senders

Definition at line 128 of file nmea2000_message_interface.cpp.

◆ get_position_delta_high_precision_rapid_update_event_publisher()

EventDispatcher< const std::shared_ptr< NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdate >, bool > & isobus::NMEA2000MessageInterface::get_position_delta_high_precision_rapid_update_event_publisher ( )

Returns an event dispatcher which you can use to get callbacks when new/updated position delta high precision rapid update messages are received.

Returns
The event publisher for position delta high precision rapid update messages

Definition at line 225 of file nmea2000_message_interface.cpp.

◆ get_position_delta_high_precision_rapid_update_transmit_message()

NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdate & isobus::NMEA2000MessageInterface::get_position_delta_high_precision_rapid_update_transmit_message ( )

Returns a PositionDeltaHighPrecisionRapidUpdate object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.

Returns
PositionDeltaHighPrecisionRapidUpdate used to set the individual signal values sent in the position delta message

Definition at line 78 of file nmea2000_message_interface.cpp.

◆ get_position_rapid_update_event_publisher()

EventDispatcher< const std::shared_ptr< NMEA2000Messages::PositionRapidUpdate >, bool > & isobus::NMEA2000MessageInterface::get_position_rapid_update_event_publisher ( )

Returns an event dispatcher which you can use to get callbacks when new/updated position rapid update messages are received.

Returns
The event publisher for position rapid update messages

Definition at line 230 of file nmea2000_message_interface.cpp.

◆ get_position_rapid_update_transmit_message()

NMEA2000Messages::PositionRapidUpdate & isobus::NMEA2000MessageInterface::get_position_rapid_update_transmit_message ( )

Returns a PositionRapidUpdate object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.

Returns
PositionRapidUpdate used to set the individual signal values sent in the position rapid update message

Definition at line 83 of file nmea2000_message_interface.cpp.

◆ get_rate_of_turn_event_publisher()

EventDispatcher< const std::shared_ptr< NMEA2000Messages::RateOfTurn >, bool > & isobus::NMEA2000MessageInterface::get_rate_of_turn_event_publisher ( )

Returns an event dispatcher which you can use to get callbacks when new/updated rate of turn messages are received.

Returns
The event publisher for rate of turn messages

Definition at line 235 of file nmea2000_message_interface.cpp.

◆ get_rate_of_turn_transmit_message()

NMEA2000Messages::RateOfTurn & isobus::NMEA2000MessageInterface::get_rate_of_turn_transmit_message ( )

Returns a RateOfTurn object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.

Returns
RateOfTurn used to set the individual signal values sent in the rate of turn message

Definition at line 88 of file nmea2000_message_interface.cpp.

◆ get_received_course_speed_over_ground_message()

std::shared_ptr< CourseOverGroundSpeedOverGroundRapidUpdate > isobus::NMEA2000MessageInterface::get_received_course_speed_over_ground_message ( std::size_t index) const

Returns the content of the COG & SOG message based on the index of the sender. Use this to read the received messages' content.

Parameters
[in]indexAn index of senders of the the message
Note
Only one device on the bus will send this normally, but we provide a generic way to get an arbitrary number of these. So generally using only index 0 will be acceptable.
It is also possible that this message may not be present, depending on your machine.
Returns
The content of the COG & SOG message

Definition at line 133 of file nmea2000_message_interface.cpp.

◆ get_received_datum_message()

std::shared_ptr< Datum > isobus::NMEA2000MessageInterface::get_received_datum_message ( std::size_t index) const

Returns the content of the Datum message based on the index of the sender. Use this to read the received messages' content.

Parameters
[in]indexAn index of senders of the the message
Note
Only one device on the bus will send this normally, but we provide a generic way to get an arbitrary number of these. So generally using only index 0 will be acceptable.
It is also possible that this message may not be present, depending on your machine.
Returns
The content of the Datum message

Definition at line 144 of file nmea2000_message_interface.cpp.

◆ get_received_gnss_position_data_message()

std::shared_ptr< GNSSPositionData > isobus::NMEA2000MessageInterface::get_received_gnss_position_data_message ( std::size_t index) const

Returns the content of the GNSS position data message based on the index of the sender. Use this to read the received messages' content.

Parameters
[in]indexAn index of senders of the the message
Note
Only one device on the bus will send this normally, but we provide a generic way to get an arbitrary number of these. So generally using only index 0 will be acceptable.
It is also possible that this message may not be present, depending on your machine.
Returns
The content of the GNSS position data message

Definition at line 155 of file nmea2000_message_interface.cpp.

◆ get_received_position_delta_high_precision_rapid_update_message()

std::shared_ptr< PositionDeltaHighPrecisionRapidUpdate > isobus::NMEA2000MessageInterface::get_received_position_delta_high_precision_rapid_update_message ( std::size_t index) const

Returns the content of the position delta high precision rapid update message based on the index of the sender. Use this to read the received messages' content.

Parameters
[in]indexAn index of senders of the the message
Note
Only one device on the bus will send this normally, but we provide a generic way to get an arbitrary number of these. So generally using only index 0 will be acceptable.
It is also possible that this message may not be present, depending on your machine.
Returns
The content of the position delta high precision rapid update message

Definition at line 166 of file nmea2000_message_interface.cpp.

◆ get_received_position_rapid_update_message()

std::shared_ptr< PositionRapidUpdate > isobus::NMEA2000MessageInterface::get_received_position_rapid_update_message ( std::size_t index) const

Returns the content of the position rapid update message based on the index of the sender. Use this to read the received messages' content.

Parameters
[in]indexAn index of senders of the the message
Note
Only one device on the bus will send this normally, but we provide a generic way to get an arbitrary number of these. So generally using only index 0 will be acceptable.
It is also possible that this message may not be present, depending on your machine.
Returns
The content of the position rapid update message

Definition at line 177 of file nmea2000_message_interface.cpp.

◆ get_received_rate_of_turn_message()

std::shared_ptr< RateOfTurn > isobus::NMEA2000MessageInterface::get_received_rate_of_turn_message ( std::size_t index) const

Returns the content of the rate of turn message based on the index of the sender. Use this to read the received messages' content.

Parameters
[in]indexAn index of senders of the the message
Note
Only one device on the bus will send this normally, but we provide a generic way to get an arbitrary number of these. So generally using only index 0 will be acceptable.
It is also possible that this message may not be present, depending on your machine.
Returns
The content of the rate of turn message

Definition at line 188 of file nmea2000_message_interface.cpp.

◆ get_received_vessel_heading_message()

std::shared_ptr< VesselHeading > isobus::NMEA2000MessageInterface::get_received_vessel_heading_message ( std::size_t index) const

Returns the content of the vessel heading message based on the index of the sender. Use this to read the received messages' content.

Parameters
[in]indexAn index of senders of the the message
Note
Only one device on the bus will send this normally, but we provide a generic way to get an arbitrary number of these. So generally using only index 0 will be acceptable.
It is also possible that this message may not be present, depending on your machine.
Returns
The content of the vessel heading message

Definition at line 199 of file nmea2000_message_interface.cpp.

◆ get_vessel_heading_event_publisher()

EventDispatcher< const std::shared_ptr< NMEA2000Messages::VesselHeading >, bool > & isobus::NMEA2000MessageInterface::get_vessel_heading_event_publisher ( )

Returns an event dispatcher which you can use to get callbacks when new/updated vessel heading messages are received.

Returns
The event publisher for vessel heading messages

Definition at line 240 of file nmea2000_message_interface.cpp.

◆ get_vessel_heading_transmit_message()

NMEA2000Messages::VesselHeading & isobus::NMEA2000MessageInterface::get_vessel_heading_transmit_message ( )

Returns a VesselHeading object that you can use to set the message's individual signal values, which will then be transmitted if the interface is configured to do so.

Returns
VesselHeading used to set the individual signal values sent in the vessel heading message

Definition at line 93 of file nmea2000_message_interface.cpp.

◆ initialize()

void isobus::NMEA2000MessageInterface::initialize ( )

Initializes the interface. Registers it with the network manager. Must be called before the interface can work properly.

Definition at line 315 of file nmea2000_message_interface.cpp.

Here is the call graph for this function:

◆ process_flags()

void isobus::NMEA2000MessageInterface::process_flags ( std::uint32_t flag,
void * parentPointer )
staticprivate

A generic callback for a the class to process flags from the ProcessingFlags

Parameters
[in]flagThe flag to process
[in]parentPointerA generic context pointer to reference a specific instance of this protocol in the callback

Definition at line 366 of file nmea2000_message_interface.cpp.

Here is the call graph for this function:

◆ process_rx_message()

void isobus::NMEA2000MessageInterface::process_rx_message ( const CANMessage & message,
void * parentPointer )
staticprivate

Processes a CAN message destined for an instance of this interface.

Parameters
[in]messageThe CAN message being received
[in]parentPointerA context variable to find the relevant class instance

Definition at line 493 of file nmea2000_message_interface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_enable_sending_cog_sog_cyclically()

void isobus::NMEA2000MessageInterface::set_enable_sending_cog_sog_cyclically ( bool enable)

Instructs the interface to enable or disable sending the course/speed over ground message cyclically.

Parameters
[in]enableSet to true to have the interface cyclically send the course/speed over ground message cyclically

Definition at line 250 of file nmea2000_message_interface.cpp.

◆ set_enable_sending_datum_cyclically()

void isobus::NMEA2000MessageInterface::set_enable_sending_datum_cyclically ( bool enable)

Instructs the interface to enable or disable sending the datum data message cyclically.

Parameters
[in]enableSet to true to have the interface cyclically send the datum message cyclically

Definition at line 260 of file nmea2000_message_interface.cpp.

◆ set_enable_sending_gnss_position_data_cyclically()

void isobus::NMEA2000MessageInterface::set_enable_sending_gnss_position_data_cyclically ( bool enable)

Instructs the interface to enable or disable sending the GNSS position data message cyclically.

Parameters
[in]enableSet to true to have the interface cyclically send the GNSS position data message cyclically

Definition at line 270 of file nmea2000_message_interface.cpp.

◆ set_enable_sending_position_delta_high_precision_rapid_update_cyclically()

void isobus::NMEA2000MessageInterface::set_enable_sending_position_delta_high_precision_rapid_update_cyclically ( bool enable)

Instructs the interface to enable or disable sending the position delta high precision rapid update message cyclically.

Parameters
[in]enableSet to true to have the interface cyclically send the position delta high precision rapid update message cyclically

Definition at line 280 of file nmea2000_message_interface.cpp.

◆ set_enable_sending_position_rapid_update_cyclically()

void isobus::NMEA2000MessageInterface::set_enable_sending_position_rapid_update_cyclically ( bool enable)

Instructs the interface to enable or disable sending the position rapid update message cyclically.

Parameters
[in]enableSet to true to have the interface cyclically send the position rapid update message cyclically

Definition at line 290 of file nmea2000_message_interface.cpp.

◆ set_enable_sending_rate_of_turn_cyclically()

void isobus::NMEA2000MessageInterface::set_enable_sending_rate_of_turn_cyclically ( bool enable)

Instructs the interface to enable or disable sending the rate of turn message cyclically.

Parameters
[in]enableSet to true to have the interface cyclically send the rate of turn message cyclically

Definition at line 300 of file nmea2000_message_interface.cpp.

◆ set_enable_sending_vessel_heading_cyclically()

void isobus::NMEA2000MessageInterface::set_enable_sending_vessel_heading_cyclically ( bool enable)

Instructs the interface to enable or disable sending the vessel heading message cyclically.

Parameters
[in]enableSet to true to have the interface cyclically send the vessel heading message cyclically

Definition at line 310 of file nmea2000_message_interface.cpp.

◆ terminate()

void isobus::NMEA2000MessageInterface::terminate ( )

Unregisters the interface from the network manager.

Definition at line 336 of file nmea2000_message_interface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void isobus::NMEA2000MessageInterface::update ( )

Updates the diagnostic protocol. Must be called periodically. 50ms Is a good minimum interval for this object.

Definition at line 352 of file nmea2000_message_interface.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ cogSogEventPublisher

EventDispatcher<const std::shared_ptr<NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate>, bool> isobus::NMEA2000MessageInterface::cogSogEventPublisher
private

An event dispatcher for notifying when new guidance machine info messages are received.

Definition at line 322 of file nmea2000_message_interface.hpp.

◆ cogSogTransmitMessage

NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate isobus::NMEA2000MessageInterface::cogSogTransmitMessage
private

Stores a set of data specifically for transmitting the PGN 129026 (0x1F802) if enabled.

Definition at line 308 of file nmea2000_message_interface.hpp.

◆ datumEventPublisher

EventDispatcher<const std::shared_ptr<NMEA2000Messages::Datum>, bool> isobus::NMEA2000MessageInterface::datumEventPublisher
private

An event dispatcher for notifying when new guidance machine info messages are received.

Definition at line 323 of file nmea2000_message_interface.hpp.

◆ datumTransmitMessage

NMEA2000Messages::Datum isobus::NMEA2000MessageInterface::datumTransmitMessage
private

Stores a set of data specifically for transmitting the PGN 129044 (0x1F814) if enabled.

Definition at line 309 of file nmea2000_message_interface.hpp.

◆ gnssPositionDataEventPublisher

EventDispatcher<const std::shared_ptr<NMEA2000Messages::GNSSPositionData>, bool> isobus::NMEA2000MessageInterface::gnssPositionDataEventPublisher
private

An event dispatcher for notifying when new guidance machine info messages are received.

Definition at line 324 of file nmea2000_message_interface.hpp.

◆ gnssPositionDataTransmitMessage

NMEA2000Messages::GNSSPositionData isobus::NMEA2000MessageInterface::gnssPositionDataTransmitMessage
private

Stores a set of data specifically for transmitting the PGN 129029 (0x1F805) if enabled.

Definition at line 310 of file nmea2000_message_interface.hpp.

◆ initialized

bool isobus::NMEA2000MessageInterface::initialized = false
private

Tracks if initialize has been called.

Definition at line 336 of file nmea2000_message_interface.hpp.

◆ positionDeltaHighPrecisionRapidUpdateEventPublisher

EventDispatcher<const std::shared_ptr<NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdate>, bool> isobus::NMEA2000MessageInterface::positionDeltaHighPrecisionRapidUpdateEventPublisher
private

An event dispatcher for notifying when new guidance machine info messages are received.

Definition at line 325 of file nmea2000_message_interface.hpp.

◆ positionDeltaHighPrecisionRapidUpdateTransmitMessage

NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdate isobus::NMEA2000MessageInterface::positionDeltaHighPrecisionRapidUpdateTransmitMessage
private

Stores a set of data specifically for transmitting the PGN 129027 (0x1F803) if enabled.

Definition at line 311 of file nmea2000_message_interface.hpp.

◆ positionRapidUpdateEventPublisher

EventDispatcher<const std::shared_ptr<NMEA2000Messages::PositionRapidUpdate>, bool> isobus::NMEA2000MessageInterface::positionRapidUpdateEventPublisher
private

An event dispatcher for notifying when new guidance machine info messages are received.

Definition at line 326 of file nmea2000_message_interface.hpp.

◆ positionRapidUpdateTransmitMessage

NMEA2000Messages::PositionRapidUpdate isobus::NMEA2000MessageInterface::positionRapidUpdateTransmitMessage
private

Stores a set of data specifically for transmitting the PGN 129025 (0x1F801) if enabled.

Definition at line 312 of file nmea2000_message_interface.hpp.

◆ rateOfTurnEventPublisher

EventDispatcher<const std::shared_ptr<NMEA2000Messages::RateOfTurn>, bool> isobus::NMEA2000MessageInterface::rateOfTurnEventPublisher
private

An event dispatcher for notifying when new guidance machine info messages are received.

Definition at line 327 of file nmea2000_message_interface.hpp.

◆ rateOfTurnTransmitMessage

NMEA2000Messages::RateOfTurn isobus::NMEA2000MessageInterface::rateOfTurnTransmitMessage
private

Stores a set of data specifically for transmitting the PGN 127251 (0x1F113) if enabled.

Definition at line 313 of file nmea2000_message_interface.hpp.

◆ receivedCogSogMessages

std::vector<std::shared_ptr<NMEA2000Messages::CourseOverGroundSpeedOverGroundRapidUpdate> > isobus::NMEA2000MessageInterface::receivedCogSogMessages
private

Stores all received (and not timed out) sources of the COG & SOG message.

Definition at line 315 of file nmea2000_message_interface.hpp.

◆ receivedDatumMessages

std::vector<std::shared_ptr<NMEA2000Messages::Datum> > isobus::NMEA2000MessageInterface::receivedDatumMessages
private

Stores all received (and not timed out) sources of the Datum message.

Definition at line 316 of file nmea2000_message_interface.hpp.

◆ receivedGNSSPositionDataMessages

std::vector<std::shared_ptr<NMEA2000Messages::GNSSPositionData> > isobus::NMEA2000MessageInterface::receivedGNSSPositionDataMessages
private

Stores all received (and not timed out) sources of the GNSS position data message.

Definition at line 317 of file nmea2000_message_interface.hpp.

◆ receivedPositionDeltaHighPrecisionRapidUpdateMessages

std::vector<std::shared_ptr<NMEA2000Messages::PositionDeltaHighPrecisionRapidUpdate> > isobus::NMEA2000MessageInterface::receivedPositionDeltaHighPrecisionRapidUpdateMessages
private

Stores all received (and not timed out) sources of the position delta message.

Definition at line 318 of file nmea2000_message_interface.hpp.

◆ receivedPositionRapidUpdateMessages

std::vector<std::shared_ptr<NMEA2000Messages::PositionRapidUpdate> > isobus::NMEA2000MessageInterface::receivedPositionRapidUpdateMessages
private

Stores all received (and not timed out) sources of the position rapid update message.

Definition at line 319 of file nmea2000_message_interface.hpp.

◆ receivedRateOfTurnMessages

std::vector<std::shared_ptr<NMEA2000Messages::RateOfTurn> > isobus::NMEA2000MessageInterface::receivedRateOfTurnMessages
private

Stores all received (and not timed out) sources of the rate of turn message.

Definition at line 320 of file nmea2000_message_interface.hpp.

◆ receivedVesselHeadingMessages

std::vector<std::shared_ptr<NMEA2000Messages::VesselHeading> > isobus::NMEA2000MessageInterface::receivedVesselHeadingMessages
private

Stores all received (and not timed out) sources of the vessel heading message.

Definition at line 321 of file nmea2000_message_interface.hpp.

◆ sendCogSogCyclically

bool isobus::NMEA2000MessageInterface::sendCogSogCyclically
private

Determines if the interface will try to send the COG & SOG message cyclically.

Definition at line 329 of file nmea2000_message_interface.hpp.

◆ sendDatumCyclically

bool isobus::NMEA2000MessageInterface::sendDatumCyclically
private

Determines if the interface will try to send the Datum message cyclically.

Definition at line 330 of file nmea2000_message_interface.hpp.

◆ sendGNSSPositionDataCyclically

bool isobus::NMEA2000MessageInterface::sendGNSSPositionDataCyclically
private

Determines if the interface will try to send the GNSS position data message cyclically.

Definition at line 331 of file nmea2000_message_interface.hpp.

◆ sendPositionDeltaHighPrecisionRapidUpdateCyclically

bool isobus::NMEA2000MessageInterface::sendPositionDeltaHighPrecisionRapidUpdateCyclically
private

Determines if the interface will try to send the position delta high precision rapid update message message cyclically.

Definition at line 332 of file nmea2000_message_interface.hpp.

◆ sendPositionRapidUpdateCyclically

bool isobus::NMEA2000MessageInterface::sendPositionRapidUpdateCyclically
private

Determines if the interface will try to send the position rapid update message cyclically.

Definition at line 333 of file nmea2000_message_interface.hpp.

◆ sendRateOfTurnCyclically

bool isobus::NMEA2000MessageInterface::sendRateOfTurnCyclically
private

Determines if the interface will try to send the rate of turn message cyclically.

Definition at line 334 of file nmea2000_message_interface.hpp.

◆ sendVesselHeadingCyclically

bool isobus::NMEA2000MessageInterface::sendVesselHeadingCyclically
private

Determines if the interface will try to send the vessel heading message cyclically.

Definition at line 335 of file nmea2000_message_interface.hpp.

◆ txFlags

ProcessingFlags isobus::NMEA2000MessageInterface::txFlags
private

A set of flags used to track what messages need to be transmitted or retried.

Definition at line 307 of file nmea2000_message_interface.hpp.

◆ vesselHeadingEventPublisher

EventDispatcher<const std::shared_ptr<NMEA2000Messages::VesselHeading>, bool> isobus::NMEA2000MessageInterface::vesselHeadingEventPublisher
private

An event dispatcher for notifying when new guidance machine info messages are received.

Definition at line 328 of file nmea2000_message_interface.hpp.

◆ vesselHeadingTransmitMessage

NMEA2000Messages::VesselHeading isobus::NMEA2000MessageInterface::vesselHeadingTransmitMessage
private

Stores a set of data specifically for transmitting the PGN 127250 (0x1F112) if enabled.

Definition at line 314 of file nmea2000_message_interface.hpp.


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