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

Message that provides the current machine selected speed, direction and source parameters. More...

#include <isobus_speed_distance_messages.hpp>

Public Types

enum class  ExitReasonCode : std::uint8_t {
  NoReasonAllClear = 0 , RequiredLevelOfOperatorPresenceAwarenessNotDetected = 1 , ImplementReleasedControlOfFunction = 2 , OperatorOverrideOfFunction = 3 ,
  OperatorControlNotInValidPosition = 4 , RemoteCommandTimeout = 5 , RemoteCommandOutOfRangeInvalid = 6 , FunctionNotCalibrated = 7 ,
  OperatorControlFault = 8 , FunctionFault = 9 , VehicleTransmissionGearDoesNotAllowRemoteCommands = 22 , Error = 62 ,
  NotAvailable = 63
}
 This parameter is used to indicate why the vehicle speed control unit cannot currently accept remote commands or has most recently stopped accepting remote commands. More...
 
enum class  SpeedSource : std::uint8_t {
  WheelBasedSpeed = 0 , GroundBasedSpeed = 1 , NavigationBasedSpeed = 2 , Blended = 3 ,
  Simulated = 4 , Reserved_1 = 5 , Reserved_2 = 6 , NotAvailable = 7
}
 An indication of the speed source that is currently being reported in the machine selected speed parameter. More...
 
enum class  LimitStatus : std::uint8_t {
  NotLimited = 0 , OperatorLimitedControlled = 1 , LimitedHigh = 2 , LimitedLow = 3 ,
  Reserved_1 = 4 , Reserved_2 = 5 , NonRecoverableFault = 6 , NotAvailable
}
 This parameter is used to report the Tractor ECU's present limit status associated with a parameter whose commands are persistent. Similar to other SAEbs03 limit statuses. More...
 

Public Member Functions

 MachineSelectedSpeedData (std::shared_ptr< ControlFunction > sender)
 Constructor for a MachineSelectedSpeedData.
 
std::uint32_t get_machine_distance () const
 Returns the Actual distance travelled by the machine based on the value of selected machine speed (SPN 4305).
 
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 4305).
 
std::uint16_t get_machine_speed () const
 Returns the current machine selected speed.
 
bool set_machine_speed (std::uint16_t speed)
 Sets the machine selected speed.
 
std::uint8_t get_exit_reason_code () const
 Returns the reason why the vehicle speed control unit cannot currently accept remote commands or has most recently stopped accepting remote commands.
 
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 most recently stopped accepting remote commands.
 
SpeedSource get_speed_source () const
 Returns the speed source that is currently being reported in the machine selected speed parameter (SPN-4305).
 
bool set_speed_source (SpeedSource selectedSource)
 Sets the speed source that is currently being reported in the machine selected speed parameter (SPN-4305).
 
LimitStatus get_limit_status () const
 Returns The Tractor ECU's present limit status associated with a parameter whose commands are persistent.
 
bool set_limit_status (LimitStatus statusToSet)
 Sets the Tractor ECU's present limit status associated with a parameter whose commands are persistent.
 
MachineDirection get_machine_direction_of_travel () const
 Returns A measured signal indicating either forward or reverse as the direction of travel.
 
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< ControlFunctionget_sender_control_function () const
 Returns a pointer to the sender of the message. If an ICF is the sender, returns the ICF being used to transmit from.
 
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.
 

Private Attributes

std::shared_ptr< ControlFunction > const controlFunction
 The CF that is sending the message.
 
std::uint32_t timestamp_ms = 0
 A timestamp for when the message was released in milliseconds.
 
std::uint32_t machineSelectedSpeedDistance_mm = 0
 Stores the machine selected speed distance in millimeters.
 
std::uint16_t machineSelectedSpeed_mm_per_sec = 0
 Stores the machine selected speed in mm/s.
 
std::uint8_t exitReasonCode = static_cast<std::uint8_t>(ExitReasonCode::NotAvailable)
 Stores why the machine has most recently stopped accepting remote commands.
 
