AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
A class that describes an ISO11783 control function, which includes a NAME and address. More...
#include <can_control_function.hpp>
Public Types | |
enum class | Type { Internal , External , Partnered } |
The type of the control function. More... | |
Public Member Functions | |
virtual bool | destroy (std::uint32_t expectedRefCount=1) |
Destroys this control function, by removing it from the network manager. | |
std::uint8_t | get_address () const |
Returns the current address of the control function. | |
bool | get_address_valid () const |
Describes if the control function has a valid address (not NULL or global) | |
std::uint8_t | get_can_port () const |
Returns the CAN channel index the control function communicates on. | |
NAME | get_NAME () const |
Returns the NAME of the control function as described by its address claim message. | |
Type | get_type () const |
Returns the Type of the control function. | |
std::string | get_type_string () const |
Returns the 'Type' of the control function as a string. | |
Static Public Member Functions | |
static std::shared_ptr< ControlFunction > | create (NAME NAMEValue, std::uint8_t addressValue, std::uint8_t CANPort) |
The factory function to construct a control function. | |
Protected Member Functions | |
ControlFunction (NAME NAMEValue, std::uint8_t addressValue, std::uint8_t CANPort, Type type=Type::External) | |
The protected constructor for the control function, which is called by the (inherited) factory function. | |
Protected Attributes | |
const Type | controlFunctionType |
The Type of the control function. | |
NAME | controlFunctionNAME |
The NAME of the control function. | |
bool | claimedAddressSinceLastAddressClaimRequest = false |
Used to mark CFs as stale if they don't claim within a certain time. | |
std::uint8_t | address |
The address of the control function. | |
const std::uint8_t | canPortIndex |
The CAN channel index of the control function. | |
Static Protected Attributes | |
static Mutex | controlFunctionProcessingMutex |
Protects the control function tables. | |
Friends | |
class | CANNetworkManager |
The network manager needs access to the control function's internals. | |
A class that describes an ISO11783 control function, which includes a NAME and address.
Definition at line 27 of file can_control_function.hpp.
|
strong |
The type of the control function.
Definition at line 31 of file can_control_function.hpp.
|
protected |
The protected constructor for the control function, which is called by the (inherited) factory function.
[in] | NAMEValue | The NAME of the control function |
[in] | addressValue | The current address of the control function |
[in] | CANPort | The CAN channel index that the control function communicates on |
[in] | type | The 'Type' of control function to create |
Definition at line 22 of file can_control_function.cpp.
|
static |
The factory function to construct a control function.
[in] | NAMEValue | The NAME of the control function |
[in] | addressValue | The current address of the control function |
[in] | CANPort | The CAN channel index that the control function communicates on |
Definition at line 30 of file can_control_function.cpp.
|
virtual |
Destroys this control function, by removing it from the network manager.
[in] | expectedRefCount | The expected number of shared pointers to this control function after removal |
Reimplemented in isobus::InternalControlFunction.
Definition at line 38 of file can_control_function.cpp.
std::uint8_t isobus::ControlFunction::get_address | ( | ) | const |
Returns the current address of the control function.
Definition at line 47 of file can_control_function.cpp.
bool isobus::ControlFunction::get_address_valid | ( | ) | const |
Describes if the control function has a valid address (not NULL or global)
Definition at line 52 of file can_control_function.cpp.
std::uint8_t isobus::ControlFunction::get_can_port | ( | ) | const |
Returns the CAN channel index the control function communicates on.
Definition at line 57 of file can_control_function.cpp.
NAME isobus::ControlFunction::get_NAME | ( | ) | const |
Returns the NAME of the control function as described by its address claim message.
Definition at line 62 of file can_control_function.cpp.
ControlFunction::Type isobus::ControlFunction::get_type | ( | ) | const |
Returns the Type
of the control function.
Definition at line 67 of file can_control_function.cpp.
std::string isobus::ControlFunction::get_type_string | ( | ) | const |
Returns the 'Type' of the control function as a string.
Definition at line 72 of file can_control_function.cpp.
|
friend |
The network manager needs access to the control function's internals.
Definition at line 84 of file can_control_function.hpp.
|
protected |
The address of the control function.
Definition at line 89 of file can_control_function.hpp.
|
protected |
The CAN channel index of the control function.
Definition at line 90 of file can_control_function.hpp.
|
protected |
Used to mark CFs as stale if they don't claim within a certain time.
Definition at line 88 of file can_control_function.hpp.
|
protected |
The NAME of the control function.
Definition at line 87 of file can_control_function.hpp.
|
staticprotected |
Protects the control function tables.
Definition at line 85 of file can_control_function.hpp.
|
protected |
The Type of the control function.
Definition at line 86 of file can_control_function.hpp.