configuration.h
Go to the documentation of this file.
1 /**************************************************************************/ /**
2  * @brief Device configuration settings control messages.
3  * @file
4  ******************************************************************************/
5 
6 #pragma once
7 
11 
12 namespace point_one {
13 namespace fusion_engine {
14 namespace messages {
15 
16 // Enforce 4-byte alignment and packing of all data structures and values.
17 // Floating point values are aligned on platforms that require it. This is done
18 // with a combination of setting struct attributes, and manual alignment
19 // within the definitions. See the "Message Packing" section of the README.
20 #pragma pack(push, 1)
21 
22 /**
23  * @brief An identifier for the contents of a parameter configuration message.
24  * @ingroup config_and_ctrl_messages
25  *
26  * See also @ref SetConfigMessage.
27  */
28 enum class ConfigType : uint16_t {
29  INVALID = 0,
30 
31  /**
32  * The location of the device IMU with respect to the vehicle body frame (in
33  * meters).
34  *
35  * Payload format: @ref Point3f
36  */
37  DEVICE_LEVER_ARM = 16,
38 
39  /**
40  * The orientation of the device IMU with respect to the vehicle body axes.
41  *
42  * Payload format: @ref CoarseOrientation
43  */
45 
46  /**
47  * The location of the GNSS antenna with respect to the vehicle body frame (in
48  * meters).
49  *
50  * Payload format: @ref Point3f
51  */
52  GNSS_LEVER_ARM = 18,
53 
54  /**
55  * The offset of the desired output location with respect to the vehicle
56  * body frame (in meters).
57  *
58  * Payload format: @ref Point3f
59  */
60  OUTPUT_LEVER_ARM = 19,
61 
62  /**
63  * Information about the vehicle including model and dimensions.
64  *
65  * Payload format: @ref VehicleDetails
66  */
67  VEHICLE_DETAILS = 20,
68 
69  /**
70  * Information pertaining to wheel speed/rotation measurements when wheel data
71  * is transmitted via software.
72  *
73  * @note
74  * For hardware wheel tick voltage capture, use @ref
75  * ConfigType::HARDWARE_TICK_CONFIG instead.
76  *
77  * Payload format: @ref WheelConfig
78  */
79  WHEEL_CONFIG = 21,
80 
81  /**
82  * Indicates the mode and direction used when capturing vehicle wheel tick
83  * data from a voltage pulse on an I/O pin.
84  *
85  * @note
86  * For software wheel tick capture (wheel ticks sent as FusionEngine messages
87  * or on a CAN bus), use @ref ConfigType::WHEEL_CONFIG instead.
88  *
89  * Payload format: @ref HardwareTickConfig
90  */
92 
93  /**
94  * Used to set horizontal (yaw) & vertical (pitch) biases (in degrees) on
95  * a dual-antenna heading platform configuration.
96  *
97  * Payload format: @ref HeadingBias
98  */
99  HEADING_BIAS = 23,
100 
101  /**
102  * A bitmask indicating which GNSS constellations are enabled.
103  *
104  * Payload format: `uint32_t` (see @ref sat_type_masks)
105  */
107 
108  /**
109  * A bitmask indicating which GNSS frequency bands are enabled.
110  *
111  * Payload format: `uint32_t` (see @ref freq_band_masks)
112  */
114 
115  /**
116  * Specify a UTC leap second count override value to use for all UTC time
117  * conversions. Setting this value will disable all internal leap second
118  * sources, including data received from the GNSS almanac decoded from
119  * available signals.
120  *
121  * Set to -1 to disable leap second override and re-enable internal leap
122  * second handling.
123  *
124  * Payload format: `int32_t`
125  */
126  LEAP_SECOND = 52,
127 
128  /**
129  * Specify a GPS legacy week rollover count override to use when converting
130  * all legacy 10-bit GPS week numbers. Setting this value will disable all
131  * internal week rollover sources, including data received from modern GPS
132  * navigation messages (CNAV, CNAV2) or non-GPS constellations.
133  *
134  * Set to -1 to disable week rollover override and re-enable internal
135  * handling.
136  *
137  * Payload format: `int32_t`
138  */
139  GPS_WEEK_ROLLOVER = 53,
140 
141  /**
142  * Ionospheric delay model configuration.
143  *
144  * Payload format: @ref IonosphereConfig
145  */
146  IONOSPHERE_CONFIG = 54,
147 
148  /**
149  * Tropospheric delay model configuration.
150  *
151  * Payload format: @ref TroposphereConfig
152  */
153  TROPOSPHERE_CONFIG = 55,
154 
155  /**
156  * Change a configuration setting for a specified output interface.
157  *
158  * Payload format: `InterfaceConfigSubmessage`
159  */
160  INTERFACE_CONFIG = 200,
161 
162  /**
163  * Configure the UART1 serial baud rate (in bits/second).
164  *
165  * @deprecated
166  * The @ref ConfigType::INTERFACE_CONFIG type combined with @ref
167  * InterfaceConfigType::BAUD_RATE in the @ref InterfaceConfigSubmessage should
168  * be used to configure this value going forward.
169  *
170  * Payload format: `uint32_t`
171  */
172  UART1_BAUD = 256,
173 
174  /**
175  * Configure the UART2 serial baud rate (in bits/second).
176  *
177  * @deprecated
178  * The @ref ConfigType::INTERFACE_CONFIG type combined with @ref
179  * InterfaceConfigType::BAUD_RATE in the @ref InterfaceConfigSubmessage should
180  * be used to configure this value going forward.
181  *
182  * Payload format: `uint32_t`
183  */
184  UART2_BAUD = 257,
185 
186  /**
187  * Enable/disable output of diagnostic data on UART1.
188  *
189  * @deprecated
190  * The @ref ConfigType::INTERFACE_CONFIG type combined with @ref
191  * InterfaceConfigType::OUTPUT_DIAGNOSTICS_MESSAGES in the @ref
192  * InterfaceConfigSubmessage should be used to configure this value going
193  * forward.
194  *
195  * @note
196  * Enabling this setting will override the message rate/off settings for some
197  * FusionEngine messages.
198  *
199  * Payload format: `bool`
200  */
202 
203  /**
204  * Enable/disable output of diagnostic data on UART2.
205  *
206  * @deprecated
207  * The @ref ConfigType::INTERFACE_CONFIG type combined with @ref
208  * InterfaceConfigType::OUTPUT_DIAGNOSTICS_MESSAGES in the @ref
209  * InterfaceConfigSubmessage should be used to configure this value going
210  * forward.
211  *
212  * @note
213  * Enabling this setting will override the message rate/off settings for some
214  * FusionEngine messages.
215  *
216  * Payload format: `bool`
217  */
219 
220  /**
221  * Enable watchdog timer to restart device after fatal errors.
222  *
223  * Payload format: `bool`
224  */
225  ENABLE_WATCHDOG_TIMER = 300,
226 
227  /**
228  * A string for identifying a device.
229  *
230  * This is a string of ASCII characters padded to 32 bytes with `NULL`.
231  *
232  * Payload format: `char[32]`
233  */
234  USER_DEVICE_ID = 301,
235 
236  /**
237  * Configuration of L-band Demodulator Parameters.
238  *
239  * @note
240  * This setting is only available on devices with an L-band receiver.
241  *
242  * Payload format: @ref LBandConfig
243  */
244  LBAND_PARAMETERS = 1024,
245 };
246 
247 /**
248  * @brief Get a human-friendly string name for the specified @ref ConfigType.
249  * @ingroup config_and_ctrl_messages
250  *
251  * @param type The desired configuration parameter type.
252  *
253  * @return The corresponding string name.
254  */
256  switch (type) {
257  case ConfigType::INVALID:
258  return "Invalid";
259 
261  return "Device Lever Arm";
262 
264  return "Device Coarse Orientation";
265 
267  return "GNSS Lever Arm";
268 
270  return "Output Lever Arm";
271 
273  return "Vehicle Details";
274 
276  return "Wheel Config";
277 
279  return "Hardware Tick Config";
280 
282  return "Heading Bias";
283 
285  return "Enabled GNSS Systems";
286 
288  return "Enabled GNSS Frequency Bands";
289 
291  return "Leap Second";
292 
294  return "GPS Week Rollover";
295 
297  return "Ionosphere Config";
298 
300  return "Troposphere Config";
301 
303  return "UART1 Baud Rate";
304 
306  return "UART2 Baud Rate";
307 
309  return "UART1 Diagnostic Messages Enabled";
310 
312  return "UART2 Diagnostic Messages Enabled";
313 
315  return "Watchdog Timer Enabled";
316 
318  return "User Device ID";
319 
321  return "Interface Submessage";
322 
324  return "LBand Parameters";
325  }
326 
327  return "Unrecognized Configuration";
328 }
329 
330 /**
331  * @brief @ref ConfigType stream operator.
332  * @ingroup config_and_ctrl_messages
333  */
334 inline p1_ostream& operator<<(p1_ostream& stream, ConfigType type) {
335  stream << to_string(type) << " (" << (int)type << ")";
336  return stream;
337 }
338 
339 /**
340  * @brief An identifier for the contents of a output interface configuration
341  * submessage.
342  * @ingroup config_and_ctrl_messages
343  *
344  * See also @ref InterfaceConfigSubmessage.
345  */
346 enum class InterfaceConfigType : uint8_t {
347  INVALID = 0,
348 
349  /**
350  * Enable/disable output of diagnostic data on this interface.
351  *
352  * Valid for:
353  * - All @ref TransportType
354  *
355  * @note
356  * Enabling this setting will override the message rate/off settings for some
357  * FusionEngine messages.
358  *
359  * Payload format: `bool`
360  */
362 
363  /**
364  * Configure the serial baud rate (in bits/second).
365  *
366  * Valid for:
367  * - @ref TransportType::SERIAL
368  *
369  * Payload format: `uint32_t`
370  */
371  BAUD_RATE = 2,
372 
373  /**
374  * Configure the network address for a client to connect to.
375  *
376  * Valid for:
377  * - @ref TransportType::TCP_CLIENT
378  * - @ref TransportType::UDP_CLIENT
379  *
380  * Payload format: `char[64]` containing a NULL terminated string.
381  */
382  REMOTE_ADDRESS = 3,
383 
384  /**
385  * Configure the network port.
386  *
387  * Valid for:
388  * - @ref TransportType::TCP_CLIENT
389  * - @ref TransportType::TCP_SERVER
390  * - @ref TransportType::UDP_CLIENT
391  * - @ref TransportType::UDP_SERVER
392  * - @ref TransportType::WEBSOCKET_SERVER
393  *
394  * Payload format: `uint16_t`
395  */
396  PORT = 4,
397 };
398 
399 /**
400  * @brief Get a human-friendly string name for the specified @ref ConfigType.
401  * @ingroup config_and_ctrl_messages
402  *
403  * @param type The desired configuration parameter type.
404  *
405  * @return The corresponding string name.
406  */
408  switch (type) {
410  return "Invalid";
411 
413  return "Diagnostic Messages Enabled";
414 
416  return "Serial Baud Rate";
417 
419  return "Remote Network Address";
420 
422  return "Network Port";
423 
424  default:
425  return "Unrecognized Configuration";
426  }
427 }
428 
429 /**
430  * @brief @ref InterfaceConfigType stream operator.
431  * @ingroup config_and_ctrl_messages
432  */
434  stream << to_string(type) << " (" << (int)type << ")";
435  return stream;
436 }
437 
438 /**
439  * @brief The type of a device's configuration settings.
440  * @ingroup config_and_ctrl_messages
441  */
442 enum class ConfigurationSource : uint8_t {
443  ACTIVE = 0, ///< Active configuration currently in use by the device.
444  SAVED = 1, ///< Settings currently saved to persistent storage.
445 };
446 
447 /**
448  * @brief Get a human-friendly string name for the specified @ref
449  * ConfigurationSource.
450  * @ingroup config_and_ctrl_messages
451  *
452  * @param source The desired configuration source.
453  *
454  * @return The corresponding string name.
455  */
457  switch (source) {
459  return "Active";
460 
462  return "Saved";
463 
464  default:
465  return "Unrecognized Source";
466  }
467 }
468 
469 /**
470  * @brief @ref ConfigurationSource stream operator.
471  * @ingroup config_and_ctrl_messages
472  */
474  stream << to_string(source) << " (" << (int)source << ")";
475  return stream;
476 }
477 
478 /**
479  * @brief The type configuration save operation to be performed.
480  * @ingroup config_and_ctrl_messages
481  */
482 enum class SaveAction : uint8_t {
483  /** Save all active parameters to persistent storage. */
484  SAVE = 0,
485  /** Revert the active configuration to previously saved values. */
486  REVERT_TO_SAVED = 1,
487  /** Reset the active _and_ saved configuration to default values. */
488  REVERT_TO_DEFAULT = 2,
489 };
490 
491 /**
492  * @brief Get a human-friendly string name for the specified @ref SaveAction.
493  * @ingroup config_and_ctrl_messages
494  *
495  * @param action The desired save operation.
496  *
497  * @return The corresponding string name.
498  */
500  switch (action) {
501  case SaveAction::SAVE:
502  return "Save";
503 
505  return "Revert To Saved";
506 
508  return "Revert To Default";
509 
510  default:
511  return "Unknown";
512  }
513 }
514 
515 /**
516  * @brief @ref SaveAction stream operator.
517  * @ingroup config_and_ctrl_messages
518  */
519 inline p1_ostream& operator<<(p1_ostream& stream, SaveAction action) {
520  stream << to_string(action) << " (" << (int)action << ")";
521  return stream;
522 }
523 
524 /**
525  * @brief Set a user configuration parameter (@ref MessageType::SET_CONFIG,
526  * version 1.0).
527  * @ingroup config_and_ctrl_messages
528  *
529  * The format of the parameter value is defined by the the specified @ref
530  * config_type (@ref ConfigType). For example, an antenna lever arm definition
531  * may require three 32-bit `float` values, one for each axis, while a serial
532  * port baud rate may be specified as single 32-bit unsigned integer
533  * (`uint32_t`).
534  *
535  * Not all parameters defined in @ref ConfigType are supported on all devices.
536  *
537  * Parameter changes are applied to the device's active configuration
538  * immediately, but are not saved to persistent storage and will be restored to
539  * their previous values on reset. To save configuration settings to persistent
540  * storage, see @ref SaveConfigMessage.
541  *
542  * # Expected Response
543  * The device will respond with a @ref CommandResponseMessage indicating whether
544  * or not the request succeeded.
545  */
547  static constexpr MessageType MESSAGE_TYPE = MessageType::SET_CONFIG;
548  static constexpr uint8_t MESSAGE_VERSION = 0;
549 
550  /** Flag to immediately save the config after applying this setting. */
551  static constexpr uint8_t FLAG_APPLY_AND_SAVE = 0x01;
552  /**
553  * Flag to restore the config_type back to its default value.
554  *
555  * When set, the @ref config_length_bytes should be 0 and no data should be
556  * included unless the config_type is @ref ConfigType::INTERFACE_CONFIG. In
557  * that case the @ref config_length_bytes should be
558  * `sizeof(InterfaceConfigSubmessage)` with a an @ref
559  * InterfaceConfigSubmessage as the parameter value without any further
560  * payload.
561  */
562  static constexpr uint8_t FLAG_REVERT_TO_DEFAULT = 0x02;
563 
564  /** The type of parameter to be configured. */
566 
567  /** Bitmask of additional flags to modify the command. */
568  uint8_t flags = 0;
569 
570  uint8_t reserved[1] = {0};
571 
572  /** The size of the parameter value (in bytes). */
573  uint32_t config_length_bytes = 0;
574 
575  /**
576  * A pointer to the beginning of the configuration parameter value.
577  *
578  * The size and format of the contents is specified by the @ref config_type.
579  * See @ref ConfigType.
580  */
581  // uint8_t config_change_data[0];
582 };
583 
584 /**
585  * @brief Query the value of a user configuration parameter (@ref
586  * MessageType::GET_CONFIG, version 1.1).
587  * @ingroup config_and_ctrl_messages
588  *
589  * # Expected Response
590  * The device will respond with a @ref ConfigResponseMessage containing the
591  * requested parameter value or an error @ref Response value if the request did
592  * not succeed.
593  */
595  static constexpr MessageType MESSAGE_TYPE = MessageType::GET_CONFIG;
596  static constexpr uint8_t MESSAGE_VERSION = 1;
597 
598  /** The desired parameter. */
600 
601  /** The config source to request data from (active, saved, etc.). */
603 
604  uint8_t reserved[1] = {0};
605 
606  /**
607  * When @ref config_type is @ref ConfigType::INTERFACE_CONFIG, a @ref
608  * InterfaceConfigSubmessage must be added to the end of this message with
609  * empty @ref InterfaceConfigSubmessage::config_data.
610  */
611  //uint8_t optional_submessage_header[0];
612 };
613 
614 /**
615  * @brief Save or reload configuration settings (@ref MessageType::SAVE_CONFIG,
616  * version 1.0).
617  * @ingroup config_and_ctrl_messages
618  *
619  * # Expected Response
620  * The device will respond with a @ref CommandResponseMessage indicating whether
621  * or not the request succeeded.
622  */
624  static constexpr MessageType MESSAGE_TYPE = MessageType::SAVE_CONFIG;
625  static constexpr uint8_t MESSAGE_VERSION = 0;
626 
627  /** The action to performed. */
629 
630  uint8_t reserved[3] = {0};
631 };
632 
633 /**
634  * @brief Response to a @ref GetConfigMessage request (@ref
635  * MessageType::CONFIG_RESPONSE, version 1.0).
636  * @ingroup config_and_ctrl_messages
637  *
638  * This message is followed by `N` bytes, where `N` is equal to @ref
639  * config_length_bytes that make up the data associated with @ref config_type.
640  * For example if the @ref config_type is @ref ConfigType::UART1_BAUD, the
641  * payload will include a single 32-bit unsigned integer:
642  *
643  * ```
644  * {MessageHeader, ConfigResponseMessage, uint32_t}
645  * ```
646  *
647  * In response to a @ref GetConfigMessage with an invalid or unsupported @ref
648  * ConfigType, @ref config_type in the resulting @ref ConfigResponseMessage will
649  * be set to @ref ConfigType::INVALID, and @ref response will indicate the
650  * reason. Note that all @ref GetConfigMessage requests, including invalid and
651  * rejected requests, will receive a @ref ConfigResponseMessage, not a
652  * @ref CommandResponseMessage.
653  */
655  static constexpr MessageType MESSAGE_TYPE = MessageType::CONFIG_RESPONSE;
656  static constexpr uint8_t MESSAGE_VERSION = 0;
657 
658  /**
659  * Flag to indicate the active value for this configuration differs from the
660  * value saved to persistent memory.
661  */
662  static constexpr uint8_t FLAG_ACTIVE_DIFFERS_FROM_SAVED = 0x1;
663 
664  /** The source of the parameter value (active, saved, etc.). */
666 
667  /** Flags that describe the configuration parameter. */
668  uint8_t flags = 0;
669 
670  /** The type of configuration parameter contained in this message. */
672 
673  /** The response status (success, error, etc.). */
674  Response response = Response::OK;
675 
676  uint8_t reserved[3] = {0};
677 
678  /** The size of the parameter value (in bytes). */
679  uint32_t config_length_bytes = 0;
680 
681  /**
682  * A pointer to the beginning of the configuration parameter value.
683  *
684  * The size and format of the contents is specified by the @ref config_type.
685  * See @ref ConfigType.
686  */
687  //uint8_t config_change_data[0];
688 };
689 
690 /**************************************************************************/ /**
691  * @defgroup config_types Configuration Settings Type Definitions
692  * @{
693  ******************************************************************************/
694 
695 /**
696  * @brief A 3-dimensional vector (used for lever arms, etc.).
697  */
698 struct P1_ALIGNAS(4) Point3f {
699  float x = NAN;
700  float y = NAN;
701  float z = NAN;
702 };
703 
704 /**
705  * @brief The orientation of a device with respect to the vehicle body axes.
706  *
707  * A device's orientation is defined by specifying how the +x and +z axes of its
708  * IMU are aligned with the vehicle body axes. For example, in a car:
709  * - `forward,up`: device +x = vehicle +x, device +z = vehicle +z (i.e.,
710  * IMU pointed towards the front of the vehicle).
711  * - `left,up`: device +x = vehicle +y, device +z = vehicle +z (i.e., IMU
712  * pointed towards the left side of the vehicle)
713  * - `up,backward`: device +x = vehicle +z, device +z = vehicle -x (i.e.,
714  * IMU pointed vertically upward, with the top of the IMU pointed towards the
715  * trunk)
716  */
718  enum class Direction : uint8_t {
719  FORWARD = 0, ///< Aligned with vehicle +x axis.
720  BACKWARD = 1, ///< Aligned with vehicle -x axis.
721  LEFT = 2, ///< Aligned with vehicle +y axis.
722  RIGHT = 3, ///< Aligned with vehicle -y axis.
723  UP = 4, ///< Aligned with vehicle +z axis.
724  DOWN = 5, ///< Aligned with vehicle -z axis.
725  INVALID = 255
726  };
727 
728  /** The direction of the device +x axis relative to the vehicle body axes. */
729  Direction x_direction = Direction::FORWARD;
730 
731  /** The direction of the device +z axis relative to the vehicle body axes. */
732  Direction z_direction = Direction::UP;
733 
734  uint8_t reserved[2] = {0};
735 };
736 
737 /**
738  * @brief The make and model of the vehicle.
739  * @ingroup config_and_ctrl_messages
740  */
741 enum class VehicleModel : uint16_t {
742  UNKNOWN_VEHICLE = 0,
743  DATASPEED_CD4 = 1,
744  // In general, all J1939 vehicles support a subset of the J1939 standard and
745  // may be set to vehicle model `J1939`. Their 29-bit CAN IDs may differ
746  // based on how the platform assigns message priorities and source
747  // addresses, but the underlying program group number (PGN) and message
748  // contents will be consistent.
749  //
750  // For most vehicles, it is not necessary to specify and particular make and
751  // model.
752  J1939 = 2,
753 
754  LEXUS_CT200H = 20,
755 
756  KIA_SORENTO = 40,
757  KIA_SPORTAGE = 41,
758 
759  AUDI_Q7 = 60,
760  AUDI_A8L = 61,
761 
762  TESLA_MODEL_X = 80,
763  TESLA_MODEL_3 = 81,
764 
765  HYUNDAI_ELANTRA = 100,
766 
767  PEUGEOT_206 = 120,
768 
769  MAN_TGX = 140,
770 
771  FACTION = 160,
772 
773  LINCOLN_MKZ = 180,
774 
775  BMW_7 = 200,
776  BMW_MOTORRAD = 201,
777 
778  VW_4 = 220,
779 
780  RIVIAN = 240,
781 };
782 
783 /**
784  * @brief Get a human-friendly string name for the specified @ref VehicleModel.
785  * @ingroup config_and_ctrl_messages
786  *
787  * @param vehicle_model The desired vehicle model.
788  *
789  * @return The corresponding string name.
790  */
791 P1_CONSTEXPR_FUNC const char* to_string(VehicleModel vehicle_model) {
792  switch (vehicle_model) {
794  return "UNKNOWN";
796  return "DATASPEED_CD4";
797  case VehicleModel::J1939:
798  return "J1939";
800  return "LEXUS_CT200H";
802  return "KIA_SORENTO";
804  return "KIA_SPORTAGE";
806  return "AUDI_Q7";
808  return "AUDI_A8L";
810  return "TESLA_MODEL_X";
812  return "TESLA_MODEL_3";
814  return "HYUNDAI_ELANTRA";
816  return "PEUGEOT_206";
818  return "MAN_TGX";
820  return "FACTION";
822  return "LINCOLN_MKZ";
823  case VehicleModel::BMW_7:
824  return "BMW_7";
826  return "BMW_MOTORRAD";
827  case VehicleModel::VW_4:
828  return "VW_4";
830  return "RIVIAN";
831  default:
832  return "UNRECOGNIZED";
833  }
834 }
835 
836 /**
837  * @brief @ref VehicleModel stream operator.
838  * @ingroup config_and_ctrl_messages
839  */
840 inline p1_ostream& operator<<(p1_ostream& stream, VehicleModel vehicle_model) {
841  stream << to_string(vehicle_model) << " (" << (int)vehicle_model << ")";
842  return stream;
843 }
844 
845 /**
846  * @brief Information about the vehicle including model and dimensions.
847  * @ingroup config_and_ctrl_messages
848  */
851  uint8_t reserved[10] = {0};
852 
853  /** The distance between the front axle and rear axle (in meters). */
854  float wheelbase_m = NAN;
855 
856  /** The distance between the two front wheels (in meters). */
857  float front_track_width_m = NAN;
858 
859  /** The distance between the two rear wheels (in meters). */
860  float rear_track_width_m = NAN;
861 };
862 
863 /**
864  * @brief The type of vehicle/wheel speed measurements produced by the vehicle.
865  * @ingroup config_and_ctrl_messages
866  */
867 enum class WheelSensorType : uint8_t {
868  /** Wheel/vehicle speed data not available. */
869  NONE = 0,
870  // RESERVED = 1,
871  /**
872  * Individual rotational angle measurements for multiple wheels, reported as
873  * accumulated encoder ticks. See @ref WheelTickInput.
874  * */
875  TICKS = 2,
876  /**
877  * Individual speed measurements for multiple wheels, reported in
878  * meters/second. See @ref WheelSpeedInput.
879  */
880  WHEEL_SPEED = 3,
881  /**
882  * A single value indicating the vehicle speed (in meters/second). See @ref
883  * VehicleSpeedInput.
884  */
885  VEHICLE_SPEED = 4,
886  /**
887  * A single wheel rotational angle, reported as accumulated encoder ticks. See
888  * @ref VehicleSpeedInput.
889  */
890  VEHICLE_TICKS = 5,
891 };
892 
893 /**
894  * @brief Get a human-friendly string name for the specified @ref
895  * WheelSensorType.
896  * @ingroup config_and_ctrl_messages
897  *
898  * @param wheel_sensor_type The desired wheel sensor type.
899  *
900  * @return The corresponding string name.
901  */
902 P1_CONSTEXPR_FUNC const char* to_string(WheelSensorType wheel_sensor_type) {
903  switch (wheel_sensor_type) {
904  case WheelSensorType::NONE: {
905  return "None";
906  }
907  case WheelSensorType::TICKS: {
908  return "Ticks";
909  }
911  return "Wheel Speed";
912  }
914  return "Vehicle Speed";
915  }
917  return "Vehicle Ticks";
918  }
919  default: {
920  return "None";
921  }
922  }
923 }
924 
925 /**
926  * @brief @ref WheelSensorType stream operator.
927  * @ingroup config_and_ctrl_messages
928  */
930  WheelSensorType wheel_sensor_type) {
931  stream << to_string(wheel_sensor_type) << " (" << (int)wheel_sensor_type
932  << ")";
933  return stream;
934 }
935 
936 /**
937  * @brief The type of vehicle/wheel speed measurements to be applied.
938  * @ingroup config_and_ctrl_messages
939  */
940 enum class AppliedSpeedType : uint8_t {
941  /** Speed data not applied to the system. */
942  NONE = 0,
943  /** Rear wheel speed data to be applied to the system (recommended). */
944  REAR_WHEELS = 1,
945  /** Front wheel speed data to be applied to the system. */
946  FRONT_WHEELS = 2,
947  /** Front and rear wheel speed data to be applied to the system. */
949  /** Individual vehicle speed to be applied to the system. */
950  VEHICLE_BODY = 4,
951 };
952 
953 /**
954  * @brief Get a human-friendly string name for the specified @ref
955  * AppliedSpeedType.
956  * @ingroup config_and_ctrl_messages
957  *
958  * @param applied_speed_type The desired applied speed type.
959  *
960  * @return The corresponding string name.
961  */
962 P1_CONSTEXPR_FUNC const char* to_string(AppliedSpeedType applied_speed_type) {
963  switch (applied_speed_type) {
964  case AppliedSpeedType::NONE: {
965  return "None";
966  }
968  return "Rear Wheels";
969  }
971  return "Front Wheels";
972  }
974  return "Front and Rear Wheels";
975  }
977  return "Vehicle Body";
978  }
979  default: {
980  return "Unrecognized";
981  }
982  }
983 }
984 
985 /**
986  * @brief @ref AppliedSpeedType stream operator.
987  * @ingroup config_and_ctrl_messages
988  */
990  AppliedSpeedType applied_speed_type) {
991  stream << to_string(applied_speed_type) << " (" << (int)applied_speed_type
992  << ")";
993  return stream;
994 }
995 
996 /**
997  * @brief Indication of which of the vehicle's wheels are steered.
998  * @ingroup config_and_ctrl_messages
999  */
1000 enum class SteeringType : uint8_t {
1001  /** Steered wheels unknown. */
1002  UNKNOWN = 0,
1003  /** Front wheels are steered. */
1004  FRONT = 1,
1005  /** Front and rear wheels are steered. */
1006  FRONT_AND_REAR = 2,
1007 };
1008 
1009 /**
1010  * @brief Get a human-friendly string name for the specified @ref SteeringType.
1011  * @ingroup config_and_ctrl_messages
1012  *
1013  * @param steering_type The desired steering type.
1014  *
1015  * @return The corresponding string name.
1016  */
1017 P1_CONSTEXPR_FUNC const char* to_string(SteeringType steering_type) {
1018  switch (steering_type) {
1019  case SteeringType::UNKNOWN: {
1020  return "Unknown Steering";
1021  }
1022  case SteeringType::FRONT: {
1023  return "Front Steering";
1024  }
1026  return "Front and Rear Steering";
1027  }
1028  default: {
1029  return "Unrecognized";
1030  }
1031  }
1032 }
1033 
1034 /**
1035  * @brief @ref SteeringType stream operator.
1036  * @ingroup config_and_ctrl_messages
1037  */
1038 inline p1_ostream& operator<<(p1_ostream& stream, SteeringType steering_type) {
1039  stream << to_string(steering_type) << " (" << (int)steering_type << ")";
1040  return stream;
1041 }
1042 
1043 /**
1044  * @brief Software vehicle/wheel speed measurement configuration settings.
1045  * @ingroup config_and_ctrl_messages
1046  *
1047  * @warning
1048  * The @ref WheelConfig payload is intended for use on vehicles where wheel
1049  * speed or angle (tick) data is received via software, either using
1050  * FusionEngine measurement messages, or from another software data source such
1051  * as a vehicle CAN bus. For vehicles using a hardware wheel tick voltage
1052  * signal, use @ref HardwareTickConfig instead.
1053  *
1054  * Wheel data may be differential (measurements from each individual wheel), or
1055  * scalar (a single speed measurement for the vehicle body).
1056  *
1057  * When using software wheel data, you must also specify @ref VehicleDetails,
1058  * which is used to describe the vehicle dimensions and make/model.
1059  *
1060  * See also:
1061  * - @ref WheelSpeedInput
1062  * - @ref VehicleSpeedInput
1063  * - @ref WheelTickInput
1064  * - @ref VehicleTickInput
1065  */
1067  /**
1068  * The type of vehicle/wheel speed measurements produced by the vehicle.
1069  */
1071 
1072  /**
1073  * The type of vehicle/wheel speed measurements to be applied to the
1074  * navigation solution.
1075  */
1077 
1078  /** Indication of which of the vehicle's wheels are steered. */
1080 
1081  uint8_t reserved1[1] = {0};
1082 
1083  /**
1084  * The rate at which wheel speed/tick measurements will be sent to the device
1085  * (in seconds).
1086  *
1087  * @note
1088  * This parameter is required when using software wheel measurements. It
1089  * may not be `NAN` if wheel measurements are enabled, and cannot be
1090  * determined automatically by the device.
1091  */
1092  float wheel_update_interval_sec = NAN;
1093 
1094  /**
1095  * Override the rate at which wheel tick measurements will be used by the
1096  * navigation engine (in seconds).
1097  *
1098  * If this parameter is `NAN` (default), the best rate will be selected
1099  * automatically by the device based on the input rate (@ref
1100  * wheel_update_interval_sec) and the wheel tick quantization (@ref
1101  * wheel_ticks_to_m).
1102  *
1103  * @warning
1104  * For most system configurations, we recommend setting this value to `NAN` to
1105  * let the device choose the appropriate setting. Use this setting with
1106  * caution.
1107  */
1108  float wheel_tick_output_interval_sec = NAN;
1109 
1110  /**
1111  * Ratio between angle of the steering wheel and the angle of the wheels on
1112  * the ground.
1113  *
1114  * Used when applying measurements from steered wheels only, ignored
1115  * otherwise.
1116  */
1117  float steering_ratio = NAN;
1118 
1119  /**
1120  * The scale factor to convert from wheel encoder ticks to distance (in
1121  * meters/tick).
1122  *
1123  * Used for @ref WheelSensorType::TICKS and @ref
1124  * WheelSensorType::VEHICLE_TICKS, ignored for wheel speed input.
1125  */
1126  float wheel_ticks_to_m = NAN;
1127 
1128  /**
1129  * The maximum value (inclusive) before the wheel tick measurement will roll
1130  * over.
1131  *
1132  * The rollover behavior depends on the value of @ref wheel_ticks_signed. For
1133  * example, a maximum value of 10 will work as follows:
1134  * - `wheel_ticks_signed == true`: [-11, 10]
1135  * - `wheel_ticks_signed == false`: [0, 10]
1136  *
1137  * Signed values are assumed to be asymmetric, consistent with a typical 2's
1138  * complement rollover.
1139  *
1140  * Used for @ref WheelSensorType::TICKS and @ref
1141  * WheelSensorType::VEHICLE_TICKS, ignored for wheel speed input.
1142  */
1143  uint32_t wheel_tick_max_value = 0;
1144 
1145  /**
1146  * `true` if the reported wheel tick measurements should be interpreted as
1147  * signed integers, or `false` if they should be interpreted as unsigned
1148  * integers.
1149  *
1150  * Used for @ref WheelSensorType::TICKS and @ref
1151  * WheelSensorType::VEHICLE_TICKS, ignored for wheel speed input. See
1152  * @ref wheel_tick_max_value for details.
1153  */
1154  bool wheel_ticks_signed = false;
1155 
1156  /**
1157  * `true` if the wheel tick measurements increase by a positive amount when
1158  * driving forward or backward. `false` if wheel tick measurements decrease
1159  * when driving backward.
1160  *
1161  * Used for @ref WheelSensorType::TICKS and @ref
1162  * WheelSensorType::VEHICLE_TICKS, ignored for wheel speed input.
1163  */
1164  bool wheel_ticks_always_increase = true;
1165 
1166  uint8_t reserved2[2] = {0};
1167 };
1168 
1169 /**
1170  * @brief The signal edge to use when capturing a wheel tick voltage signal.
1171  * @ingroup config_and_ctrl_messages
1172  */
1173 enum class TickMode : uint8_t {
1174  /** Wheel tick capture disabled. */
1175  OFF = 0,
1176  /** Capture a wheel tick on the rising edge of the incoming pulse. */
1177  RISING_EDGE = 1,
1178  /** Capture a wheel tick on the falling edge of the incoming pulse. */
1179  FALLING_EDGE = 2,
1180 };
1181 
1182 P1_CONSTEXPR_FUNC const char* to_string(TickMode tick_mode) {
1183  switch (tick_mode) {
1184  case TickMode::OFF:
1185  return "OFF";
1186  case TickMode::RISING_EDGE:
1187  return "RISING_EDGE";
1189  return "FALLING_EDGE";
1190  default:
1191  return "UNRECOGNIZED";
1192  }
1193 }
1194 
1195 /**
1196  * @brief @ref TickMode stream operator.
1197  * @ingroup config_and_ctrl_messages
1198  */
1199 inline p1_ostream& operator<<(p1_ostream& stream, TickMode tick_mode) {
1200  stream << to_string(tick_mode) << " (" << (int)tick_mode << ")";
1201  return stream;
1202 }
1203 
1204 /**
1205  * @brief The way to interpret an incoming voltage signal, used to indicate
1206  * direction of a hardware wheel tick pulse, if available.
1207  * @ingroup config_and_ctrl_messages
1208  */
1209 enum class TickDirection : uint8_t {
1210  /** Wheel tick direction not provided. */
1211  OFF = 0,
1212  /**
1213  * Assume vehicle is moving forward when direction signal voltage is high, and
1214  * backward when direction signal is low.
1215  */
1216  FORWARD_ACTIVE_HIGH = 1,
1217  /**
1218  * Assume vehicle is moving forward when direction signal voltage is low, and
1219  * backward when direction signal is high.
1220  */
1221  FORWARD_ACTIVE_LOW = 2,
1222 };
1223 
1224 P1_CONSTEXPR_FUNC const char* to_string(TickDirection tick_direction) {
1225  switch (tick_direction) {
1226  case TickDirection::OFF:
1227  return "OFF";
1229  return "FORWARD_ACTIVE_HIGH";
1231  return "FORWARD_ACTIVE_LOW";
1232  default:
1233  return "UNRECOGNIZED";
1234  }
1235 }
1236 
1237 /**
1238  * @brief @ref TickDirection stream operator.
1239  * @ingroup config_and_ctrl_messages
1240  */
1242  TickDirection tick_direction) {
1243  stream << to_string(tick_direction) << " (" << (int)tick_direction << ")";
1244  return stream;
1245 }
1246 
1247 /**
1248  * @brief Hardware wheel tick encoder configuration settings.
1249  * @ingroup config_and_ctrl_messages
1250  *
1251  * @warning
1252  * The @ref HardwareTickConfig payload is intended for use on vehicles with a
1253  * physical voltage signal, generated by a wheel encoder, that produces a series
1254  * of voltage pulses (encoder ticks) as the vehicle’s wheel rotates. These ticks
1255  * will be captured by the device on an input pin and used to indicate vehicle
1256  * speed. For vehicles using software wheel speed/tick information, including
1257  * data send using FusionEngine messages or a vehicle CAN bus, use @ref
1258  * WheelConfig instead.
1259  *
1260  * @note
1261  * In addition to the wheel tick signal, an optional voltage signal may be
1262  * provided to indicate vehicle direction. If this signal is not connected, the
1263  * @ref tick_direction setting MUST be set to `OFF` otherwise there will be
1264  * substantial errors in dead reckoning.
1265  *
1266  * See also @ref VehicleTickInput.
1267  */
1269  /**
1270  * If enabled -- tick mode is not @ref TickMode::OFF -- the device will
1271  * accumulate ticks received on the I/O pin, and use them as an indication of
1272  * vehicle speed. If enabled, you must also specify @ref wheel_ticks_to_m to
1273  * indicate the mapping of wheel tick encoder angle to tire circumference. All
1274  * other wheel tick-related parameters such as tick capture rate, rollover
1275  * value, etc. will be set internally.
1276  *
1277  * @warning
1278  * Do not enable this feature if a wheel tick voltage signal is not present.
1279  */
1281 
1282  /**
1283  * When direction is @ref TickDirection::OFF, the incoming ticks will be
1284  * treated as unsigned, meaning the tick count will continue to increase in
1285  * either direction of travel. If direction is not @ref TickDirection::OFF,
1286  * a second direction I/O pin will be used to indicate the direction of
1287  * travel and the accumulated tick count will increase/decrease accordingly.
1288  */
1290 
1291  uint8_t reserved1[2] = {0};
1292 
1293  /**
1294  * The scale factor to convert from wheel encoder ticks to distance (in
1295  * meters/tick). Used for @ref WheelSensorType::TICKS.
1296  */
1297  float wheel_ticks_to_m = NAN;
1298 };
1299 
1300 /**
1301  * @brief Heading bias horizontal/vertical configuration settings.
1302  * @ingroup config_and_ctrl_messages
1303  *
1304  * @note
1305  * Both HeadingBias values must be set for the system to use them.
1306  * If one value is NOT set, the system will not output the corrected
1307  * heading message.
1308  *
1309  * @ref HeadingOutput
1310  */
1312  /**
1313  * The offset between the heading measured by a secondary GNSS device and the
1314  * vehicle's direction of motion in the horizontal plane (defined by the
1315  * vehicle's forward and left axes).
1316  *
1317  * Bias is defined as the angle between the vector pointing from the primary
1318  * GNSS antenna to the secondary heading antenna, and the vector pointing from
1319  * the primary antenna pointing in the forward direction of the vehicle. A
1320  * positive angle means the secondary antenna is offset in a counter-clockwise
1321  * direction from the forward vector (positive yaw rotation).
1322  *
1323  * For example, if the primary antenna is in the back of the vehicle and the
1324  * secondary antenna is in the front, a positive angle would indicate that the
1325  * secondary antenna is offset to the left side of the vehicle.
1326  */
1327  float horizontal_bias_deg = NAN;
1328 
1329  /**
1330  * The offset between the heading measured by a secondary GNSS device and the
1331  * vehicle's direction of motion in the vertical plane (defined by the
1332  * vehicle's forward and up axes).
1333  *
1334  * A positive angle means the secondary antenna is offset in the downward
1335  * direction. For example, if the primary antenna is in the back of the
1336  * vehicle and the secondary antenna is in the front, a positive angle would
1337  * indicate that the secondary antenna is mounted below the primary antenna.
1338  */
1339  float vertical_bias_deg = NAN;
1340 };
1341 
1342 /**
1343  * @brief The ionospheric delay model to use.
1344  * @ingroup config_and_ctrl_messages
1345  */
1346 enum class IonoDelayModel : uint8_t {
1347  /** Select the best available ionospheric delay model. */
1348  AUTO = 0,
1349  /** Ionospheric delay model disabled. */
1350  OFF = 1,
1351  /** Use the Klobuchar ionospheric model. */
1352  KLOBUCHAR = 2,
1353 };
1354 
1355 P1_CONSTEXPR_FUNC const char* to_string(IonoDelayModel iono_delay_model) {
1356  switch (iono_delay_model) {
1357  case IonoDelayModel::AUTO:
1358  return "AUTO";
1359  case IonoDelayModel::OFF:
1360  return "OFF";
1362  return "KLOBUCHAR";
1363  default:
1364  return "UNRECOGNIZED";
1365  }
1366 }
1367 
1368 /**
1369  * @brief @ref IonoDelayModel stream operator.
1370  * @ingroup config_and_ctrl_messages
1371  */
1373  IonoDelayModel iono_delay_model) {
1374  stream << to_string(iono_delay_model) << " (" << (int)iono_delay_model << ")";
1375  return stream;
1376 }
1377 
1378 /**
1379  * @brief Ionospheric delay model configuration.
1380  * @ingroup config_and_ctrl_messages
1381  */
1383  /** The ionospheric delay model to use. */
1385 
1386  uint8_t reserved[3] = {0};
1387 };
1388 
1389 /**
1390  * @brief The tropospheric delay model to use.
1391  * @ingroup config_and_ctrl_messages
1392  */
1393 enum class TropoDelayModel : uint8_t {
1394  /** Select the best available tropospheric delay model. */
1395  AUTO = 0,
1396  /** Tropospheric delay model disabled. */
1397  OFF = 1,
1398  /** Use the Saastamoinen tropospheric model. */
1399  SAASTAMOINEN = 2,
1400 };
1401 
1402 P1_CONSTEXPR_FUNC const char* to_string(TropoDelayModel tropo_delay_model) {
1403  switch (tropo_delay_model) {
1404  case TropoDelayModel::AUTO:
1405  return "AUTO";
1406  case TropoDelayModel::OFF:
1407  return "OFF";
1409  return "SAASTAMOINEN";
1410  default:
1411  return "UNRECOGNIZED";
1412  }
1413 }
1414 
1415 /**
1416  * @brief @ref TropoDelayModel stream operator.
1417  * @ingroup config_and_ctrl_messages
1418  */
1420  TropoDelayModel tropo_delay_model) {
1421  stream << to_string(tropo_delay_model) << " (" << (int)tropo_delay_model
1422  << ")";
1423  return stream;
1424 }
1425 
1426 /**
1427  * @brief Tropospheric delay model configuration.
1428  * @ingroup config_and_ctrl_messages
1429  */
1431  /** The tropospheric delay model to use. */
1433 
1434  uint8_t reserved[3] = {0};
1435 };
1436 
1437 /**
1438  * @brief Configuration of the L-band demodulator parameters.
1439  * @ingroup config_and_ctrl_messages
1440  */
1442  /**
1443  * The center frequency of the L-band beam (Hz).
1444  */
1445  double center_frequency_hz = 1555492500.0;
1446 
1447  /**
1448  * The size of the signal acquisition search space (in Hz) around the center
1449  * frequency.
1450  *
1451  * For example, a value of 6000 will search +/- 3 kHz around the center
1452  * frequency.
1453  */
1454  float search_window_hz = 2000.0;
1455 
1456  /**
1457  * If `true`, only output data frames with the configured service ID.
1458  * Otherwise, output all decoded frames.
1459  */
1460  bool filter_data_by_service_id = true;
1461 
1462  /** Enable/disable the descrambler. */
1463  bool use_descrambler = true;
1464 
1465  /** Service ID of the provider. */
1466  uint16_t pmp_service_id = 0x5555;
1467 
1468  /** Unique word of the provider. */
1469  uint64_t pmp_unique_word = 0xE15AE893E15AE893ull;
1470 
1471  /** Data rate of the provider (bps). */
1472  uint16_t pmp_data_rate_bps = 4800;
1473 
1474  /** The initialization value for the descrambling vector. */
1475  uint16_t descrambler_init = 0x6969;
1476 };
1477 
1478 /** @} */
1479 
1480 /**************************************************************************/ /**
1481  * @name Input/Output Stream Control
1482  * @{
1483  ******************************************************************************/
1484 
1485 /**
1486  * @brief The framing protocol of a message.
1487  */
1488 enum class ProtocolType : uint8_t {
1489  INVALID = 0,
1490  FUSION_ENGINE = 1,
1491  NMEA = 2,
1492  RTCM = 3,
1493  /** This is used for requesting the configuration for all protocols. */
1494  ALL = 0xFF,
1495 };
1496 
1497 /** Setting message_id to this value acts as a wild card. */
1498 constexpr uint16_t ALL_MESSAGES_ID = 0xFFFF;
1499 
1500 /**
1501  * @brief Get a human-friendly string name for the specified @ref
1502  * ProtocolType.
1503  * @ingroup config_and_ctrl_messages
1504  *
1505  * @param val The enum to get the string name for.
1506  *
1507  * @return The corresponding string name.
1508  */
1510  switch (val) {
1511  case ProtocolType::INVALID:
1512  return "Invalid";
1514  return "FusionEngine";
1515  case ProtocolType::NMEA:
1516  return "NMEA";
1517  case ProtocolType::RTCM:
1518  return "RTCM";
1519  case ProtocolType::ALL:
1520  return "ALL";
1521  default:
1522  return "Unrecognized";
1523  }
1524 }
1525 
1526 /**
1527  * @brief @ref ProtocolType stream operator.
1528  * @ingroup config_and_ctrl_messages
1529  */
1531  stream << to_string(val) << " (" << (int)val << ")";
1532  return stream;
1533 }
1534 
1535 /**
1536  * @brief Type of I/O interface transport.
1537  */
1538 enum class TransportType : uint8_t {
1539  INVALID = 0,
1540  /** A serial data interface (e.g. an RS232 connection). */
1541  SERIAL = 1,
1542  /** A interface that writes to a file. */
1543  FILE = 2,
1544  /** An interface that will try to connect to a remote TCP server. */
1545  TCP_CLIENT = 3,
1546  /** An interface that will communicate with connected clients. */
1547  TCP_SERVER = 4,
1548  /** An interface that will try to connect to a remote UDP server. */
1549  UDP_CLIENT = 5,
1550  /** An interface that will communicate with connected clients. */
1551  UDP_SERVER = 6,
1552  /** An interface that will communicate with connected clients. */
1553  WEBSOCKET_SERVER = 7,
1554  /**
1555  * Set/get the configuration for the interface on which the command was
1556  * received.
1557  */
1558  CURRENT = 254,
1559  /** Set/get the configuration for the all I/O interfaces. */
1560  ALL = 255,
1561 };
1562 
1563 /**
1564  * @brief Get a human-friendly string name for the specified @ref
1565  * TransportType.
1566  * @ingroup config_and_ctrl_messages
1567  *
1568  * @param val The enum to get the string name for.
1569  *
1570  * @return The corresponding string name.
1571  */
1573  switch (val) {
1575  return "Invalid";
1576  case TransportType::SERIAL:
1577  return "Serial";
1578  case TransportType::FILE:
1579  return "File";
1581  return "TCP Client";
1583  return "TCP Server";
1585  return "UDP Client";
1587  return "UDP Server";
1589  return "Websocket Server";
1591  return "Current";
1592  case TransportType::ALL:
1593  return "All";
1594  }
1595  return "Unrecognized";
1596 }
1597 
1598 /**
1599  * @brief @ref TransportType stream operator.
1600  * @ingroup config_and_ctrl_messages
1601  */
1603  stream << to_string(val) << " (" << (int)val << ")";
1604  return stream;
1605 }
1606 
1607 /**
1608  * @brief Identifies an I/O interface.
1609  *
1610  * For example, serial port 1 or TCP server 2.
1611  *
1612  * @note
1613  * On most devices, serial ports (UARTs) use 1-based numbering: the first serial
1614  * port is typically index 1 (UART1).
1615  */
1617  /** The interface's transport type. **/
1619  /** An identifier for the instance of this transport. */
1620  uint8_t index = 0;
1621  uint8_t reserved[2] = {0};
1622 
1624 
1625  P1_CONSTEXPR_FUNC explicit InterfaceID(TransportType type, uint8_t index = 0)
1626  : type(type), index(index) {}
1627 
1628  P1_CONSTEXPR_FUNC bool operator==(const InterfaceID& other) const {
1629  return type == other.type && index == other.index;
1630  }
1631 
1632  P1_CONSTEXPR_FUNC bool operator!=(const InterfaceID& other) const {
1633  return !(*this == other);
1634  }
1635 
1636  P1_CONSTEXPR_FUNC bool operator<(const InterfaceID& other) const {
1637  if (type == other.type) {
1638  return index < other.index;
1639  } else {
1640  return type < other.type;
1641  }
1642  }
1643 
1644  P1_CONSTEXPR_FUNC bool operator>(const InterfaceID& other) const {
1645  return other < *this;
1646  }
1647 
1648  P1_CONSTEXPR_FUNC bool operator>=(const InterfaceID& other) const {
1649  return !(*this < other);
1650  }
1651 
1652  P1_CONSTEXPR_FUNC bool operator<=(const InterfaceID& other) const {
1653  return !(*this > other);
1654  }
1655 };
1656 
1657 /**
1658  * @brief @ref InterfaceID stream operator.
1659  * @ingroup config_and_ctrl_messages
1660  */
1662  stream << "[type=" << val.type << ", index=" << (int)val.index << "]";
1663  return stream;
1664 }
1665 
1666 /**
1667  * @brief Integer ID for NMEA messages.
1668  */
1669 enum class NmeaMessageType : uint16_t {
1670  INVALID = 0,
1671 
1672  /**
1673  * @name Standard NMEA Messages
1674  * @{
1675  */
1676  GGA = 1,
1677  GLL = 2,
1678  GSA = 3,
1679  GSV = 4,
1680  RMC = 5,
1681  VTG = 6,
1682  /** @} */
1683 
1684  /**
1685  * @name Point One Proprietary Messages
1686  * @{
1687  */
1688  P1CALSTATUS = 1000,
1689  P1MSG = 1001,
1690  /** @} */
1691 
1692  /**
1693  * @name Quectel Proprietary Messages
1694  * @{
1695  */
1696  PQTMVERNO = 1200,
1697  PQTMVER = 1201,
1698  PQTMGNSS = 1202,
1699  PQTMVERNO_SUB = 1203,
1700  PQTMVER_SUB = 1204,
1701  PQTMTXT = 1205,
1702  /** @} */
1703 };
1704 
1705 /**
1706  * @brief Get a human-friendly string name for the specified @ref
1707  * NmeaMessageType.
1708  * @ingroup config_and_ctrl_messages
1709  *
1710  * @param value The enum to get the string name for.
1711  *
1712  * @return The corresponding string name.
1713  */
1715  switch (value) {
1717  return "INVALID";
1718  case NmeaMessageType::GGA:
1719  return "GGA";
1720  case NmeaMessageType::GLL:
1721  return "GLL";
1722  case NmeaMessageType::GSA:
1723  return "GSA";
1724  case NmeaMessageType::GSV:
1725  return "GSV";
1726  case NmeaMessageType::RMC:
1727  return "RMC";
1728  case NmeaMessageType::VTG:
1729  return "VTG";
1731  return "P1CALSTATUS";
1733  return "P1MSG";
1735  return "PQTMVERNO";
1737  return "PQTMVER";
1739  return "PQTMGNSS";
1741  return "PQTMVERNO_SUB";
1743  return "PQTMVER_SUB";
1745  return "PQTMTXT";
1746  default:
1747  return "Unrecognized";
1748  }
1749 }
1750 
1751 /**
1752  * @brief @ref NmeaMessageType stream operator.
1753  * @ingroup config_and_ctrl_messages
1754  */
1756  stream << to_string(val) << " (" << (int)val << ")";
1757  return stream;
1758 }
1759 
1760 /**
1761  * @brief The output rate for a message type on an interface.
1762  */
1763 enum class MessageRate : uint8_t {
1764  /**
1765  * Disable output of this message.
1766  */
1767  OFF = 0,
1768  /**
1769  * Output this message each time a new value is available.
1770  */
1771  ON_CHANGE = 1,
1772  /** Alias for @ref MessageRate::ON_CHANGE. */
1773  MAX_RATE = 1,
1774  /**
1775  * Output this message every 10 milliseconds. Not supported for all messages
1776  * or platforms.
1777  */
1778  INTERVAL_10_MS = 2,
1779  /**
1780  * Output this message every 20 milliseconds. Not supported for all messages
1781  * or platforms.
1782  */
1783  INTERVAL_20_MS = 3,
1784  /**
1785  * Output this message every 40 milliseconds. Not supported for all messages
1786  * or platforms.
1787  */
1788  INTERVAL_40_MS = 4,
1789  /**
1790  * Output this message every 50 milliseconds. Not supported for all messages
1791  * or platforms.
1792  */
1793  INTERVAL_50_MS = 5,
1794  /**
1795  * Output this message every 100 milliseconds. Not supported for all messages
1796  * or platforms.
1797  */
1798  INTERVAL_100_MS = 6,
1799  /**
1800  * Output this message every 200 milliseconds. Not supported for all messages
1801  * or platforms.
1802  */
1803  INTERVAL_200_MS = 7,
1804  /**
1805  * Output this message every 500 milliseconds. Not supported for all messages
1806  * or platforms.
1807  */
1808  INTERVAL_500_MS = 8,
1809  /**
1810  * Output this message every second. Not supported for all messages or
1811  * platforms.
1812  */
1813  INTERVAL_1_S = 9,
1814  /**
1815  * Output this message every 2 seconds. Not supported for all messages or
1816  * platforms.
1817  */
1818  INTERVAL_2_S = 10,
1819  /**
1820  * Output this message every 5 seconds. Not supported for all messages or
1821  * platforms.
1822  */
1823  INTERVAL_5_S = 11,
1824  /**
1825  * Output this message every 10 seconds. Not supported for all messages or
1826  * platforms.
1827  */
1828  INTERVAL_10_S = 12,
1829  /**
1830  * Output this message every 30 seconds. Not supported for all messages or
1831  * platforms.
1832  */
1833  INTERVAL_30_S = 13,
1834  /**
1835  * Output this message every 60 seconds. Not supported for all messages or
1836  * platforms.
1837  */
1838  INTERVAL_60_S = 14,
1839  /**
1840  * Restore this message's rate back to its default value.
1841  */
1842  DEFAULT = 255
1843 };
1844 
1845 /**
1846  * @brief Get a human-friendly string name for the specified @ref
1847  * MessageRate.
1848  * @ingroup config_and_ctrl_messages
1849  *
1850  * @param value The enum to get the string name for.
1851  *
1852  * @return The corresponding string name.
1853  */
1855  switch (value) {
1856  case MessageRate::OFF:
1857  return "OFF";
1859  return "ON_CHANGE";
1861  return "INTERVAL_10_MS";
1863  return "INTERVAL_20_MS";
1865  return "INTERVAL_40_MS";
1867  return "INTERVAL_50_MS";
1869  return "INTERVAL_100_MS";
1871  return "INTERVAL_200_MS";
1873  return "INTERVAL_500_MS";
1875  return "INTERVAL_1_S";
1877  return "INTERVAL_2_S";
1879  return "INTERVAL_5_S";
1881  return "INTERVAL_10_S";
1883  return "INTERVAL_30_S";
1885  return "INTERVAL_60_S";
1886  case MessageRate::DEFAULT:
1887  return "DEFAULT";
1888  default:
1889  return "Unrecognized";
1890  }
1891 }
1892 
1893 /**
1894  * @brief @ref MessageRate stream operator.
1895  * @ingroup config_and_ctrl_messages
1896  */
1898  stream << to_string(val) << " (" << (int)val << ")";
1899  return stream;
1900 }
1901 
1902 /**
1903  * @brief Set the output rate for the requested message types (@ref
1904  * MessageType::SET_MESSAGE_RATE, version 1.0).
1905  *
1906  * Multiple message rates can be configured with a single command if wild cards
1907  * are used for the interface, protocol, or message ID. When multiple messages
1908  * are specified, the following behaviors apply:
1909  * - Messages that are currently @ref MessageRate::OFF will not be changed
1910  * unless the @ref FLAG_INCLUDE_DISABLED_MESSAGES bit is set in the @ref flags
1911  * or the new rate is @ref MessageRate::DEFAULT.
1912  * - If the rate is an interval, it will only affect the messages that support
1913  * being rate controlled.
1914  *
1915  * Setting all the messages on an interface to @ref MessageRate::DEFAULT will
1916  * also restore the default `*_OUTPUT_DIAGNOSTICS_MESSAGES` configuration option
1917  * value for that interface. See @ref ConfigType.
1918  *
1919  * @note
1920  * When specifying @ref ProtocolType::ALL, message ID @ref ALL_MESSAGES_ID must
1921  * also be specified. Further, the rate must be set to either
1922  * @ref MessageRate::OFF or @ref MessageRate::DEFAULT.
1923  *
1924  * @section set_rate_examples Typical Use Cases
1925  *
1926  * @subsection set_rate_restore Restore Default Settings For All Messages
1927  *
1928  * To restore the default configuration on UART1 for all message types across all
1929  * supported protocols, specify the following:
1930  * - Interface transport type: @ref TransportType::SERIAL
1931  * - Interface index: 1
1932  * - Protocol: @ref ProtocolType::ALL
1933  * - Message ID: @ref ALL_MESSAGES_ID
1934  * - Rate: @ref MessageRate::DEFAULT
1935  *
1936  * @subsection set_rate_restore_nmea Restore Default Settings For All NMEA
1937  *
1938  * To restore the default configuration on UART1 for all NMEA message types,
1939  * specify the following:
1940  * - Interface transport type: @ref TransportType::SERIAL
1941  * - Interface index: 1
1942  * - Protocol: @ref ProtocolType::NMEA
1943  * - Message ID: @ref ALL_MESSAGES_ID
1944  * - Rate: @ref MessageRate::DEFAULT
1945  *
1946  * @subsection set_rate_change_nmea Change UART1 Output Rate To 1 Hz:
1947  *
1948  * To change the rate of all NMEA message types to 1 Hz on UART1, specify the
1949  * following:
1950  * - Interface transport type: @ref TransportType::SERIAL
1951  * - Interface index: 1
1952  * - Protocol: @ref ProtocolType::NMEA
1953  * - Message ID: @ref ALL_MESSAGES_ID
1954  * - Rate: @ref MessageRate::INTERVAL_1_S
1955  *
1956  * @note
1957  * Note that this will not affect any message types that are not rate controlled
1958  * (e.g., @ref MessageType::EVENT_NOTIFICATION).
1959  *
1960  * @subsection set_rate_off_all Change The Uart1 Output Rates For All Messages To Be Off:
1961  *
1962  * To change the rate of all messages to their max rate on UART1, specify the
1963  * following:
1964  * - Interface transport type: @ref TransportType::SERIAL
1965  * - Interface index: 1
1966  * - Protocol: @ref ProtocolType::ALL
1967  * - flags: @ref FLAG_INCLUDE_DISABLED_MESSAGES
1968  * - Message ID: @ref ALL_MESSAGES_ID
1969  * - Rate: @ref MessageRate::OFF
1970  *
1971  * @note
1972  * This will disable every message.
1973  *
1974  * @subsection set_and_save_rate_off_all Change And Save The UART1 Output Rates For All Messages To Be Off:
1975  *
1976  * To change the rate of all messages to their max rate on UART1, specify the
1977  * following:
1978  * - Interface transport type: @ref TransportType::SERIAL
1979  * - Interface index: 1
1980  * - Protocol: @ref ProtocolType::ALL
1981  * - flags: 0x03 (@ref FLAG_INCLUDE_DISABLED_MESSAGES | @ref FLAG_APPLY_AND_SAVE)
1982  * - Message ID: @ref ALL_MESSAGES_ID
1983  * - Rate: @ref MessageRate::OFF
1984  *
1985  * @note
1986  * Both of the bit flags are set for this message. This will cause the
1987  * configuration to be saved to non-volatile memory.
1988  *
1989  * @ingroup config_and_ctrl_messages
1990  *
1991  * # Expected Response
1992  * The device will respond with a @ref CommandResponseMessage indicating whether
1993  * or not the request succeeded.
1994  */
1996  static constexpr MessageType MESSAGE_TYPE = MessageType::SET_MESSAGE_RATE;
1997  static constexpr uint8_t MESSAGE_VERSION = 0;
1998 
1999  /** Flag to immediately save the config after applying this setting. */
2000  static constexpr uint8_t FLAG_APPLY_AND_SAVE = 0x01;
2001 
2002  /**
2003  * Flag to apply bulk interval changes to all messages instead of just
2004  * enabled messages.
2005  */
2006  static constexpr uint8_t FLAG_INCLUDE_DISABLED_MESSAGES = 0x02;
2007 
2008  /**
2009  * The output interface to configure. If @ref TransportType::ALL, set rates on
2010  * all supported interfaces.
2011  */
2013 
2014  /**
2015  * The message protocol being configured. If @ref ProtocolType::ALL, set rates
2016  * on all supported protocols.
2017  */
2019 
2020  /** Bitmask of additional flags to modify the command. */
2021  uint8_t flags = 0;
2022 
2023  /**
2024  * The ID of the desired message type (e.g., 10000 for FusionEngine
2025  * @ref MessageType::POSE messages). See @ref NmeaMessageType for NMEA-0183
2026  * messages. If @ref ALL_MESSAGES_ID, set the rate for all messages on the
2027  * selected interface and protocol.
2028  */
2029  uint16_t message_id = ALL_MESSAGES_ID;
2030 
2031  /** The desired message rate. */
2033 
2034  uint8_t reserved2[3] = {0};
2035 };
2036 
2037 /**
2038  * @brief Get the configured output rate for the he requested message type on
2039  * the specified interface (@ref MessageType::GET_MESSAGE_RATE,
2040  * version 1.0).
2041  * @ingroup config_and_ctrl_messages
2042  *
2043  * Multiple message rates can be requested with a single command if wild cards
2044  * are used for the protocol, or message ID.
2045  *
2046  * # Expected Response
2047  * The device will respond with a @ref MessageRateResponse containing the
2048  * requested values or an error @ref Response value if the request did not
2049  * succeed.
2050  */
2052  static constexpr MessageType MESSAGE_TYPE = MessageType::GET_MESSAGE_RATE;
2053  static constexpr uint8_t MESSAGE_VERSION = 0;
2054 
2055  /**
2056  * The output interface to be queried.
2057  *
2058  * @ref TransportType::ALL is not supported. To query for multiple transports,
2059  * send separate requests.
2060  */
2062 
2063  /**
2064  * The desired message protocol. If @ref ProtocolType::ALL, return the current
2065  * settings for all supported protocols.
2066  */
2068 
2069  /** The source of the parameter value (active, saved, etc.). */
2071 
2072  /**
2073  * The ID of the desired message type (e.g., 10000 for FusionEngine
2074  * @ref MessageType::POSE messages). See @ref NmeaMessageType for NMEA-0183
2075  * messages. If @ref ALL_MESSAGES_ID, return the current settings for all
2076  * supported messages on the selected interface and protocol.
2077  */
2078  uint16_t message_id = ALL_MESSAGES_ID;
2079 };
2080 
2081 /**
2082  * @brief A list of transport interfaces supported by the device (@ref
2083  * MessageType::SUPPORTED_IO_INTERFACES, version 1.0).
2084  * @ingroup config_and_ctrl_messages
2085  */
2087  static constexpr MessageType MESSAGE_TYPE =
2089  static constexpr uint8_t MESSAGE_VERSION = 0;
2090 
2091  /** The number of interfaces reported by this message. */
2092  uint8_t num_interfaces = 0;
2093 
2094  uint8_t reserved1[7] = {0};
2095 
2096  /** This in then followed by an array of `num_interfaces` @ref InterfaceID. */
2097  // InterfaceID interfaces[num_interfaces]
2098 };
2099 
2100 /**
2101  * @brief An element of a @ref MessageRateResponse message.
2102  * @ingroup config_and_ctrl_messages
2103  */
2105  /**
2106  * Flag to indicate the active value for this configuration differs from the
2107  * value saved to persistent memory.
2108  */
2109  static constexpr uint8_t FLAG_ACTIVE_DIFFERS_FROM_SAVED = 0x1;
2110 
2111  /** The protocol of the message being returned. */
2113 
2114  /** Flags that describe the entry. */
2115  uint8_t flags = 0;
2116 
2117  /**
2118  * The ID of the returned message type (e.g., 10000 for FusionEngine
2119  * @ref MessageType::POSE messages). See @ref NmeaMessageType for NMEA-0183
2120  * messages.
2121  */
2122  uint16_t message_id = 0;
2123 
2124  /** The current configuration for this message. */
2125  MessageRate configured_rate = MessageRate::OFF;
2126 
2127  /**
2128  * The currently active output rate for this message, factoring in effects of
2129  * additional configuration settings that may override the configured rate
2130  * such as enabling diagnostic output.
2131  */
2132  MessageRate effective_rate = MessageRate::OFF;
2133 
2134  uint8_t reserved1[2] = {0};
2135 };
2136 
2137 /**
2138  * @brief Response to a @ref GetMessageRate request (@ref
2139  * MessageType::MESSAGE_RATE_RESPONSE, version 1.1).
2140  * @ingroup config_and_ctrl_messages
2141  */
2143  static constexpr MessageType MESSAGE_TYPE =
2145  static constexpr uint8_t MESSAGE_VERSION = 1;
2146 
2147  /** The source of the parameter value (active, saved, etc.). */
2149 
2150  /** The response status (success, error, etc.). */
2152 
2153  /** The number of rates reported by this message. */
2154  uint16_t num_rates = 0;
2155 
2156  /** The output interface corresponding with this response. */
2157  InterfaceID output_interface = {};
2158 
2159  /**
2160  * This in then followed by an array of num_rates MessageRateResponseEntry.
2161  */
2162  // MessageRateResponseEntry rates[num_rates]
2163 };
2164 
2165 /** Type of data stored on device. */
2166 enum class DataType : uint8_t {
2167  CALIBRATION_STATE = 0,
2168  CRASH_LOG = 1,
2169  FILTER_STATE = 2,
2170  USER_CONFIG = 3,
2171  INVALID = 255
2172 };
2173 
2174 /**
2175  * @brief Get a string representation of a @ref DataType.
2176  *
2177  * @param type The requested type.
2178  *
2179  * @return The corresponding string name.
2180  */
2182  switch (type) {
2184  return "CalibrationState";
2185  case DataType::CRASH_LOG:
2186  return "CrashLog";
2188  return "FilterState";
2189  case DataType::USER_CONFIG:
2190  return "UserConfig";
2191  default:
2192  return "Invalid";
2193  }
2194 }
2195 
2196 /**
2197  * @brief @ref DataType stream operator.
2198  * @ingroup config_and_ctrl_messages
2199  */
2200 inline p1_ostream& operator<<(p1_ostream& stream, DataType val) {
2201  stream << to_string(val) << " (" << (int)val << ")";
2202  return stream;
2203 }
2204 
2205 /**
2206  * @brief Import data from the host to the device (@ref
2207  * MessageType::IMPORT_DATA, version 1.0).
2208  * @ingroup config_and_ctrl_messages
2209  *
2210  * # Expected Response
2211  * The device will respond with a @ref CommandResponseMessage indicating whether
2212  * or not the request succeeded.
2213  */
2215  static constexpr MessageType MESSAGE_TYPE = MessageType::IMPORT_DATA;
2216  static constexpr uint8_t MESSAGE_VERSION = 0;
2217  /**
2218  * The type of data being imported.
2219  */
2221  /**
2222  * The location of the data to update (active, saved, etc.). For data that
2223  * doesn't have separate active and saved copies, this parameter is ignored.
2224  */
2226  uint8_t reserved1[2] = {0};
2227  /** @brief Version of data contents. */
2229  uint8_t reserved2[4] = {0};
2230  /** @brief Number of bytes to update. */
2231  uint32_t data_length_bytes = 0;
2232 
2233  /**
2234  * This in then followed by an array of data_length_bytes bytes for the data
2235  * contents.
2236  */
2237  // uint8_t data[data_length_bytes]
2238 };
2239 
2240 /**
2241  * @brief Export data from the device (@ref
2242  * MessageType::EXPORT_DATA, version 1.0).
2243  * @ingroup config_and_ctrl_messages
2244  *
2245  * # Expected Response
2246  * The device will respond with a @ref PlatformStorageDataMessage.
2247  */
2249  static constexpr MessageType MESSAGE_TYPE = MessageType::EXPORT_DATA;
2250  static constexpr uint8_t MESSAGE_VERSION = 0;
2251  /**
2252  * The type of data to be exported.
2253  */
2255  /**
2256  * The source to copy this data from. If the data_type doesn't separate active
2257  * and saved data, this will be ignored.
2258  */
2260  uint8_t reserved[2] = {0};
2261 };
2262 
2263 /**
2264  * @brief Message for reporting platform storage data (@ref
2265  * MessageType::PLATFORM_STORAGE_DATA, version 1.0).
2266  * @ingroup config_and_ctrl_messages
2267  *
2268  * See also @ref ExportDataMessage.
2269  *
2270  * Changes:
2271  * - Version 1: Added data_validity field.
2272  * - Version 2: Changed data_validity to a @ref Response enum and added
2273  * @ref source field.
2274  */
2276  static constexpr MessageType MESSAGE_TYPE =
2278  static constexpr uint8_t MESSAGE_VERSION = 2;
2279 
2280  /**
2281  * The type of data contained in this message.
2282  */
2284  /**
2285  * The status of the specified data type on the device.
2286  */
2288  /**
2289  * The source this data was copied from. If the @ref data_type doesn't separate
2290  * active and saved data, this will be set to @ref
2291  * ConfigurationSource::ACTIVE.
2292  */
2294  uint8_t reserved[1] = {0};
2295  /** Version of data contents. */
2297  /** Number of bytes in data contents. */
2298  uint32_t data_length_bytes = 0;
2299  /**
2300 
2301  * This in then followed by an array of data_length_bytes bytes for the data
2302  * contents.
2303  */
2304  // uint8_t data[data_length_bytes]
2305 };
2306 
2307 /**
2308  * @brief A submessage header for configuration data associated with the
2309  * @ref ConfigType::INTERFACE_CONFIG.
2310  * @ingroup config_and_ctrl_messages
2311  *
2312  * In @ref SetConfigMessage, @ref GetConfigMessage, and @ref
2313  * ConfigResponseMessage this struct can be used to access settings
2314  * associated with a a particular interface. For example, to set the baudrate
2315  * for serial port 1:
2316  *
2317  * ```
2318  * {
2319  * SetConfigMessage(
2320  * config_type=INTERFACE_CONFIG),
2321  * InterfaceConfigSubmessage(
2322  * interface=InterfaceID(TransportType::SERIAL, 1),
2323  * subtype=BAUD_RATE),
2324  * uint32_t 115200
2325  * }
2326  * ```
2327  */
2329  /**
2330  * The interface ID to target.
2331  *
2332  * @note
2333  * TransportType::ALL is not supported.
2334  */
2336 
2337  /**
2338  * The interface setting to get/set/describe.
2339  */
2341 
2342  uint8_t reserved[3] = {0};
2343 
2344  /**
2345  * A pointer to the beginning of the configuration parameter value if
2346  * setting/describing.
2347  *
2348  * The size and format of the contents is specified by the @ref subtype.
2349  * See @ref InterfaceConfigType.
2350  */
2351  //uint8_t config_data[0];
2352 };
2353 
2354 /** @} */
2355 
2356 #pragma pack(pop)
2357 
2358 } // namespace messages
2359 } // namespace fusion_engine
2360 } // namespace point_one
@ INTERVAL_10_S
Output this message every 10 seconds.
P1_CONSTEXPR_FUNC InterfaceID()=default
@ IMPORT_DATA
ImportDataMessage
@ INTERVAL_10_MS
Output this message every 10 milliseconds.
ConfigType
An identifier for the contents of a parameter configuration message.
Definition: configuration.h:28
@ VEHICLE_TICKS
A single wheel rotational angle, reported as accumulated encoder ticks.
@ ALL
Set/get the configuration for the all I/O interfaces.
A 3-dimensional vector (used for lever arms, etc.).
@ INTERVAL_5_S
Output this message every 5 seconds.
P1_CONSTEXPR_FUNC InterfaceID(TransportType type, uint8_t index=0)
@ RTCM
Identifies an I/O interface.
@ PQTMGNSS
TransportType type
The interface's transport type.
@ RMC
MessageType
Identifiers for the defined output message types.
Definition: defs.h:34
@ GPS_WEEK_ROLLOVER
Specify a GPS legacy week rollover count override to use when converting all legacy 10-bit GPS week n...
Library portability helper definitions.
@ VW_4
Response to a GetConfigMessage request (MessageType::CONFIG_RESPONSE, version 1.0).
@ SAVE
Save all active parameters to persistent storage.
@ OK
@ RIVIAN
@ MAX_RATE
Alias for MessageRate::ON_CHANGE.
The orientation of a device with respect to the vehicle body axes.
@ LEXUS_CT200H
@ DEFAULT
Restore this message's rate back to its default value.
@ ENABLED_GNSS_FREQUENCY_BANDS
A bitmask indicating which GNSS frequency bands are enabled.
@ IONOSPHERE_CONFIG
Ionospheric delay model configuration.
@ INVALID
Hardware wheel tick encoder configuration settings.
@ NONE
Wheel/vehicle speed data not available.
@ TESLA_MODEL_X
@ DEVICE_LEVER_ARM
The location of the device IMU with respect to the vehicle body frame (in meters).
TickMode
The signal edge to use when capturing a wheel tick voltage signal.
@ TROPOSPHERE_CONFIG
Tropospheric delay model configuration.
@ DATASPEED_CD4
Tropospheric delay model configuration.
@ AUTO
Select the best available ionospheric delay model.
@ FORWARD_ACTIVE_LOW
Assume vehicle is moving forward when direction signal voltage is low, and backward when direction si...
@ REVERT_TO_SAVED
Revert the active configuration to previously saved values.
@ BMW_7
#define P1_ALIGNAS(N)
Definition: portability.h:57
@ AUTO
Select the best available tropospheric delay model.
@ FILE
A interface that writes to a file.
@ UART1_BAUD
Configure the UART1 serial baud rate (in bits/second).
@ INVALID
@ VEHICLE_BODY
Individual vehicle speed to be applied to the system.
@ PQTMVERNO
@ UART1_OUTPUT_DIAGNOSTICS_MESSAGES
Enable/disable output of diagnostic data on UART1.
@ SUPPORTED_IO_INTERFACES
SupportedIOInterfacesMessage
@ PQTMVER_SUB
Response to a GetMessageRate request (MessageType::MESSAGE_RATE_RESPONSE, version 1....
@ TESLA_MODEL_3
@ KIA_SPORTAGE
SteeringType
Indication of which of the vehicle's wheels are steered.
@ PQTMVERNO_SUB
@ HARDWARE_TICK_CONFIG
Indicates the mode and direction used when capturing vehicle wheel tick data from a voltage pulse on ...
@ UNKNOWN_VEHICLE
@ INTERVAL_500_MS
Output this message every 500 milliseconds.
@ GLL
InterfaceConfigType
An identifier for the contents of a output interface configuration submessage.
@ AUDI_Q7
@ USER_DEVICE_ID
A string for identifying a device.
SaveAction
The type configuration save operation to be performed.
Information about the vehicle including model and dimensions.
IonoDelayModel
The ionospheric delay model to use.
@ INTERVAL_60_S
Output this message every 60 seconds.
Set the output rate for the requested message types (MessageType::SET_MESSAGE_RATE,...
@ REVERT_TO_DEFAULT
Reset the active and saved configuration to default values.
@ HEADING_BIAS
Used to set horizontal (yaw) & vertical (pitch) biases (in degrees) on a dual-antenna heading platfor...
A submessage header for configuration data associated with the ConfigType::INTERFACE_CONFIG.
Import data from the host to the device (MessageType::IMPORT_DATA, version 1.0).
@ MESSAGE_RATE_RESPONSE
MessageRateResponse
@ SAVE_CONFIG
SaveConfigMessage
MessageRate
The output rate for a message type on an interface.
@ REMOTE_ADDRESS
Configure the network address for a client to connect to.
DataType
Type of data stored on device.
@ INTERFACE_CONFIG
Change a configuration setting for a specified output interface.
P1_CONSTEXPR_FUNC bool operator<(const InterfaceID &other) const
@ ACTIVE
Active configuration currently in use by the device.
@ FRONT
Front wheels are steered.
P1_CONSTEXPR_FUNC bool operator!=(const InterfaceID &other) const
@ PEUGEOT_206
TransportType
Type of I/O interface transport.
The base class for all message payloads.
Definition: defs.h:610
@ FILTER_STATE
@ INTERVAL_1_S
Output this message every second.
Query the value of a user configuration parameter (MessageType::GET_CONFIG, version 1....
@ ON_CHANGE
Output this message each time a new value is available.
@ INTERVAL_50_MS
Output this message every 50 milliseconds.
@ PQTMVER
@ INTERVAL_2_S
Output this message every 2 seconds.
@ OFF
Tropospheric delay model disabled.
@ INTERVAL_100_MS
Output this message every 100 milliseconds.
@ PQTMTXT
@ SERIAL
A serial data interface (e.g.
@ INVALID
@ INTERVAL_30_S
Output this message every 30 seconds.
@ OFF
Wheel tick capture disabled.
@ TCP_SERVER
An interface that will communicate with connected clients.
GNSS signal and frequency type definitions.
Definition: logging.h:38
Get the configured output rate for the he requested message type on the specified interface (MessageT...
Export data from the device (MessageType::EXPORT_DATA, version 1.0).
@ CALIBRATION_STATE
@ FRONT_WHEELS
Front wheel speed data to be applied to the system.
DataVersion data_version
Version of data contents.
@ INVALID
uint8_t index
An identifier for the instance of this transport.
P1_CONSTEXPR_FUNC bool operator>(const InterfaceID &other) const
@ FRONT_AND_REAR_WHEELS
Front and rear wheel speed data to be applied to the system.
@ P1MSG
@ INVALID
@ CURRENT
Set/get the configuration for the interface on which the command was received.
P1_CONSTEXPR_FUNC bool operator<=(const InterfaceID &other) const
@ UART2_BAUD
Configure the UART2 serial baud rate (in bits/second).
P1_CONSTEXPR_FUNC const char * to_string(ConfigType type)
Get a human-friendly string name for the specified ConfigType.
@ GSV
@ TICKS
Individual rotational angle measurements for multiple wheels, reported as accumulated encoder ticks.
@ AUDI_A8L
Direction
@ INTERVAL_200_MS
Output this message every 200 milliseconds.
VehicleModel
The make and model of the vehicle.
@ GET_MESSAGE_RATE
GetMessageRate
@ DEVICE_COARSE_ORIENTATION
The orientation of the device IMU with respect to the vehicle body axes.
@ NMEA
@ INTERVAL_40_MS
Output this message every 40 milliseconds.
std::ostream p1_ostream
Definition: portability.h:75
ConfigType config_type
The type of parameter to be configured.
Response
Command response status indicators.
Definition: defs.h:335
A list of transport interfaces supported by the device (MessageType::SUPPORTED_IO_INTERFACES,...
@ LINCOLN_MKZ
TickDirection
The way to interpret an incoming voltage signal, used to indicate direction of a hardware wheel tick ...
@ OFF
Disable output of this message.
p1_ostream & operator<<(p1_ostream &stream, ConfigType type)
ConfigType stream operator.
@ EXPORT_DATA
ExportDataMessage
@ VEHICLE_SPEED
A single value indicating the vehicle speed (in meters/second).
@ GSA
@ UDP_SERVER
An interface that will communicate with connected clients.
@ LBAND_PARAMETERS
Configuration of L-band Demodulator Parameters.
@ P1CALSTATUS
@ KLOBUCHAR
Use the Klobuchar ionospheric model.
@ MAN_TGX
Heading bias horizontal/vertical configuration settings.
@ WEBSOCKET_SERVER
An interface that will communicate with connected clients.
An element of a MessageRateResponse message.
NmeaMessageType
Integer ID for NMEA messages.
@ SET_MESSAGE_RATE
SetMessageRate
Save or reload configuration settings (MessageType::SAVE_CONFIG, version 1.0).
@ HYUNDAI_ELANTRA
ProtocolType
The framing protocol of a message.
@ CRASH_LOG
#define P1_CONSTEXPR_FUNC
Definition: portability.h:105
Configuration of the L-band demodulator parameters.
Set a user configuration parameter (MessageType::SET_CONFIG, version 1.0).
@ ENABLE_WATCHDOG_TIMER
Enable watchdog timer to restart device after fatal errors.
Message for reporting platform storage data (MessageType::PLATFORM_STORAGE_DATA, version 1....
@ VTG
WheelSensorType
The type of vehicle/wheel speed measurements produced by the vehicle.
TropoDelayModel
The tropospheric delay model to use.
@ GET_CONFIG
GetConfigMessage
@ FRONT_AND_REAR
Front and rear wheels are steered.
@ OUTPUT_LEVER_ARM
The offset of the desired output location with respect to the vehicle body frame (in meters).
@ OUTPUT_DIAGNOSTICS_MESSAGES
Enable/disable output of diagnostic data on this interface.
@ SAVED
Settings currently saved to persistent storage.
@ SET_CONFIG
SetConfigMessage
@ VEHICLE_DETAILS
Information about the vehicle including model and dimensions.
@ NONE
Speed data not applied to the system.
@ OFF
Ionospheric delay model disabled.
P1_CONSTEXPR_FUNC bool operator==(const InterfaceID &other) const
@ FORWARD
The vehicle is in a forward gear.
@ WHEEL_CONFIG
Information pertaining to wheel speed/rotation measurements when wheel data is transmitted via softwa...
Point One FusionEngine output message common definitions.
Software vehicle/wheel speed measurement configuration settings.
@ SAASTAMOINEN
Use the Saastamoinen tropospheric model.
@ USER_CONFIG
Ionospheric delay model configuration.
@ PLATFORM_STORAGE_DATA
PlatformStorageDataMessage
@ WHEEL_SPEED
Individual speed measurements for multiple wheels, reported in meters/second.
@ FALLING_EDGE
Capture a wheel tick on the falling edge of the incoming pulse.
@ FORWARD_ACTIVE_HIGH
Assume vehicle is moving forward when direction signal voltage is high, and backward when direction s...
@ GGA
DataVersion data_version
Version of data contents.
@ FACTION
ConfigurationSource
The type of a device's configuration settings.
@ TCP_CLIENT
An interface that will try to connect to a remote TCP server.
@ INTERVAL_20_MS
Output this message every 20 milliseconds.
@ REAR_WHEELS
Rear wheel speed data to be applied to the system (recommended).
@ GNSS_LEVER_ARM
The location of the GNSS antenna with respect to the vehicle body frame (in meters).
@ BAUD_RATE
Configure the serial baud rate (in bits/second).
@ BMW_MOTORRAD
@ KIA_SORENTO
@ FUSION_ENGINE
@ ENABLED_GNSS_SYSTEMS
A bitmask indicating which GNSS constellations are enabled.
A struct representing the version of a data object.
Definition: data_version.h:23
@ OFF
Wheel tick direction not provided.
P1_CONSTEXPR_FUNC bool operator>=(const InterfaceID &other) const
@ LEAP_SECOND
Specify a UTC leap second count override value to use for all UTC time conversions.
@ RISING_EDGE
Capture a wheel tick on the rising edge of the incoming pulse.
@ PORT
Configure the network port.
@ UART2_OUTPUT_DIAGNOSTICS_MESSAGES
Enable/disable output of diagnostic data on UART2.
@ ALL
This is used for requesting the configuration for all protocols.
@ UDP_CLIENT
An interface that will try to connect to a remote UDP server.
constexpr uint16_t ALL_MESSAGES_ID
Setting message_id to this value acts as a wild card.
AppliedSpeedType
The type of vehicle/wheel speed measurements to be applied.
@ J1939
@ UNKNOWN
Steered wheels unknown.
@ INVALID
@ CONFIG_RESPONSE
ConfigResponseMessage