SpeedSource source = SpeedSource::NotAvailable
 Stores the speed source that is currently being reported.
 
LimitStatus limitStatus = LimitStatus::NotAvailable
 Stores the tractor ECU limit status.
 
MachineDirection machineDirectionState = MachineDirection::NotAvailable
 Stores direction of travel.
 

Detailed Description

Message that provides the current machine selected speed, direction and source parameters.

This is usually the best/authoritative source of speed information as chosen by the machine.

Definition at line 193 of file isobus_speed_distance_messages.hpp.

Member Enumeration Documentation

◆ ExitReasonCode

This parameter is used to indicate why the vehicle speed control unit cannot currently accept remote commands or has most recently stopped accepting remote commands.

Note
Some values are reserved or manufacturer specific. See the SPN definition.

Definition at line 199 of file isobus_speed_distance_messages.hpp.

◆ LimitStatus

This parameter is used to report the Tractor ECU's present limit status associated with a parameter whose commands are persistent. Similar to other SAEbs03 limit statuses.

Enumerator
OperatorLimitedControlled 

Request cannot be implemented.

LimitedHigh 

Only lower command values result in a change.

LimitedLow 

Only higher command values result in a change.

Reserved_1 

Reserved.

Reserved_2 

Reserved.

NotAvailable 

Parameter not supported.

Definition at line 236 of file isobus_speed_distance_messages.hpp.

◆ SpeedSource

An indication of the speed source that is currently being reported in the machine selected speed parameter.

This parameter is an indication of the speed source that is currently being reported in the machine selected speed parameter. Simulated speed is a system-generated speed message to permit implement operations when the machine is not actually moving. Blended speed is a speed message that uses a combination of the actual speed sources based on the operator's or the manufacturer's selected logic, i.e. when a ground-based speed source is less than 0.5 m/s, the speed message will then send the wheel speed source.

Enumerator
WheelBasedSpeed 

Wheel encoder usually.

GroundBasedSpeed 

Radar usually.

NavigationBasedSpeed 

GNSS Usually.

Blended 

Some combination of source fusion.

Simulated 

A test speed.

Reserved_1 

Reserved.

Reserved_2 

Reserved.

NotAvailable 

N/A.

Definition at line 221 of file isobus_speed_distance_messages.hpp.

Constructor & Destructor Documentation

◆ MachineSelectedSpeedData()

isobus::SpeedMessagesInterface::MachineSelectedSpeedData::MachineSelectedSpeedData ( std::shared_ptr< ControlFunction > sender)
explicit

Constructor for a MachineSelectedSpeedData.

Parameters
[in]senderThe control function that is sending this message

Definition at line 172 of file isobus_speed_distance_messages.cpp.

Member Function Documentation

◆ get_exit_reason_code()

std::uint8_t isobus::SpeedMessagesInterface::MachineSelectedSpeedData::get_exit_reason_code ( ) const

Returns the reason why the vehicle speed control unit cannot currently accept remote commands or has most recently stopped accepting remote commands.

Returns
why the vehicle speed control unit cannot currently accept remote commands or has most recently stopped accepting remote commands

Definition at line 214 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_limit_status()

SpeedMessagesInterface::MachineSelectedSpeedData::LimitStatus isobus::SpeedMessagesInterface::MachineSelectedSpeedData::get_limit_status ( ) const

Returns The Tractor ECU's present limit status associated with a parameter whose commands are persistent.

Returns
The Tractor ECU's present limit status associated with a parameter whose commands are persistent

Definition at line 238 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_direction_of_travel()

SpeedMessagesInterface::MachineDirection isobus::SpeedMessagesInterface::MachineSelectedSpeedData::get_machine_direction_of_travel ( ) const

Returns A measured signal indicating either forward or reverse as the direction of travel.

