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

Message that provides the control of the machine speed and direction. If you receive this message, you can sniff the speed commands being sent to the TECU or act as the TECU or propulsion interface yourself. More...

#include <isobus_speed_distance_messages.hpp>

Public Member Functions

 MachineSelectedSpeedCommandData (std::shared_ptr< ControlFunction > sender)
 Constructor for a MachineSelectedSpeedCommandData.
 
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.
 
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.
 
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.
 
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.
 
MachineDirection get_machine_direction_command () const
 Returns The commanded direction of the machine.
 
bool set_machine_direction_of_travel (MachineDirection commandedDirection)
 Sets the commanded direction of the machine.
 
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::uint16_t speedCommandedSetpoint = 0
 Stores the commanded speed setpoint in mm/s.
 
std::uint16_t speedSetpointLimit = 0
 Stores the maximum allowed speed in mm/s.
 
MachineDirection machineDirectionCommand = MachineDirection::NotAvailable
 Stores commanded direction of travel.
 

Detailed Description

Message that provides the control of the machine speed and direction. If you receive this message, you can sniff the speed commands being sent to the TECU or act as the TECU or propulsion interface yourself.

Attention
Use extreme caution if you choose to send this message, as you may cause machine motion!

Definition at line 420 of file isobus_speed_distance_messages.hpp.

Constructor & Destructor Documentation

◆ MachineSelectedSpeedCommandData()

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

Constructor for a MachineSelectedSpeedCommandData.

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

Definition at line 346 of file isobus_speed_distance_messages.cpp.

Member Function Documentation

◆ get_machine_direction_command()

SpeedMessagesInterface::MachineDirection isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::get_machine_direction_command ( ) const

Returns The commanded direction of the machine.

Returns
The commanded direction of the machine.

Definition at line 389 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_selected_speed_setpoint_limit()

std::uint16_t isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::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.

Returns
The machine's maximum allowed speed in mm/s, which get's communicated to the tractor/machine

Definition at line 370 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_speed_setpoint_command()

std::uint16_t isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::get_machine_speed_setpoint_command ( ) const

Returns the commanded setpoint value of the machine speed as measured by the selected source in mm/s.

Returns
The commanded setpoint value of the machine speed as measured by the selected source in mm/s

Definition at line 351 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::MachineSelectedSpeedCommandData::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 401 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_timestamp_ms()

std::uint32_t isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::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 411 of file isobus_speed_distance_messages.cpp.

◆ set_machine_direction_of_travel()

bool isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::set_machine_direction_of_travel ( MachineDirection commandedDirection)

Sets the commanded direction of the machine.

Parameters
commandedDirectionThe commanded direction of travel for the machine
Returns
True if the set value was different from the stored value otherwise false

Definition at line 394 of file isobus_speed_distance_messages.cpp.

◆ set_machine_selected_speed_setpoint_limit()

bool isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::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.

Parameters
[in]speedLimitThe maximum allowed machine speed in mm/s
Returns
True if the set value was different from the stored value otherwise false

Definition at line 382 of file isobus_speed_distance_messages.cpp.

◆ set_machine_speed_setpoint_command()

bool isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::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.

Attention
This is used to set the speed of the machine! Use with caution!
Parameters
speedThe commanded setpoint value of the machine speed as measured by the selected source in mm/s
Returns
True if the set value was different from the stored value otherwise false

Definition at line 363 of file isobus_speed_distance_messages.cpp.

◆ set_timestamp_ms()

void isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::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 406 of file isobus_speed_distance_messages.cpp.

Member Data Documentation

◆ controlFunction

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

The CF that is sending the message.

Definition at line 473 of file isobus_speed_distance_messages.hpp.

◆ machineDirectionCommand

MachineDirection isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::machineDirectionCommand = MachineDirection::NotAvailable
private

Stores commanded direction of travel.

Definition at line 477 of file isobus_speed_distance_messages.hpp.

◆ speedCommandedSetpoint

std::uint16_t isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::speedCommandedSetpoint = 0
private

Stores the commanded speed setpoint in mm/s.

Definition at line 475 of file isobus_speed_distance_messages.hpp.

◆ speedSetpointLimit

std::uint16_t isobus::SpeedMessagesInterface::MachineSelectedSpeedCommandData::speedSetpointLimit = 0
private

Stores the maximum allowed speed in mm/s.

Definition at line 476 of file isobus_speed_distance_messages.hpp.

◆ timestamp_ms

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

A timestamp for when the message was released in milliseconds.

Definition at line 474 of file isobus_speed_distance_messages.hpp.


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