nmealib 0.0.4
NMEA 0183/NMEA 2000 parsing library
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
nmealib::nmea2000::PGN128259 Class Reference

Strongly-typed class representing PGN 128259 - Speed, Water Referenced. More...

#include <PGN128259.h>

Inheritance diagram for nmealib::nmea2000::PGN128259:
Inheritance graph
[legend]
Collaboration diagram for nmealib::nmea2000::PGN128259:
Collaboration graph
[legend]

Public Member Functions

 PGN128259 (uint8_t sequenceId, Speed speedWaterReferenced, Speed speedGroundReferenced, Byte speedWaterReferencedType, HalfByte speedDirection, Byte reserved1=Byte::fromValue(0U), HalfByte reserved2=HalfByte::fromValue(0U))
 
 PGN128259 (const PGN128259 &)=default
 
PGN128259operator= (const PGN128259 &)=default
 
 PGN128259 (PGN128259 &&) noexcept=default
 
PGN128259operator= (PGN128259 &&) noexcept=default
 
 ~PGN128259 () override=default
 
std::unique_ptr< nmealib::Messageclone () const override
 Creates a polymorphic deep copy of this Message2000.
 
uint8_t getSequenceId () const noexcept
 
Speed getSpeedWaterReferenced () const noexcept
 
Speed getSpeedGroundReferenced () const noexcept
 
Byte getSpeedWaterReferencedType () const noexcept
 
HalfByte getSpeedDirection () const noexcept
 
Byte getReserved1 () const noexcept
 
HalfByte getReserved2 () const noexcept
 
std::string getStringContent (bool verbose) const noexcept override
 Returns a human-readable string representation of the message.
 
bool operator== (const PGN128259 &other) const noexcept
 
virtual bool operator== (const Message2000 &other) const noexcept
 
- Public Member Functions inherited from nmealib::nmea2000::Message2000
 Message2000 (const Message2000 &)=default
 
Message2000operator= (const Message2000 &)=default
 
 Message2000 (Message2000 &&) noexcept=default
 
Message2000operator= (Message2000 &&)=default
 
 ~Message2000 () override=default
 
const std::vector< uint8_t > & getCanId () const noexcept
 Returns the 29-bit CAN identifier as 4 bytes (big-endian).
 
const std::vector< uint8_t > & getCanFrame () const noexcept
 Returns the raw CAN frame payload (0-223 bytes).
 
uint8_t getCanFrameLength () const noexcept
 Returns the number of bytes in the CAN frame payload.
 
uint8_t getPriority () const noexcept
 Returns the 3-bit message priority (0 = highest, 7 = lowest).
 
bool getPriority3 () const noexcept
 Returns individual priority bits (P3 is the MSB).
 
bool getPriority2 () const noexcept
 Bit 3 of canId_[0].
 
bool getPriority1 () const noexcept
 Bit 2 of canId_[0].
 
bool getHeaderReserved () const noexcept
 Returns the Reserved bit (R1).
 
bool getDataPage () const noexcept
 Returns the Data Page bit (DP).
 
uint8_t getPDUFormat () const noexcept
 Returns the PDU Format byte (PF).
 
uint8_t getPDUSpecific () const noexcept
 Returns the PDU Specific byte (PS).
 
uint8_t getSourceAddress () const noexcept
 Returns the source address of the transmitting device.
 
uint8_t getDestinationAddress () const noexcept
 Returns the destination address.
 
uint32_t getPgn () const noexcept
 Returns the PGN (Parameter Group Number) extracted from the CAN Id.
 
std::string serialize () const override
 Serializes the message to "CANID:data" hex format.
 
bool validate () const override
 Returns true if the PGN fits in 18 bits and the frame is 0-223 bytes.
 
- Public Member Functions inherited from nmealib::Message
 Message ()
 
 Message (std::string raw, Type type=Type::Unknown, TimePoint ts=std::chrono::system_clock::now()) noexcept
 
virtual ~Message ()
 
 Message (const Message &)=default
 
Messageoperator= (const Message &)=default
 
 Message (Message &&) noexcept=default
 
Messageoperator= (Message &&) noexcept=default
 
Type getType () const noexcept
 Returns the message type.
 
const std::string & getRawData () const noexcept
 Returns the raw, unmodified data string as received.
 
TimePoint getTimestamp () const noexcept
 Returns the timestamp associated with this message.
 
bool operator== (const Message &other) const noexcept
 Compares two Message objects for equality based on their content.
 

Friends

class Nmea2000Factory
 
class MessageRegistry
 

Additional Inherited Members

- Public Types inherited from nmealib::Message
enum class  Type { Unknown , NMEA0183 , NMEA2000 }
 Defines the type of NMEA message, allowing for differentiation between various standards. More...
 
using TimePoint = std::chrono::system_clock::time_point
 
- Static Public Member Functions inherited from nmealib::Message
static std::string typeToString (Type t)
 Converts a Message::Type enum value to its string representation.
 
- Protected Member Functions inherited from nmealib::nmea2000::Message2000
std::string toString (bool verbose) const noexcept
 Returns the base string common to all PGNs (used by getStringContent).
 
- Protected Member Functions inherited from nmealib::Message
void setType (Type t) noexcept
 Sets the message type.
 