Note
When the speed is zero, this indicates the last travel direction until a different direction is detected or selected and engaged.
Returns
The measured direction of travel for the machine

Definition at line 250 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_distance()

std::uint32_t isobus::SpeedMessagesInterface::MachineSelectedSpeedData::get_machine_distance ( ) const

Returns the Actual distance travelled by the machine based on the value of selected machine speed (SPN 4305).

Note
When the distance exceeds 4211081215 meters the value shall be reset to zero and incremented as additional distance accrues.
Returns
The Actual distance travelled by the machine based on the value of selected machine speed (millimeters)

Definition at line 177 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_speed()

std::uint16_t isobus::SpeedMessagesInterface::MachineSelectedSpeedData::get_machine_speed ( ) const

Returns the current machine selected speed.

The TECU sends this value as the authoritative speed for the machine.

Returns
The current machine selected speed in mm/s

Definition at line 196 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_sender_control_function()

std::shared_ptr< ControlFunction > isobus::SpeedMessagesInterface::MachineSelectedSpeedData::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 to transmit from.

Attention
The only way you could get an invalid pointer here is if you register a partner, it sends this message, then you delete the partner and call this function, as that is the only time the stack deletes a control function. That would be abnormal program flow, but at some point the stack will be updated to return a shared or weak pointer instead, but for now please be aware of that limitation. Eventually though the message will time-out normally and you can get a new pointer for the external CF that replaces the deleted partner.
Returns
The control function sending this instance of the guidance system command message

Definition at line 262 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_speed_source()

SpeedMessagesInterface::MachineSelectedSpeedData::SpeedSource isobus::SpeedMessagesInterface::MachineSelectedSpeedData::get_speed_source ( ) const

Returns the speed source that is currently being reported in the machine selected speed parameter (SPN-4305).

Returns
The speed source that is currently being reported in the machine selected speed parameter (SPN-4305).

Definition at line 226 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_timestamp_ms()

std::uint32_t isobus::SpeedMessagesInterface::MachineSelectedSpeedData::get_timestamp_ms ( ) const

Returns the timestamp for when the message was received, in milliseconds.

Returns
The timestamp for when the message was received, in milliseconds

Definition at line 272 of file isobus_speed_distance_messages.cpp.

◆ set_exit_reason_code()

bool isobus::SpeedMessagesInterface::MachineSelectedSpeedData::set_exit_reason_code ( std::uint8_t exitCode)

Sets the reason why the vehicle speed control unit cannot currently accept remote commands or has most recently stopped accepting remote commands.

Parameters
exitCodeThe exit/reason code to set
Returns
True if the set value was different from the stored value otherwise false

Definition at line 219 of file isobus_speed_distance_messages.cpp.

◆ set_limit_status()

bool isobus::SpeedMessagesInterface::MachineSelectedSpeedData::set_limit_status ( LimitStatus statusToSet)

Sets the Tractor ECU's present limit status associated with a parameter whose commands are persistent.

Parameters
statusToSetThe Tractor ECU's present limit status associated with a parameter whose commands are persistent
Returns
True if the set value was different from the stored value otherwise false

Definition at line 243 of file isobus_speed_distance_messages.cpp.

◆ set_machine_direction_of_travel()

bool isobus::SpeedMessagesInterface::MachineSelectedSpeedData::set_machine_direction_of_travel ( MachineDirection directionOfTravel)

Sets a measured signal indicating either forward or reverse as the direction of travel.

Note
The "Not Off" key switch state does not always mean "On" so use care when using it.
Parameters
directionOfTravelThe measured direction of travel for the machine
Returns
True if the set value was different from the stored value otherwise false

Definition at line 255 of file isobus_speed_distance_messages.cpp.

◆ set_machine_distance()

bool isobus::SpeedMessagesInterface::MachineSelectedSpeedData::set_machine_distance ( std::uint32_t distance)

Sets the Actual distance travelled by the machine based on the value of selected machine speed (SPN 4305).

