AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
isobus_speed_distance_messages.hpp
Go to the documentation of this file.
1//================================================================================================
11//================================================================================================
12#ifndef ISOBUS_SPEED_MESSAGES_HPP
13#define ISOBUS_SPEED_MESSAGES_HPP
14
16#include "isobus/utility/event_dispatcher.hpp"
17#include "isobus/utility/processing_flags.hpp"
18
19#include <cstdint>
20#include <memory>
21#include <vector>
22
23namespace isobus
24{
27 {
28 public:
37 SpeedMessagesInterface(std::shared_ptr<InternalControlFunction> source,
38 bool enableSendingGroundBasedSpeedPeriodically = false,
39 bool enableSendingWheelBasedSpeedPeriodically = false,
40 bool enableSendingMachineSelectedSpeedPeriodically = false,
41 bool enableSendingMachineSelectedSpeedCommandPeriodically = false);
42
45
47 enum class MachineDirection : std::uint8_t
48 {
49 Forward = 0,
50 Reverse = 1,
51 Error = 2,
52 NotAvailable = 3
53 };
54
57 {
58 public:
60 enum class KeySwitchState : std::uint8_t
61 {
62 Off = 0,
63 NotOff = 1,
64 Error = 2,
65 NotAvailable = 3
66 };
67
69 enum class ImplementStartStopOperations : std::uint8_t
70 {
71 StopDisableImplementOperations = 0,
72 StartEnableImplementOperations = 1,
73 Error = 2,
74 NotAvailable = 3
75 };
76
78 enum class OperatorDirectionReversed : std::uint8_t
79 {
80 NotReversed = 0,
81 Reversed = 1,
82 Error = 2,
83 NotAvailable = 3
84 };
85
88 explicit WheelBasedMachineSpeedData(std::shared_ptr<ControlFunction> sender);
89
93 std::uint32_t get_machine_distance() const;
94
98 bool set_machine_distance(std::uint32_t distance);
99
102 std::uint16_t get_machine_speed() const;
103
107 bool set_machine_speed(std::uint16_t speed);
108
111 std::uint8_t get_maximum_time_of_tractor_power() const;
112
116 bool set_maximum_time_of_tractor_power(std::uint8_t maxTime);
117
123
129
133
139
145
152
156
161
169 std::shared_ptr<ControlFunction> get_sender_control_function() const;
170
173 void set_timestamp_ms(std::uint32_t timestamp);
174
177 std::uint32_t get_timestamp_ms() const;
178
179 private:
180 std::shared_ptr<ControlFunction> const controlFunction;
181 std::uint32_t timestamp_ms = 0;
185 MachineDirection machineDirectionState = MachineDirection::NotAvailable;
186 KeySwitchState keySwitchState = KeySwitchState::NotAvailable;
187 ImplementStartStopOperations implementStartStopOperationsState = ImplementStartStopOperations::NotAvailable;
188 OperatorDirectionReversed operatorDirectionReversedState = OperatorDirectionReversed::NotAvailable;
189 };
190
194 {
195 public:
199 enum class ExitReasonCode : std::uint8_t
200 {
201 NoReasonAllClear = 0,
202 RequiredLevelOfOperatorPresenceAwarenessNotDetected = 1,
203 ImplementReleasedControlOfFunction = 2,
204 OperatorOverrideOfFunction = 3,
205 OperatorControlNotInValidPosition = 4,
206 RemoteCommandTimeout = 5,
207 RemoteCommandOutOfRangeInvalid = 6,
208 FunctionNotCalibrated = 7,
209 OperatorControlFault = 8,
210 FunctionFault = 9,
211 VehicleTransmissionGearDoesNotAllowRemoteCommands = 22,
212 Error = 62,
213 NotAvailable = 63
214 };
215
221 enum class SpeedSource : std::uint8_t
222 {
223 WheelBasedSpeed = 0,
224 GroundBasedSpeed = 1,
226 Blended = 3,
227 Simulated = 4,
228 Reserved_1 = 5,
229 Reserved_2 = 6,
230 NotAvailable = 7
231 };
232
236 enum class LimitStatus : std::uint8_t
237 {
238 NotLimited = 0,
240 LimitedHigh = 2,
241 LimitedLow = 3,
242 Reserved_1 = 4,
243 Reserved_2 = 5,
244 NonRecoverableFault = 6,
245 NotAvailable
246 };
247
250 explicit MachineSelectedSpeedData(std::shared_ptr<ControlFunction> sender);
251
255 std::uint32_t get_machine_distance() const;
256
261 bool set_machine_distance(std::uint32_t distance);
262
266 std::uint16_t get_machine_speed() const;
267
271 bool set_machine_speed(std::uint16_t speed);
272
277 std::uint8_t get_exit_reason_code() const;
278
283 bool set_exit_reason_code(std::uint8_t exitCode);
284
288
292 bool set_speed_source(SpeedSource selectedSource);
293
297
301 bool set_limit_status(LimitStatus statusToSet);
302
308
314
322 std::shared_ptr<ControlFunction> get_sender_control_function() const;
323
326 void set_timestamp_ms(std::uint32_t timestamp);
327
330 std::uint32_t get_timestamp_ms() const;
331
332 private:
333 std::shared_ptr<ControlFunction> const controlFunction;
334 std::uint32_t timestamp_ms = 0;
337 std::uint8_t exitReasonCode = static_cast<std::uint8_t>(ExitReasonCode::NotAvailable);
340 MachineDirection machineDirectionState = MachineDirection::NotAvailable;
341 };
342
350 {
351 public:
354 explicit GroundBasedSpeedData(std::shared_ptr<ControlFunction> sender);
355
360 std::uint32_t get_machine_distance() const;
361
366 bool set_machine_distance(std::uint32_t distance);
367
371 std::uint16_t get_machine_speed() const;
372
377 bool set_machine_speed(std::uint16_t speed);
378
384
390
398 std::shared_ptr<ControlFunction> get_sender_control_function() const;
399
402 void set_timestamp_ms(std::uint32_t timestamp);
403
406 std::uint32_t get_timestamp_ms() const;
407
408 private:
409 std::shared_ptr<ControlFunction> const controlFunction;
410 std::uint32_t timestamp_ms = 0;
413 MachineDirection machineDirectionState = MachineDirection::NotAvailable;
414 };
415
421 {
422 public:
425 explicit MachineSelectedSpeedCommandData(std::shared_ptr<ControlFunction> sender);
426
429 std::uint16_t get_machine_speed_setpoint_command() const;
430
435 bool set_machine_speed_setpoint_command(std::uint16_t speed);
436
439 std::uint16_t get_machine_selected_speed_setpoint_limit() const;
440
444 bool set_machine_selected_speed_setpoint_limit(std::uint16_t speedLimit);
445
449
453 bool set_machine_direction_of_travel(MachineDirection commandedDirection);
454
462 std::shared_ptr<ControlFunction> get_sender_control_function() const;
463
466 void set_timestamp_ms(std::uint32_t timestamp);
467
470 std::uint32_t get_timestamp_ms() const;
471
472 private:
473 std::shared_ptr<ControlFunction> const controlFunction;
474 std::uint32_t timestamp_ms = 0;
475 std::uint16_t speedCommandedSetpoint = 0;
476 std::uint16_t speedSetpointLimit = 0;
477 MachineDirection machineDirectionCommand = MachineDirection::NotAvailable;
478 };
479
482 void initialize();
483
486 bool get_initialized() const;
487
491
495
499
503
507
511
515
519
527 std::shared_ptr<MachineSelectedSpeedData> get_received_machine_selected_speed(std::size_t index);
528
536 std::shared_ptr<WheelBasedMachineSpeedData> get_received_wheel_based_speed(std::size_t index);
537
545 std::shared_ptr<GroundBasedSpeedData> get_received_ground_based_speed(std::size_t index);
546
554 std::shared_ptr<MachineSelectedSpeedCommandData> get_received_machine_selected_speed_command(std::size_t index);
555
558 EventDispatcher<const std::shared_ptr<WheelBasedMachineSpeedData>, bool> &get_wheel_based_machine_speed_data_event_publisher();
559
562 EventDispatcher<const std::shared_ptr<MachineSelectedSpeedData>, bool> &get_machine_selected_speed_data_event_publisher();
563
566 EventDispatcher<const std::shared_ptr<GroundBasedSpeedData>, bool> &get_ground_based_machine_speed_data_event_publisher();
567
570 EventDispatcher<const std::shared_ptr<MachineSelectedSpeedCommandData>, bool> &get_machine_selected_speed_command_data_event_publisher();
571
574 void update();
575
576 protected:
587
588 static constexpr std::uint32_t SPEED_DISTANCE_MESSAGE_TX_INTERVAL_MS = 100;
590 static constexpr std::uint32_t SAEds05_MAX_VALUE = 4211081215;
591 static constexpr std::uint16_t SAEvl01_MAX_VALUE = 64255;
592
596 static void process_flags(std::uint32_t flag, void *parentPointer);
597
601 static void process_rx_message(const CANMessage &message, void *parentPointer);
602
605 bool send_machine_selected_speed() const;
606
609 bool send_wheel_based_speed() const;
610
613 bool send_ground_based_speed() const;
614
618
619 ProcessingFlags txFlags;
620 EventDispatcher<const std::shared_ptr<WheelBasedMachineSpeedData>, bool> wheelBasedMachineSpeedDataEventPublisher;
621 EventDispatcher<const std::shared_ptr<MachineSelectedSpeedData>, bool> machineSelectedSpeedDataEventPublisher;
622 EventDispatcher<const std::shared_ptr<GroundBasedSpeedData>, bool> groundBasedSpeedDataEventPublisher;
623 EventDispatcher<const std::shared_ptr<MachineSelectedSpeedCommandData>, bool> machineSelectedSpeedCommandDataEventPublisher;
624 std::vector<std::shared_ptr<WheelBasedMachineSpeedData>> receivedWheelBasedSpeedMessages;
625 std::vector<std::shared_ptr<MachineSelectedSpeedData>> receivedMachineSelectedSpeedMessages;
626 std::vector<std::shared_ptr<GroundBasedSpeedData>> receivedGroundBasedSpeedMessages;
627 std::vector<std::shared_ptr<MachineSelectedSpeedCommandData>> receivedMachineSelectedSpeedCommandMessages;
632 bool initialized = false;
633 };
634} // namespace isobus
635
636#endif // ISOBUS_SPEED_MESSAGES_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.
Message normally sent by the Tractor ECU on the implement bus on construction and agricultural implem...
std::uint32_t timestamp_ms
A timestamp for when the message was released in milliseconds.
std::shared_ptr< ControlFunction > const controlFunction
The CF that is sending the message.
MachineDirection get_machine_direction_of_travel() const
Returns A measured signal indicating either forward or reverse as the direction of travel.
GroundBasedSpeedData(std::shared_ptr< ControlFunction > sender)
Constructor for a GroundBasedSpeedData.
std::uint32_t get_timestamp_ms() const
Returns the timestamp for when the message was received, in milliseconds.
bool set_machine_distance(std::uint32_t distance)
Sets the actual distance traveled by a machine, based on measurements from a sensor such as that is n...
MachineDirection machineDirectionState
Stores direction of travel.
std::shared_ptr< ControlFunction > get_sender_control_function() const
Returns a pointer to the sender of the message. If an ICF is the sender, returns the ICF being used t...
bool set_machine_speed(std::uint16_t speed)
Sets the actual ground speed of a machine, measured by a sensor such as that is not susceptible to wh...
std::uint32_t groundBasedMachineDistance_mm
Stores the ground-based speed's distance in millimeters.
bool set_machine_direction_of_travel(MachineDirection directionOfTravel)
Sets a measured signal indicating either forward or reverse as the direction of travel.
void set_timestamp_ms(std::uint32_t timestamp)
Sets the timestamp for when the message was received or sent.
std::uint32_t get_machine_distance() const
Actual distance traveled by a machine, based on measurements from a sensor such as that is not suscep...
std::uint16_t get_machine_speed() const
Returns the actual ground speed of a machine, measured by a sensor such as that is not susceptible to...
std::uint16_t groundBasedMachineSpeed_mm_per_sec
Stores the ground-based speed in mm/s.
Message that provides the control of the machine speed and direction. If you receive this message,...
MachineDirection get_machine_direction_command() const
Returns The commanded direction of the machine.
std::uint32_t timestamp_ms
A timestamp for when the message was released in milliseconds.
bool set_machine_selected_speed_setpoint_limit(std::uint16_t speedLimit)
Sets the maximum allowed machine speed in mm/s, which gets communicated to the tractor/machine.
bool set_machine_direction_of_travel(MachineDirection commandedDirection)
Sets the commanded direction of the machine.
void set_timestamp_ms(std::uint32_t timestamp)
Sets the timestamp for when the message was received or sent.
std::shared_ptr< ControlFunction > const controlFunction
The CF that is sending the message.
std::shared_ptr< ControlFunction > get_sender_control_function() const
Returns a pointer to the sender of the message. If an ICF is the sender, returns the ICF being used t...
std::uint16_t get_machine_speed_setpoint_command() const
Returns the commanded setpoint value of the machine speed as measured by the selected source in mm/s.
std::uint16_t speedSetpointLimit
Stores the maximum allowed speed in mm/s.
std::uint16_t speedCommandedSetpoint
Stores the commanded speed setpoint in mm/s.
bool set_machine_speed_setpoint_command(std::uint16_t speed)
Sets The commanded setpoint value of the machine speed as measured by the selected source in mm/s.
MachineDirection machineDirectionCommand
Stores commanded direction of travel.
std::uint32_t get_timestamp_ms() const
Returns the timestamp for when the message was received, in milliseconds.
std::uint16_t get_machine_selected_speed_setpoint_limit() const
Returns the machine's maximum allowed speed in mm/s, which get's communicated to the tractor/machine.
MachineSelectedSpeedCommandData(std::shared_ptr< ControlFunction > sender)
Constructor for a MachineSelectedSpeedCommandData.
Message that provides the current machine selected speed, direction and source parameters.
void set_timestamp_ms(std::uint32_t timestamp)
Sets the timestamp for when the message was received or sent.
std::uint32_t get_timestamp_ms() const
Returns the timestamp for when the message was received, in milliseconds.
bool set_machine_direction_of_travel(MachineDirection directionOfTravel)
Sets a measured signal indicating either forward or reverse as the direction of travel.
std::shared_ptr< ControlFunction > const controlFunction
The CF that is sending the message.
std::uint32_t get_machine_distance() const
Returns the Actual distance travelled by the machine based on the value of selected machine speed (SP...
MachineSelectedSpeedData(std::shared_ptr< ControlFunction > sender)
Constructor for a MachineSelectedSpeedData.
std::uint16_t get_machine_speed() const
Returns the current machine selected speed.
bool set_exit_reason_code(std::uint8_t exitCode)
Sets the reason why the vehicle speed control unit cannot currently accept remote commands or has mos...
std::uint8_t get_exit_reason_code() const
Returns the reason why the vehicle speed control unit cannot currently accept remote commands or has ...
SpeedSource get_speed_source() const
Returns the speed source that is currently being reported in the machine selected speed parameter (SP...
std::uint16_t machineSelectedSpeed_mm_per_sec
Stores the machine selected speed in mm/s.
ExitReasonCode
This parameter is used to indicate why the vehicle speed control unit cannot currently accept remote ...
bool set_machine_distance(std::uint32_t distance)
Sets the Actual distance travelled by the machine based on the value of selected machine speed (SPN 4...
SpeedSource
An indication of the speed source that is currently being reported in the machine selected speed para...
bool set_machine_speed(std::uint16_t speed)
Sets the machine selected speed.
bool set_limit_status(LimitStatus statusToSet)
Sets the Tractor ECU's present limit status associated with a parameter whose commands are persistent...
std::uint8_t exitReasonCode
Stores why the machine has most recently stopped accepting remote commands.
std::shared_ptr< ControlFunction > get_sender_control_function() const
Returns a pointer to the sender of the message. If an ICF is the sender, returns the ICF being used t...
MachineDirection get_machine_direction_of_travel() const
Returns A measured signal indicating either forward or reverse as the direction of travel.
LimitStatus get_limit_status() const
Returns The Tractor ECU's present limit status associated with a parameter whose commands are persist...
LimitStatus
This parameter is used to report the Tractor ECU's present limit status associated with a parameter w...
@ LimitedLow
Only higher command values result in a change.
@ LimitedHigh
Only lower command values result in a change.
std::uint32_t timestamp_ms
A timestamp for when the message was released in milliseconds.
SpeedSource source
Stores the speed source that is currently being reported.
std::uint32_t machineSelectedSpeedDistance_mm
Stores the machine selected speed distance in millimeters.
bool set_speed_source(SpeedSource selectedSource)
Sets the speed source that is currently being reported in the machine selected speed parameter (SPN-4...
Groups the data encoded in an ISO "Wheel-based Speed and Distance" message.
ImplementStartStopOperations
Enumerates the states of a switch or operator input to start or enable implement operations.
std::shared_ptr< ControlFunction > const controlFunction
The CF that is sending the message.
KeySwitchState
Enumerates the key switch states of the tractor or power unit.
@ NotOff
Key is not off (does not always mean that it's on!)
KeySwitchState get_key_switch_state() const
Returns the key switch state of the tractor or power unit.
bool set_machine_direction_of_travel(MachineDirection direction)
Sets a measured signal indicating either forward or reverse as the direction of travel.
OperatorDirectionReversed
This parameter indicates whether the reported direction is reversed from the perspective of the opera...
WheelBasedMachineSpeedData(std::shared_ptr< ControlFunction > sender)
Constructor for a WheelBasedMachineSpeedData.
std::uint8_t maximumTimeOfTractorPower_min
Stores the maximum time of remaining tractor or power-unit-supplied electrical power at the current l...
KeySwitchState keySwitchState
Stores the key switch state of the tractor or power unit.
std::uint16_t get_machine_speed() const
Returns the value of the speed of a machine as calculated from the measured wheel or tail-shaft speed...
void set_timestamp_ms(std::uint32_t timestamp)
Sets the timestamp for when the message was received or sent.
bool set_machine_speed(std::uint16_t speed)
Sets the value of the speed of a machine as calculated from the measured wheel or tail-shaft speed.
std::uint32_t get_machine_distance() const
Returns The distance traveled by a machine as calculated from wheel or tail-shaft speed.
OperatorDirectionReversed get_operator_direction_reversed_state() const
Returns whether the reported direction is reversed from the perspective of the operator.
std::uint32_t get_timestamp_ms() const
Returns the timestamp for when the message was received, in milliseconds.
std::uint8_t get_maximum_time_of_tractor_power() const
Returns the maximum time (in minutes) of remaining tractor or power-unit-supplied electrical power at...
bool set_implement_start_stop_operations_state(ImplementStartStopOperations state)
Sets the state of a switch or other operator input to start or enable implement operations.
std::uint32_t wheelBasedMachineDistance_mm
Stores the decoded machine wheel-based distance in millimeters.
ImplementStartStopOperations implementStartStopOperationsState
Stores the state of a switch or other operator input to start or enable implement operations.
ImplementStartStopOperations get_implement_start_stop_operations_state() const
Returns the state of a switch or other operator input to start or enable implement operations.
std::uint32_t timestamp_ms
A timestamp for when the message was released in milliseconds.
OperatorDirectionReversed operatorDirectionReversedState
Stores whether the reported direction is reversed from the perspective of the operator.
bool set_key_switch_state(KeySwitchState state)
Sets the reported key switch state of the tractor or power unit.
bool set_machine_distance(std::uint32_t distance)
Sets the distance traveled by a machine as calculated from wheel or tail-shaft speed.
std::shared_ptr< ControlFunction > get_sender_control_function() const
Returns a pointer to the sender of the message. If an ICF is the sender, returns the ICF being used t...
bool set_operator_direction_reversed_state(OperatorDirectionReversed reverseState)
Sets whether the reported direction is reversed from the perspective of the operator.
bool set_maximum_time_of_tractor_power(std::uint8_t maxTime)
Sets the maximum time (in minutes) of remaining tractor or power-unit-supplied electrical power at th...
std::uint16_t wheelBasedMachineSpeed_mm_per_sec
Stores the decoded wheel-based machine speed in mm/s.
MachineDirection get_machine_direction_of_travel() const
Returns A measured signal indicating either forward or reverse as the direction of travel.
This interface manages and parses ISOBUS speed messages.
WheelBasedMachineSpeedData wheelBasedSpeedTransmitData
Use this to configure transmission of the wheel-based speed message. If you pass in an internal contr...
EventDispatcher< const std::shared_ptr< GroundBasedSpeedData >, bool > & get_ground_based_machine_speed_data_event_publisher()
Returns an event dispatcher which you can use to get callbacks when new/updated ground-based speed me...
~SpeedMessagesInterface()
Destructor for SpeedMessagesInterface. Cleans up PGN registrations if needed.
ProcessingFlags txFlags
Tx flag for sending messages periodically.
static constexpr std::uint16_t SAEvl01_MAX_VALUE
The maximum valid value for a SAEvl01 slot (see J1939)
bool send_machine_selected_speed_command() const
Sends the machine selected speed command message.
std::uint32_t machineSelectedSpeedTransmitTimestamp_ms
Timestamp used to know when to transmit the machine selected speed message in milliseconds.
MachineSelectedSpeedCommandData machineSelectedSpeedCommandTransmitData
Use this to configure transmission of the machine selected speed command message. If you pass in an i...
std::shared_ptr< GroundBasedSpeedData > get_received_ground_based_speed(std::size_t index)
Returns the content of the ground-based speed message based on the index of the sender....
EventDispatcher< const std::shared_ptr< WheelBasedMachineSpeedData >, bool > & get_wheel_based_machine_speed_data_event_publisher()
Returns an event dispatcher which you can use to get callbacks when new/updated wheel-based speed mes...
std::vector< std::shared_ptr< MachineSelectedSpeedCommandData > > receivedMachineSelectedSpeedCommandMessages
A list of all received ground-based speed messages.
bool send_machine_selected_speed() const
Sends the machine selected speed message.
bool send_ground_based_speed() const
Sends the ground-based speed message.
bool get_initialized() const
Returns if the interface has been initialized.
std::uint32_t groundBasedSpeedTransmitTimestamp_ms
Timestamp used to know when to transmit the ground-based speed message in milliseconds.
std::shared_ptr< MachineSelectedSpeedData > get_received_machine_selected_speed(std::size_t index)
Returns the content of the machine selected speed message based on the index of the sender....
static void process_rx_message(const CANMessage &message, void *parentPointer)
Processes a CAN message.
EventDispatcher< const std::shared_ptr< MachineSelectedSpeedCommandData >, bool > machineSelectedSpeedCommandDataEventPublisher
An event publisher for notifying when new machine selected speed command messages are received.
std::uint32_t wheelBasedSpeedTransmitTimestamp_ms
Timestamp used to know when to transmit the wheel-based speed message in milliseconds.
static constexpr std::uint32_t SAEds05_MAX_VALUE
The maximum valid value for a SAEds05 slot (see J1939)
std::vector< std::shared_ptr< WheelBasedMachineSpeedData > > receivedWheelBasedSpeedMessages
A list of all received wheel-based speed messages.
std::vector< std::shared_ptr< GroundBasedSpeedData > > receivedGroundBasedSpeedMessages
A list of all received ground-based speed messages.
SpeedMessagesInterface(std::shared_ptr< InternalControlFunction > source, bool enableSendingGroundBasedSpeedPeriodically=false, bool enableSendingWheelBasedSpeedPeriodically=false, bool enableSendingMachineSelectedSpeedPeriodically=false, bool enableSendingMachineSelectedSpeedCommandPeriodically=false)
Constructor for a SpeedMessagesInterface.
bool initialized
Stores if the interface has been initialized.
bool send_wheel_based_speed() const
Sends the wheel-based speed message.
EventDispatcher< const std::shared_ptr< MachineSelectedSpeedData >, bool > machineSelectedSpeedDataEventPublisher
An event publisher for notifying when new machine selected speed messages are received.
EventDispatcher< const std::shared_ptr< WheelBasedMachineSpeedData >, bool > wheelBasedMachineSpeedDataEventPublisher
An event publisher for notifying when new wheel-based speed messages are received.
TransmitFlags
Enumerates a set of flags to manage transmitting messages owned by this interface.
@ SendWheelBasedSpeed
A flag to manage sending wheel-based speed.
@ SendGroundBasedSpeed
A flag to manage sending ground-based speed.
@ NumberOfFlags
The number of flags in this enumeration.
@ SendMachineSelectedSpeed
A flag to manage sending machine selected speed.
@ SendMachineSelectedSpeedCommand
A flag to manage sending the machine selected speed command message.
EventDispatcher< const std::shared_ptr< MachineSelectedSpeedCommandData >, bool > & get_machine_selected_speed_command_data_event_publisher()
Returns an event dispatcher which you can use to get callbacks when new/updated machine selected spee...
static void process_flags(std::uint32_t flag, void *parentPointer)
Processes one flag (which sends the associated message)
EventDispatcher< const std::shared_ptr< MachineSelectedSpeedData >, bool > & get_machine_selected_speed_data_event_publisher()
Returns an event dispatcher which you can use to get callbacks when new/updated machine selected spee...
GroundBasedSpeedData groundBasedSpeedTransmitData
Use this to configure transmission of the ground-based speed message. If you pass in an internal cont...
std::size_t get_number_received_wheel_based_speed_sources() const
Returns the number of received, unique wheel-based speed message sources.
static constexpr std::uint32_t SPEED_DISTANCE_MESSAGE_TX_INTERVAL_MS
The interval (in milliseconds) defined in ISO11783-7 for sending this class's messages.
std::shared_ptr< MachineSelectedSpeedCommandData > get_received_machine_selected_speed_command(std::size_t index)
Returns the content of the machine selected speed command message based on the index of the sender....
MachineSelectedSpeedData machineSelectedSpeedTransmitData
Use this to configure transmission of the machine selected speed message. If you pass in an internal ...
static constexpr std::uint32_t SPEED_DISTANCE_MESSAGE_RX_TIMEOUT_MS
A (somewhat arbitrary) timeout for detecting stale messages.
std::vector< std::shared_ptr< MachineSelectedSpeedData > > receivedMachineSelectedSpeedMessages
A list of all received machine selected speed messages.
std::uint32_t machineSelectedSpeedCommandTransmitTimestamp_ms
Timestamp used to know when to transmit the ground-based speed message in milliseconds.
EventDispatcher< const std::shared_ptr< GroundBasedSpeedData >, bool > groundBasedSpeedDataEventPublisher
An event publisher for notifying when new ground-based speed messages are received.
std::size_t get_number_received_machine_selected_speed_command_sources() const
Returns the number of received, unique machine selected speed command message sources.
std::shared_ptr< WheelBasedMachineSpeedData > get_received_wheel_based_speed(std::size_t index)
Returns the content of the wheel-based speed message based on the index of the sender....
void initialize()
Sets up the class and registers it to receive callbacks from the network manager for processing guida...
void update()
Call this cyclically to update the interface. Transmits messages if needed and processes timeouts for...
std::size_t get_number_received_ground_based_speed_sources() const
Returns the number of received, unique ground-based speed message sources.
std::size_t get_number_received_machine_selected_speed_sources() const
Returns the number of received, unique machine selected speed message sources.
MachineDirection
Enumerates the values of the direction of travel for the machine.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...