void setRaw (std::string r) noexcept
 Sets the raw data string.
 
void setTimestamp (TimePoint ts) noexcept
 Sets the message timestamp.
 
- Static Protected Member Functions inherited from nmealib::nmea2000::Message2000
static std::unique_ptr< Message2000create (std::string raw, TimePoint ts=std::chrono::system_clock::now())
 Protected factory — parses "CANID:data" (and variant formats) into a Message2000.
 
- Protected Attributes inherited from nmealib::nmea2000::Message2000
std::vector< uint8_t > canId_
 29-bit CAN Id stored as 4 bytes (big-endian)
 
std::vector< uint8_t > canFrame_
 CAN frame payload (0-223 bytes)
 
- Protected Attributes inherited from nmealib::Message
std::string rawData_
 
Type type_ {Type::Unknown}
 
TimePoint timestamp_ {}
 

Detailed Description

Strongly-typed class representing PGN 128259 - Speed, Water Referenced.

PGN 128259 is used to report the water-referenced speed of a vessel, along with the ground-referenced speed, the type of water speed sensor, and the direction of movement. The message contains the following fields:

Definition at line 32 of file PGN128259.h.

Constructor & Destructor Documentation

◆ PGN128259() [1/3]

nmealib::nmea2000::PGN128259::PGN128259 ( uint8_t  sequenceId,
Speed  speedWaterReferenced,
Speed  speedGroundReferenced,
Byte  speedWaterReferencedType,
HalfByte  speedDirection,
Byte  reserved1 = Byte::fromValue(0U),
HalfByte  reserved2 = HalfByte::fromValue(0U) 
)

Definition at line 49 of file PGN128259.cpp.

◆ PGN128259() [2/3]

nmealib::nmea2000::PGN128259::PGN128259 ( const PGN128259 )
default

◆ PGN128259() [3/3]

nmealib::nmea2000::PGN128259::PGN128259 ( PGN128259 &&  )
defaultnoexcept

◆ ~PGN128259()

nmealib::nmea2000::PGN128259::~PGN128259 ( )
overridedefault

Member Function Documentation

◆ clone()

std::unique_ptr< Message > nmealib::nmea2000::PGN128259::clone ( ) const
overridevirtual

Creates a polymorphic deep copy of this Message2000.

Reimplemented from nmealib::nmea2000::Message2000.

Definition at line 72 of file PGN128259.cpp.

◆ getReserved1()

Byte nmealib::nmea2000::PGN128259::getReserved1 ( ) const
noexcept

Definition at line 166 of file PGN128259.cpp.

◆ getReserved2()

HalfByte nmealib::nmea2000::PGN128259::getReserved2 ( ) const
noexcept

Definition at line 170 of file PGN128259.cpp.

◆ getSequenceId()

uint8_t nmealib::nmea2000::PGN128259::getSequenceId ( ) const
noexcept
Returns
the sequence ID.

Definition at line 146 of file PGN128259.cpp.

◆ getSpeedDirection()

HalfByte nmealib::nmea2000::PGN128259::getSpeedDirection ( ) const
noexcept
Returns
the speed direction.

Definition at line 162 of file PGN128259.cpp.

◆ getSpeedGroundReferenced()

Speed nmealib::nmea2000::PGN128259::getSpeedGroundReferenced ( ) const
noexcept
Returns
the ground-referenced speed.

Definition at line 154 of file PGN128259.cpp.

◆ getSpeedWaterReferenced()

Speed nmealib::nmea2000::PGN128259::getSpeedWaterReferenced ( ) const
noexcept
Returns
the water-referenced speed.

Definition at line 150 of file PGN128259.cpp.

◆ getSpeedWaterReferencedType()

Byte nmealib::nmea2000::PGN128259::getSpeedWaterReferencedType ( ) const
noexcept
Returns
the water-referenced speed type.

Definition at line 158 of file PGN128259.cpp.

◆ getStringContent()

std::string nmealib::nmea2000::PGN128259::getStringContent ( bool  verbose) const
overridevirtualnoexcept

Returns a human-readable string representation of the message.

Verbose: multi-line dump of all fields. Non-verbose: single-line summary.

Reimplemented from nmealib::nmea2000::Message2000.

Definition at line 76 of file PGN128259.cpp.

◆ operator=() [1/2]

PGN128259 & nmealib::nmea2000::PGN128259::operator= ( const PGN128259 )
default

◆ operator=() [2/2]

PGN128259 & nmealib::nmea2000::PGN128259::operator= ( PGN128259 &&  )
defaultnoexcept

◆ operator==() [1/2]

bool nmealib::nmea2000::Message2000::operator== ( const Message2000 other) const
virtualnoexcept

Reimplemented from nmealib::nmea2000::Message2000.

Definition at line 192 of file nmea2000.cpp.

◆ operator==() [2/2]

bool nmealib::nmea2000::PGN128259::operator== ( const PGN128259 other) const
noexcept

Definition at line 174 of file PGN128259.cpp.

Friends And Related Symbol Documentation

◆ MessageRegistry

friend class MessageRegistry
friend

Definition at line 106 of file PGN128259.h.

◆ Nmea2000Factory

friend class Nmea2000Factory
friend

Definition at line 105 of file PGN128259.h.


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