Note
When the distance exceeds 4211081215 meters the value shall be reset to zero and incremented as additional distance accrues.
Parameters
[in]distanceThe Actual distance travelled by the machine based on the value of selected machine speed (millimeters)
Returns
True if the set value was different from the stored value otherwise false

Definition at line 189 of file isobus_speed_distance_messages.cpp.

◆ set_machine_speed()

bool isobus::SpeedMessagesInterface::MachineSelectedSpeedData::set_machine_speed ( std::uint16_t speed)

Sets the machine selected speed.

Parameters
speedThe machine selected speed in mm/s
Returns
True if the set value was different from the stored value otherwise false

Definition at line 207 of file isobus_speed_distance_messages.cpp.

◆ set_speed_source()

bool isobus::SpeedMessagesInterface::MachineSelectedSpeedData::set_speed_source ( SpeedSource selectedSource)

Sets the speed source that is currently being reported in the machine selected speed parameter (SPN-4305).

Parameters
selectedSourceThe speed source that is currently being reported in the machine selected speed parameter (SPN-4305).
Returns
True if the set value was different from the stored value otherwise false

Definition at line 231 of file isobus_speed_distance_messages.cpp.

◆ set_timestamp_ms()

void isobus::SpeedMessagesInterface::MachineSelectedSpeedData::set_timestamp_ms ( std::uint32_t timestamp)

Sets the timestamp for when the message was received or sent.

Parameters
[in]timestampThe timestamp, in milliseconds, when the message was sent or received

Definition at line 267 of file isobus_speed_distance_messages.cpp.

Member Data Documentation

◆ controlFunction

std::shared_ptr<ControlFunction> const isobus::SpeedMessagesInterface::MachineSelectedSpeedData::controlFunction
private

The CF that is sending the message.

Definition at line 333 of file isobus_speed_distance_messages.hpp.

◆ exitReasonCode

std::uint8_t isobus::SpeedMessagesInterface::MachineSelectedSpeedData::exitReasonCode = static_cast<std::uint8_t>(ExitReasonCode::NotAvailable)
private

Stores why the machine has most recently stopped accepting remote commands.

Definition at line 337 of file isobus_speed_distance_messages.hpp.

◆ limitStatus

LimitStatus isobus::SpeedMessagesInterface::MachineSelectedSpeedData::limitStatus = LimitStatus::NotAvailable
private

Stores the tractor ECU limit status.

Definition at line 339 of file isobus_speed_distance_messages.hpp.

◆ machineDirectionState

MachineDirection isobus::SpeedMessagesInterface::MachineSelectedSpeedData::machineDirectionState = MachineDirection::NotAvailable
private

Stores direction of travel.

Definition at line 340 of file isobus_speed_distance_messages.hpp.

◆ machineSelectedSpeed_mm_per_sec

std::uint16_t isobus::SpeedMessagesInterface::MachineSelectedSpeedData::machineSelectedSpeed_mm_per_sec = 0
private

Stores the machine selected speed in mm/s.

Definition at line 336 of file isobus_speed_distance_messages.hpp.

◆ machineSelectedSpeedDistance_mm

std::uint32_t isobus::SpeedMessagesInterface::MachineSelectedSpeedData::machineSelectedSpeedDistance_mm = 0
private

Stores the machine selected speed distance in millimeters.

Definition at line 335 of file isobus_speed_distance_messages.hpp.

◆ source

SpeedSource isobus::SpeedMessagesInterface::MachineSelectedSpeedData::source = SpeedSource::NotAvailable
private

Stores the speed source that is currently being reported.

Definition at line 338 of file isobus_speed_distance_messages.hpp.

◆ timestamp_ms

std::uint32_t isobus::SpeedMessagesInterface::MachineSelectedSpeedData::timestamp_ms = 0
private

A timestamp for when the message was released in milliseconds.

Definition at line 334 of file isobus_speed_distance_messages.hpp.


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