AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
nmea2000_message_definitions.hpp
Go to the documentation of this file.
1//================================================================================================
14//================================================================================================
15#ifndef NMEA2000_MESSAGE_DEFINITIONS_HPP
16#define NMEA2000_MESSAGE_DEFINITIONS_HPP
17
19
20#include <string>
21
22namespace isobus
23{
25 namespace NMEA2000Messages
26 {
27 constexpr std::uint8_t MAX_SEQUENCE_ID = 252;
28
31 {
32 public:
34 enum class HeadingSensorReference : std::uint8_t
35 {
36 True = 0,
37 Magnetic = 1,
38 Error = 2,
39 NotApplicableOrNull = 3
40 };
41
44 explicit VesselHeading(std::shared_ptr<ControlFunction> source);
45
48 std::shared_ptr<ControlFunction> get_control_function() const;
49
52 std::uint32_t get_timestamp() const;
53
57 bool set_timestamp(std::uint32_t timestamp);
58
61 std::uint16_t get_raw_heading() const;
62
65 float get_heading() const;
66
70 bool set_heading(std::uint16_t heading);
71
74 std::int16_t get_raw_magnetic_deviation() const;
75
78 float get_magnetic_deviation() const;
79
83 bool set_magnetic_deviation(std::int16_t deviation);
84
87 std::int16_t get_raw_magnetic_variation() const;
88
91 float get_magnetic_variation() const;
92
96 bool set_magnetic_variation(std::int16_t variation);
97
100 std::uint8_t get_sequence_id() const;
101
105 bool set_sequence_id(std::uint8_t sequenceNumber);
106
110
115
118 void serialize(std::vector<std::uint8_t> &buffer) const;
119
123 bool deserialize(const CANMessage &receivedMessage);
124
127 static std::uint32_t get_timeout();
128
129 private:
130 static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS = 100;
131
132 std::shared_ptr<ControlFunction> senderControlFunction;
133 std::uint32_t messageTimestamp_ms = 0;
134 std::uint16_t headingReading = 0;
135 std::int16_t magneticDeviation = 0;
136 std::int16_t magneticVariation = 0;
137 std::uint8_t sequenceID = 0;
138 HeadingSensorReference sensorReference = HeadingSensorReference::NotApplicableOrNull;
139 };
140
143 {
144 public:
147 explicit RateOfTurn(std::shared_ptr<ControlFunction> source);
148
151 std::shared_ptr<ControlFunction> get_control_function() const;
152
155 std::uint32_t get_timestamp() const;
156
160 bool set_timestamp(std::uint32_t timestamp);
161
164 std::int32_t get_raw_rate_of_turn() const;
165
168 double get_rate_of_turn() const;
169
173 bool set_rate_of_turn(std::int32_t turnRate);
174
177 std::uint8_t get_sequence_id() const;
178
182 bool set_sequence_id(std::uint8_t sequenceNumber);
183
186 void serialize(std::vector<std::uint8_t> &buffer) const;
187
191 bool deserialize(const CANMessage &receivedMessage);
192
195 static std::uint32_t get_timeout();
196
197 private:
198 static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS = 100;
199
200 std::shared_ptr<ControlFunction> senderControlFunction;
201 std::uint32_t messageTimestamp_ms = 0;
202 std::int32_t rateOfTurn = 0;
203 std::uint8_t sequenceID = 0;
204 };
205
208 {
209 public:
212 explicit PositionRapidUpdate(std::shared_ptr<ControlFunction> source);
213
214 static constexpr std::int32_t NOT_AVAILABLE = 0x7FFFFFFF;
215
218 std::shared_ptr<ControlFunction> get_control_function() const;
219
222 std::uint32_t get_timestamp() const;
223
227 bool set_timestamp(std::uint32_t timestamp);
228
231 std::int32_t get_raw_latitude() const;
232
235 double get_latitude() const;
236
240 bool set_latitude(std::int32_t latitudeToSet);
241
244 std::int32_t get_raw_longitude() const;
245
248 double get_longitude() const;
249
253 bool set_longitude(std::int32_t longitudeToSet);
254
257 void serialize(std::vector<std::uint8_t> &buffer) const;
258
262 bool deserialize(const CANMessage &receivedMessage);
263
266 static std::uint32_t get_timeout();
267
268 private:
269 static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS = 100;
270
271 std::shared_ptr<ControlFunction> senderControlFunction;
272 std::int32_t latitude = NOT_AVAILABLE;
273 std::int32_t longitude = NOT_AVAILABLE;
274 std::uint32_t messageTimestamp_ms = 0;
275 };
276
279 {
280 public:
282 enum class CourseOverGroundReference : std::uint8_t
283 {
284 True = 0,
285 Magnetic = 1,
286 Error = 2,
287 NotApplicableOrNull = 3
288 };
289
292 explicit CourseOverGroundSpeedOverGroundRapidUpdate(std::shared_ptr<ControlFunction> source);
293
296 std::shared_ptr<ControlFunction> get_control_function() const;
297
300 std::uint32_t get_timestamp() const;
301
305 bool set_timestamp(std::uint32_t timestamp);
306
309 std::uint16_t get_raw_course_over_ground() const;
310
313 float get_course_over_ground() const;
314
318 bool set_course_over_ground(std::uint16_t course);
319
322 std::uint16_t get_raw_speed_over_ground() const;
323
326 float get_speed_over_ground() const;
327
331 bool set_speed_over_ground(std::uint16_t speed);
332
335 std::uint8_t get_sequence_id() const;
336
340 bool set_sequence_id(std::uint8_t sequenceNumber);
341
345
350
353 void serialize(std::vector<std::uint8_t> &buffer) const;
354
358 bool deserialize(const CANMessage &receivedMessage);
359
362 static std::uint32_t get_timeout();
363
364 private:
365 static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS = 250;
366
367 std::shared_ptr<ControlFunction> senderControlFunction;
368 std::uint32_t messageTimestamp_ms = 0;
369 std::uint16_t courseOverGround = 0;
370 std::uint16_t speedOverGround = 0;
371 std::uint8_t sequenceID = 0;
372 CourseOverGroundReference cogReference = CourseOverGroundReference::NotApplicableOrNull;
373 };
374
379 {
380 public:
383 explicit PositionDeltaHighPrecisionRapidUpdate(std::shared_ptr<ControlFunction> source);
384
387 std::shared_ptr<ControlFunction> get_control_function() const;
388
391 std::uint32_t get_timestamp() const;
392
396 bool set_timestamp(std::uint32_t timestamp);
397
400 std::int32_t get_raw_latitude_delta() const;
401
404 double get_latitude_delta() const;
405
409 bool set_latitude_delta(std::int32_t delta);
410
413 std::int32_t get_raw_longitude_delta() const;
414
417 double get_longitude_delta() const;
418
422 bool set_longitude_delta(std::int32_t delta);
423
426 std::uint8_t get_sequence_id() const;
427
431 bool set_sequence_id(std::uint8_t sequenceNumber);
432
435 std::uint8_t get_raw_time_delta() const;
436
439 double get_time_delta() const;
440
444 bool set_time_delta(std::uint8_t delta);
445
448 void serialize(std::vector<std::uint8_t> &buffer) const;
449
453 bool deserialize(const CANMessage &receivedMessage);
454
457 static std::uint32_t get_timeout();
458
459 private:
460 static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS = 250;
461
462 std::shared_ptr<ControlFunction> senderControlFunction;
463 std::uint32_t messageTimestamp_ms = 0;
464 std::int32_t latitudeDelta = 0;
465 std::int32_t longitudeDelta = 0;
466 std::uint8_t sequenceID = 0;
467 std::uint8_t timeDelta = 0;
468 };
469
472 {
473 public:
475 enum class TypeOfSystem
476 {
477 GPS = 0x00,
478 GLONASS = 0x01,
479 GPSPlusGLONASS = 0x02,
480 GPSPlusSBAS = 0x03,
482 Chayka = 0x05,
483 Integrated = 0x06,
484 Surveyed = 0x07,
485 Galileo = 0x08,
486 Null = 0x0F
487 };
488
490 enum class GNSSMethod
491 {
492 NoGNSS = 0x00,
493 GNSSFix = 0x01,
494 DGNSSFix = 0x02,
495 PreciseGNSS = 0x03,
496 RTKFixedInteger = 0x04,
497 RTKFloat = 0x05,
498 EstimatedMode = 0x06,
499 ManualInput = 0x07,
500 SimulateMode = 0x08,
501 Null = 0x0F
502 };
503
505 enum class Integrity
506 {
507 NoIntegrityChecking = 0x00,
508 Safe = 0x01,
509 Caution = 0x02,
510 Unsafe = 0x03
511 };
512
515 explicit GNSSPositionData(std::shared_ptr<ControlFunction> source);
516
519 std::shared_ptr<ControlFunction> get_control_function() const;
520
523 std::int64_t get_raw_altitude() const;
524
527 double get_altitude() const;
528
532 bool set_altitude(std::int64_t altitudeToSet);
533
536 std::int64_t get_raw_latitude() const;
537
540 double get_latitude() const;
541
545 bool set_latitude(std::int64_t latitudeToSet);
546
549 std::int64_t get_raw_longitude() const;
550
553 double get_longitude() const;
554
558 bool set_longitude(std::int64_t longitudeToSet);
559
563 std::int32_t get_raw_geoidal_separation() const;
564
568 float get_geoidal_separation() const;
569
574 bool set_geoidal_separation(std::int32_t separation);
575
578 std::uint32_t get_timestamp() const;
579
583 bool set_timestamp(std::uint32_t timestamp);
584
587 std::uint8_t get_sequence_id() const;
588
592 bool set_sequence_id(std::uint8_t sequenceNumber);
593
597
602
606
610 bool set_gnss_method(GNSSMethod gnssFixMethod);
611
614 Integrity get_integrity() const;
615
619 bool set_integrity(Integrity integrity);
620
623 std::uint8_t get_number_of_space_vehicles() const;
624
628 bool set_number_of_space_vehicles(std::uint8_t numberOfSVs);
629
633 std::int16_t get_raw_horizontal_dilution_of_precision() const;
634
639
643 bool set_horizontal_dilution_of_precision(std::int16_t hdop);
644
648 std::int16_t get_raw_positional_dilution_of_precision() const;
649
654
658 bool set_positional_dilution_of_precision(std::int16_t pdop);
659
662 std::uint8_t get_number_of_reference_stations() const;
663
667 bool set_number_of_reference_stations(std::uint8_t stations);
668
672 std::uint16_t get_reference_station_id(std::size_t index) const;
673
677 std::uint16_t get_raw_reference_station_corrections_age(std::size_t index) const;
678
682 float get_reference_station_corrections_age(std::size_t index) const;
683
687 TypeOfSystem get_reference_station_system_type(std::size_t index) const;
688
695 bool set_reference_station(std::size_t index, std::uint16_t ID, TypeOfSystem type, std::uint16_t ageOfCorrections);
696
699 std::uint16_t get_position_date() const;
700
704 bool set_position_date(std::uint16_t dateToSet);
705
708 std::uint32_t get_raw_position_time() const;
709
712 double get_position_time() const;
713
717 bool set_position_time(std::uint32_t timeToSet);
718
721 void serialize(std::vector<std::uint8_t> &buffer) const;
722
726 bool deserialize(const CANMessage &receivedMessage);
727
730 static std::uint32_t get_timeout();
731
732 private:
735 {
736 public:
739
744 ReferenceStationData(std::uint16_t id, TypeOfSystem type, std::uint16_t age);
745 std::uint16_t stationID = 0;
746 TypeOfSystem stationType = TypeOfSystem::Null;
747 std::uint16_t ageOfDGNSSCorrections = 0xFFFF;
748 };
749
750 static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS = 1000;
751 static constexpr std::uint8_t MINIMUM_LENGTH_BYTES = 43;
752
753 std::shared_ptr<ControlFunction> senderControlFunction;
754 std::vector<ReferenceStationData> referenceStations;
755 std::int64_t altitude = 0;
756 std::int64_t latitude = 0;
757 std::int64_t longitude = 0;
758 std::uint32_t messageTimestamp_ms = 0;
759 std::uint32_t positionTime = 0;
760 std::int32_t geoidalSeparation = 0;
761 std::uint16_t positionDate = 0;
764 std::uint8_t numberOfSpaceVehicles = 0;
765 std::uint8_t sequenceID = 0;
766 TypeOfSystem systemType = TypeOfSystem::Null;
768 Integrity integrityChecking = Integrity::NoIntegrityChecking;
769 };
770
775 class Datum
776 {
777 public:
780 explicit Datum(std::shared_ptr<ControlFunction> source);
781
784 std::shared_ptr<ControlFunction> get_control_function() const;
785
788 std::string get_local_datum() const;
789
793 bool set_local_datum(const std::string &datum);
794
797 std::string get_reference_datum() const;
798
802 bool set_reference_datum(const std::string &datum);
803
806 std::int32_t get_raw_delta_latitude() const;
807
810 double get_delta_latitude() const;
811
815 bool set_delta_latitude(std::int32_t delta);
816
819 std::int32_t get_raw_delta_longitude() const;
820
823 double get_delta_longitude() const;
824
828 bool set_delta_longitude(std::int32_t delta);
829
832 std::int32_t get_raw_delta_altitude() const;
833
836 float get_delta_altitude() const;
837
841 bool set_delta_altitude(std::int32_t delta);
842
845 std::uint32_t get_timestamp() const;
846
850 bool set_timestamp(std::uint32_t timestamp);
851
854 void serialize(std::vector<std::uint8_t> &buffer) const;
855
859 bool deserialize(const CANMessage &receivedMessage);
860
863 static std::uint32_t get_timeout();
864
865 private:
866 static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS = 10000;
867 static constexpr std::uint8_t LENGTH_BYTES = 20;
868 static constexpr std::uint8_t DATUM_STRING_LENGTHS = 4;
869
870 std::shared_ptr<ControlFunction> senderControlFunction;
871 std::string localDatum;
872 std::string referenceDatum;
873 std::int32_t deltaLatitude = 0;
874 std::int32_t deltaLongitude = 0;
875 std::int32_t deltaAltitude = 0;
876 std::uint32_t messageTimestamp_ms = 0;
877 };
878 } // namespace NMEA2000Messages
879} // namespace isobus
880#endif // NMEA2000_MESSAGE_DEFINITIONS_HPP
A representation of an ISOBUS ECU that we can send from. Use this class when defining your own contro...
A class that represents a generic CAN message of arbitrary length.
Represents the data sent in the NMEA2K PGN 129026 (0x1F802)
std::uint16_t courseOverGround
This field contains the direction of the path over ground actually followed by the vessel in 0....
CourseOverGroundReference get_course_over_ground_reference() const
Returns the reference to which the course over ground is relative.
static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS
The transmit interval for this message as specified in NMEA2000.
CourseOverGroundReference cogReference
Used to indicate the reference for the course over ground, ie true or magnetic north.
std::uint16_t speedOverGround
This field contains the speed of the vessel in 0.01 m/s.
static std::uint32_t get_timeout()
Returns the timeout (the sending interval) for this message in milliseconds.
std::shared_ptr< ControlFunction > senderControlFunction
The sender of the message data.
std::uint8_t sequenceID
The sequence identifier field is used to tie related PGNs together. Somewhat arbitrary.
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 deserialize(const CANMessage &receivedMessage)
Deserializes a CAN message to populate this object's contents. Updates the timestamp when called.
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 set_course_over_ground(std::uint16_t course)
Sets the course over ground in units of 0.0001 radians.
std::uint32_t get_timestamp() const
Returns a timestamp in milliseconds corresponding to when the message was last sent or received.
float get_speed_over_ground() const
Returns the speed over ground in units of meters per second.
CourseOverGroundReference
Enumerates the references to which the course may be relative to.
std::shared_ptr< ControlFunction > get_control_function() const
Returns the control function sending this instance of this message.
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)
std::uint16_t get_raw_speed_over_ground() const
Returns the speed over ground in units of 0.01 meters per second.
float get_course_over_ground() const
Returns the course over ground in units of radians.
bool set_timestamp(std::uint32_t timestamp)
Sets the time in milliseconds when the message was last sent or received.
bool set_sequence_id(std::uint8_t sequenceNumber)
Sets the sequence ID for this message.
bool set_course_over_ground_reference(CourseOverGroundReference reference)
Sets the reference to which the course over ground is relative.
std::uint32_t messageTimestamp_ms
A timestamp in milliseconds when this message was last sent or received.
A NMEA2000 message that describes datum (reference frame) information. PGN 129044 (0x1F814) A common ...
std::int32_t deltaLongitude
Position in the local datum is offset from the position in the reference datum as indicated by this l...
std::int32_t deltaLatitude
Position in the local datum is offset from the position in the reference datum as indicated by this l...
bool deserialize(const CANMessage &receivedMessage)
Deserializes a CAN message to populate this object's contents. Updates the timestamp when called.
std::shared_ptr< ControlFunction > get_control_function() const
Returns the control function sending this instance of this message.
static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS
The transmit interval for this message as specified in NMEA2000.
bool set_delta_altitude(std::int32_t delta)
Sets the altitude offset of position in the local datum relative to the position in the reference dat...
std::int32_t deltaAltitude
The altitude delta in units of 0.01 meters. Positive values indicate Up.
std::string get_reference_datum() const
Returns the 4 character ascii datum code that identifies the reference datum.
static std::uint32_t get_timeout()
Returns the timeout (the sending interval) for this message in milliseconds.
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.
static constexpr std::uint8_t DATUM_STRING_LENGTHS
The size of the datum codes in bytes.
bool set_reference_datum(const std::string &datum)
Sets the 4 character ascii datum code that identifies the reference datum.
std::uint32_t get_timestamp() const
Returns a timestamp in milliseconds corresponding to when the message was last sent or received.
bool set_delta_latitude(std::int32_t delta)
Sets latitude offset of position in the local datum from the position in the reference datum in units...
float get_delta_altitude() const
Returns the altitude offset of position in the local datum relative to the position in the reference ...
std::uint32_t messageTimestamp_ms
A timestamp in milliseconds when this message was last sent or received.
std::int32_t get_raw_delta_longitude() const
Returns longitude offset of position in the local datum from the position in the reference datum....
std::int32_t get_raw_delta_altitude() const
Returns the altitude offset of position in the local datum relative to the position in the reference ...
std::string localDatum
A 4 character ascii datum code. The first three chars are the datum ID.The fourth char is the local d...
double get_delta_latitude() const
Returns latitude offset of position in the local datum from the position in the reference datum....
double get_delta_longitude() const
Returns longitude offset of position in the local datum from the position in the reference datum....
std::string get_local_datum() const
Returns the 4 character ascii datum code.
bool set_delta_longitude(std::int32_t delta)
Sets longitude offset of position in the local datum from the position in the reference datum in unit...
bool set_local_datum(const std::string &datum)
Sets the local datum's 4 character ascii datum code.
bool set_timestamp(std::uint32_t timestamp)
Sets the time in milliseconds when the message was last sent or received.
std::string referenceDatum
A 4 character ascii datum code that identifies the reference datum.
std::int32_t get_raw_delta_latitude() const
Returns latitude offset of position in the local datum from the position in the reference datum....
std::shared_ptr< ControlFunction > senderControlFunction
The sender of the message data.
static constexpr std::uint8_t LENGTH_BYTES
The size of this message in bytes.
std::uint16_t ageOfDGNSSCorrections
Stores the age of the corrections from this reference.
std::uint16_t stationID
The station ID of this reference. Can sometimes be used to infer your correction source.
ReferenceStationData()=default
Default constructor for a ReferenceStationData with default values.
Represents the data sent in the NMEA2K PGN 129029 (0x1F805)
Integrity get_integrity() const
Sets the integrity being reported for this position solution if applicable.
TypeOfSystem get_type_of_system() const
Returns the reported type of GNSS system that produced this position solution.
double get_altitude() const
Returns the altitude portion of the position fix in scaled units of meters. Range is +/- 9....
bool set_geoidal_separation(std::int32_t separation)
Sets the geoidal separation.
double get_position_time() const
Returns the number of seconds since midnight.
bool set_integrity(Integrity integrity)
Sets the integrity reported for this position solution.
std::int64_t get_raw_latitude() const
Returns our current position's latitude in its base units of 1x10E-16 degrees.
std::int64_t get_raw_longitude() const
Returns our current position's longitude in its base units of 1x10E-16 degrees.
GNSSMethod
Enumerates the GNSS methods that can be reported in this message.
@ PreciseGNSS
Solution achieved using Precise Point Positioning (PPP)
@ NoGNSS
Either there is not enough data to compute a navigation solution, or the computed solution is outside...
@ RTKFloat
Solution achieved using radio corrections (from an RTK base station) but using floating point instead...
@ RTKFixedInteger
Solution achieved using radio corrections (from an RTK base station)
@ GNSSFix
Position solution has been achieved.
@ DGNSSFix
Differential solution achieved based on deviation from a well known reference point.
TypeOfSystem
Enumerates the different GNSS systems that can be reported in this message.
@ Galileo
A GNSS system operated by the European Space Agency.
@ Chayka
A Russian Hyperbolic Radio Navigation System similar to Loran-C.
@ GLONASS
A Russian state operated alternative to GPS.
@ GPS
A GNSS system operated by the United States military.
@ Integrated
Using internally integrated solution (maybe digital dead reckoning)
@ GPSPlusSBAS
Satellite Based Augmentation System (WAAS) enhanced GPS (Run by the US Federal Aviation Administratio...
@ GPSPlusGLONASS
A system using both GPS and GLONASS.
@ GPSPlusSBASPlusGLONASS
A system using SBAS augmented GPS as well as GLONASS.
std::shared_ptr< ControlFunction > senderControlFunction
The sender of the message data.
bool set_horizontal_dilution_of_precision(std::int16_t hdop)
Sets the horizontal dilution of precision (HDOP)
std::shared_ptr< ControlFunction > get_control_function() const
Returns the control function sending this instance of this message.
bool set_sequence_id(std::uint8_t sequenceNumber)
Sets the sequence ID for this message.
std::uint8_t get_number_of_space_vehicles() const
Returns the number of space vehicles used in this position solution.
bool set_position_time(std::uint32_t timeToSet)
Sets the number of seconds since midnight.
std::uint32_t messageTimestamp_ms
A timestamp in milliseconds when this message was last sent or received.
std::uint32_t positionTime
The number of seconds since midnight on the current day. Allows for up to 2 leap seconds per day....
std::int16_t get_raw_horizontal_dilution_of_precision() const
Returns the HDOP for this solution. This Indicates the contribution of satellite configuration geomet...
float get_reference_station_corrections_age(std::size_t index) const
Returns the specified reference station's DGNSS corrections age by index.
bool set_number_of_space_vehicles(std::uint8_t numberOfSVs)
Sets the number of space vehicles in view and used in this position solution.
Integrity integrityChecking
Stores the integrity of the values in the message.
static std::uint32_t get_timeout()
Returns the timeout (the sending interval) for this message in milliseconds.
std::uint32_t get_timestamp() const
Returns a timestamp in milliseconds corresponding to when the message was last sent or received.
bool set_altitude(std::int64_t altitudeToSet)
Sets the reported altitude in units of 1x10E-6 meters. Range is +/- 9.223 x 10E+12 meters.
std::uint8_t get_number_of_reference_stations() const
Returns the number of reference stations used in this position solution (if applicable to GNSS method...
bool set_gnss_method(GNSSMethod gnssFixMethod)
Sets the GNSS method to report as the source of this position solution, such as RTK float or DGNSS.
std::uint16_t get_reference_station_id(std::size_t index) const
Returns the specified reference station's ID by index.
std::int32_t get_raw_geoidal_separation() const
Returns the geoidal separation in units of 0.01 meters.
std::int64_t get_raw_altitude() const
Returns the altitude portion of the position fix in its base units of 1x10E-6 meters....
static constexpr std::uint8_t MINIMUM_LENGTH_BYTES
The minimum size of this message in bytes.
std::int16_t get_raw_positional_dilution_of_precision() const
Returns the PDOP for this solution. This Indicates the contribution of satellite configuration geomet...
float get_horizontal_dilution_of_precision() const
Returns the HDOP for this solution. This Indicates the contribution of satellite configuration geomet...
std::uint32_t get_raw_position_time() const
Returns the number of seconds since midnight.
std::uint8_t sequenceID
The sequence identifier field is used to tie related PGNs together. Somewhat arbitrary.
bool set_latitude(std::int64_t latitudeToSet)
Sets the reported latitude in its base units of 1x10E-16 degrees.
std::int16_t horizontalDilutionOfPrecision
Indicates the contribution of satellite configuration geometry to positioning error....
static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS
The transmit interval for this message as specified in NMEA2000.
TypeOfSystem systemType
The type of GNSS system used when generating this message.
std::int16_t positionalDilutionOfPrecision
Indicates the contribution of satellite configuration geometry to positioning error....
bool set_position_date(std::uint16_t dateToSet)
Sets the date to report relative to UTC since Jan 1 1970. Max normal value is 65532.
double get_longitude() const
Returns our current position's longitude in units of degrees.
GNSSMethod method
Stores the method used to provide the GNSS fix.
bool set_reference_station(std::size_t index, std::uint16_t ID, TypeOfSystem type, std::uint16_t ageOfCorrections)
Sets the data for the specified reference station by index.
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_positional_dilution_of_precision(std::int16_t pdop)
Sets the positional dilution of precision (PDOP)
GNSSMethod get_gnss_method() const
Returns the GNSS method being reported as part of this position solution, such as RTK Float or DGNSS.
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 set_longitude(std::int64_t longitudeToSet)
Sets the reported longitude in its base units of 1x10E-16 degrees.
std::uint16_t positionDate
Number of days relative to UTC since Jan 1 1970 (so 0 is equal to Jan 1, 1970). Max value is 65532 da...
std::uint16_t get_position_date() const
Returns the date associated with the current position.
bool set_timestamp(std::uint32_t timestamp)
Sets the time in milliseconds when the message was last sent or received.
double get_latitude() const
Returns our current position's latitude in units of degrees.
bool deserialize(const CANMessage &receivedMessage)
Deserializes a CAN message to populate this object's contents. Updates the timestamp when called.
std::int64_t longitude
The current longitude in 1x10E-16 degrees. Range is -90 to 90 degrees. Negative values are west longi...
bool set_type_of_system(TypeOfSystem type)
Sets the reported type of GNSS system that produced this position solution.
TypeOfSystem get_reference_station_system_type(std::size_t index) const
Returns the specified reference station's system type by index.
std::int64_t altitude
The current altitude in 1x10E-6 meters. Range is +/- 9.223 x 10E+12 meters.
std::vector< ReferenceStationData > referenceStations
Stores data about the reference stations used to generate this position solution.
std::uint8_t numberOfSpaceVehicles
Number of GPS satellites in view.
bool set_number_of_reference_stations(std::uint8_t stations)
Sets the number of reference stations used in this position solution.
std::uint16_t get_raw_reference_station_corrections_age(std::size_t index) const
Returns the specified reference station's DGNSS corrections age by index.
std::int64_t latitude
The current latitude in 1x10E-16 degrees. Range is -90 to 90 degrees. Negative values are south latit...
float get_positional_dilution_of_precision() const
Returns the PDOP for this solution. This Indicates the contribution of satellite configuration geomet...
float get_geoidal_separation() const
Returns the geoidal separation in units of meters.
Integrity
Enumerates the integrity checking modes that can be reported in this message. You will most often see...
std::int32_t geoidalSeparation
The difference between the earth ellipsoid and mean-sea-level (geoid) defined by the reference datum ...
This message is a way for a GNSS receiver to provide a current position without using fast packet bas...
std::int32_t get_raw_latitude_delta() const
Returns the latitude delta relative to our last position in 1x10E-16 degrees.
std::uint32_t get_timestamp() const
Returns a timestamp in milliseconds corresponding to when the message was last sent or received.
std::int32_t longitudeDelta
The longitude delta in 1x10E-16 degrees.
bool set_time_delta(std::uint8_t delta)
Sets the time delta, in units of 5x10e-3 seconds.
std::uint32_t messageTimestamp_ms
A timestamp in milliseconds when this message was last sent or received.
std::uint8_t get_raw_time_delta() const
Returns the raw time delta since the last reported time in 5x10e-3 seconds.
double get_latitude_delta() const
Returns the latitude delta relative to our last position in degrees.
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.
double get_longitude_delta() const
Returns the longitude delta relative to our last position in degrees.
static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS
The transmit interval for this message as specified in NMEA2000.
std::uint8_t sequenceID
The sequence identifier field is used to tie related PGNs together. In this case, ties back to GNSS P...
bool set_longitude_delta(std::int32_t delta)
Sets the current longitude delta relative to our last position in 1x10E-16 degrees.
bool set_timestamp(std::uint32_t timestamp)
Sets the time in milliseconds when the message was last sent or received.
static std::uint32_t get_timeout()
Returns the timeout (the sending interval) for this message in milliseconds.
std::shared_ptr< ControlFunction > senderControlFunction
The sender of the message data.
std::int32_t latitudeDelta
The latitude delta in 1x10E-16 degrees.
std::int32_t get_raw_longitude_delta() const
Returns the longitude delta relative to our last position in 1x10E-16 degrees.
double get_time_delta() const
Returns the raw time delta since the last reported time in seconds.
std::shared_ptr< ControlFunction > get_control_function() const
Returns the control function sending this instance of this message.
bool set_sequence_id(std::uint8_t sequenceNumber)
Sets the sequence ID for this message.
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_latitude_delta(std::int32_t delta)
Sets the current latitude delta in units of 1x10E-16 degrees.
bool deserialize(const CANMessage &receivedMessage)
Deserializes a CAN message to populate this object's contents. Updates the timestamp when called.
Represents the data sent in the NMEA2K PGN 129025 (0x1F801)
static constexpr std::int32_t NOT_AVAILABLE
A generic value that may be reported if the position solution is invalid.
std::int32_t longitude
The longitude in 1*10E-7 degrees. Negative values indicate west longitudes.
bool set_latitude(std::int32_t latitudeToSet)
Sets the current latitude in units of 1*10E-7 degrees.
std::uint32_t messageTimestamp_ms
A timestamp in milliseconds when this message was last sent or received.
std::int32_t latitude
The latitude in 1*10E-7 degrees. Negative values indicate south latitudes.
bool deserialize(const CANMessage &receivedMessage)
Deserializes a CAN message to populate this object's contents. Updates the timestamp when called.
std::shared_ptr< ControlFunction > senderControlFunction
The sender of the message data.
static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS
The transmit interval for this message as specified in NMEA2000.
std::uint32_t get_timestamp() const
Returns a timestamp in milliseconds corresponding to when the message was last sent or received.
bool set_longitude(std::int32_t longitudeToSet)
Sets the current longitude in units of 1*10E-7 degrees.
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.
std::shared_ptr< ControlFunction > get_control_function() const
Returns the control function sending this instance of this message.
bool set_timestamp(std::uint32_t timestamp)
Sets the time in milliseconds when the message was last sent or received.
static std::uint32_t get_timeout()
Returns the timeout (the sending interval) for this message in milliseconds.
Represents the data sent in the NMEA2K PGN 127251 (0x1F113)
std::shared_ptr< ControlFunction > senderControlFunction
The sender of the message data.
static std::uint32_t get_timeout()
Returns the timeout (the sending interval) for this message in milliseconds.
std::int32_t rateOfTurn
The rate of turn in 1/32 * 10e-6 rad/s. Positive values indicate turning right (starboard) relative t...
std::shared_ptr< ControlFunction > get_control_function() const
Returns the control function sending this instance of this message.
std::uint32_t messageTimestamp_ms
A timestamp in milliseconds when this message was last sent or received.
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.
static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS
The interval in milliseconds on which this message should be sent/received.
std::uint8_t sequenceID
The sequence identifier field is used to tie related PGNs together. Somewhat arbitrary.
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.
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::uint32_t get_timestamp() const
Returns a timestamp in milliseconds corresponding to when the message was last sent or received.
double get_rate_of_turn() const
Returns the rate of turn of the vessel/vehicle in rad/s.
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.
bool deserialize(const CANMessage &receivedMessage)
Deserializes a CAN message to populate this object's contents. Updates the timestamp when called.
Represents the data sent in the NMEA2K PGN 127250 (0x1F112)
bool set_magnetic_deviation(std::int16_t deviation)
Sets the magnetic deviation in 0.0001 radians.
std::uint16_t get_raw_heading() const
Returns the vessel heading in units of 0.0001 radians, which are the message's base units.
float get_heading() const
Returns the vessel heading in radians.
bool set_heading(std::uint16_t heading)
Sets the vessel heading.
HeadingSensorReference get_sensor_reference() const
Returns the reference to which the reported heading is relative to.
static std::uint32_t get_timeout()
Returns the timeout (the sending interval) for this message in milliseconds.
bool deserialize(const CANMessage &receivedMessage)
Deserializes a CAN message to populate this object's contents. Updates the timestamp when called.
HeadingSensorReference sensorReference
Indicates what the heading is relative to, ie true or magnetic north.
bool set_sensor_reference(HeadingSensorReference reference)
Sets the reference to which the reported heading is relative to.
std::shared_ptr< ControlFunction > get_control_function() const
Returns the control function sending this instance of this message.
std::uint8_t get_sequence_id() const
Returns the sequence ID. This is used to associate data within other PGNs with this message.
std::int16_t get_raw_magnetic_variation() const
Returns the magnetic variation in units of 0.0001 radians.
float get_magnetic_deviation() const
Returns the magnetic deviation in radians.
HeadingSensorReference
The reference which the vessel heading is relative to.
std::int16_t get_raw_magnetic_deviation() const
Returns the magnetic deviation in 0.0001 radians.
std::uint8_t sequenceID
The sequence identifier field is used to tie related PGNs together. Somewhat arbitrary.
bool set_magnetic_variation(std::int16_t variation)
Sets the magnetic variation, in units of 0.0001 radians.
std::uint32_t messageTimestamp_ms
A timestamp in milliseconds when this message was last sent or received.
bool set_sequence_id(std::uint8_t sequenceNumber)
Sets the sequence ID for this message.
static constexpr std::uint32_t CYCLIC_MESSAGE_RATE_MS
The interval in milliseconds on which this message should be sent/received.
std::uint16_t headingReading
The raw heading in 0.0001 radians, relative to the indicated HeadingSensorReference.
std::uint32_t get_timestamp() const
Returns a timestamp in milliseconds corresponding to when the message was last sent or received.
std::shared_ptr< ControlFunction > senderControlFunction
The sender of the message data.
void serialize(std::vector< std::uint8_t > &buffer) const
Takes the current state of the object and serializes it into a buffer to be sent.
bool set_timestamp(std::uint32_t timestamp)
Sets the time in milliseconds when the message was last sent or received.
float get_magnetic_variation() const
Returns the magnetic variation in units of radians.
std::int16_t magneticVariation
The magnetic variation if applicable in 0.0001 radians. Positive values are easterly....
std::int16_t magneticDeviation
The magnetic deviation if not included in the reading in 0.0001 radians. Positive values are easterly...
constexpr std::uint8_t MAX_SEQUENCE_ID
The max non-special allowable value of a NMEA2K sequence ID.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...