11#ifndef CAN_CONTROL_FUNCTION_HPP
12#define CAN_CONTROL_FUNCTION_HPP
15#include "isobus/utility/thread_synchronization.hpp"
45 static std::shared_ptr<ControlFunction>
create(
NAME NAMEValue, std::uint8_t addressValue, std::uint8_t CANPort);
50 virtual bool destroy(std::uint32_t expectedRefCount = 1);
A class that represents a control function's NAME.
The main CAN network manager object, handles protocol management and updating other stack components....
A class that describes an ISO11783 control function, which includes a NAME and address.
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 claimedAddressSinceLastAddressClaimRequest
Used to mark CFs as stale if they don't claim within a certain time.
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...