23 controlFunctionType(type),
24 controlFunctionNAME(NAMEValue),
25 address(addressValue),
33 auto controlFunction = std::shared_ptr<ControlFunction>(
new ControlFunction(NAMEValue, addressValue, CANPort));
35 return controlFunction;
44 return static_cast<std::uint32_t
>(shared_from_this().use_count()) == expectedRefCount + 1;
General constants used throughout this library.
Defines a base class to represent a generic ISOBUS control function.
The main class that manages the ISOBUS stack including: callbacks, Name to Address management,...
This is a way to protect functions on public interfaces from being accessed by objects that shouldn't...
void on_control_function_destroyed(std::shared_ptr< ControlFunction > controlFunction, CANLibBadge< ControlFunction >)
Informs the network manager that a control function object has been destroyed, so that it can be purg...
static CANNetworkManager CANNetwork
Static singleton of the one network manager. Use this to access stack functionality.
void on_control_function_created(std::shared_ptr< ControlFunction > controlFunction, CANLibBadge< ControlFunction >)
Informs the network manager that a control function object has been created, so that it can be added ...
static Mutex controlFunctionProcessingMutex
Protects the control function tables.
std::string get_type_string() const
Returns the 'Type' of the control function as a string.
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.
static std::shared_ptr< ControlFunction > create(NAME NAMEValue, std::uint8_t addressValue, std::uint8_t CANPort)
The factory function to construct a control function.
std::uint8_t address
The address of the control function.
NAME controlFunctionNAME
The NAME of the control function.
Type
The type of the control function.
@ Internal
The control function is part of our stack and can address claim.
@ External
The control function is some other device on the bus.
@ Partnered
An external control function that you explicitly want to talk to.
NAME get_NAME() const
Returns the NAME of the control function as described by its address claim message.
std::uint8_t get_address() const
Returns the current address of the control function.
const Type controlFunctionType
The Type of the control function.
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 functi...
Type get_type() const
Returns the Type of the control function.
virtual bool destroy(std::uint32_t expectedRefCount=1)
Destroys this control function, by removing it from the network manager.
const std::uint8_t canPortIndex
The CAN channel index of the control function.
A class that represents an ISO11783 control function NAME from an address claim.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...
constexpr std::uint8_t NULL_CAN_ADDRESS
The NULL CAN address defined by J1939 and ISO11783.
constexpr std::uint8_t BROADCAST_CAN_ADDRESS
The global/broadcast CAN address.