AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
can_partnered_control_function.hpp
Go to the documentation of this file.
1//================================================================================================
10//================================================================================================
11
12#ifndef CAN_PARTNERED_CONTROL_FUNCTION_HPP
13#define CAN_PARTNERED_CONTROL_FUNCTION_HPP
14
20
21#include <vector>
22
23namespace isobus
24{
25 class CANNetworkManager;
26 class InternalControlFunction;
27
28 //================================================================================================
37 //================================================================================================
39 {
40 public:
45 static std::shared_ptr<PartneredControlFunction> create(std::uint8_t CANPort, const std::vector<NAMEFilter> NAMEFilters);
46
50 PartneredControlFunction(std::uint8_t CANPort, const std::vector<NAMEFilter> NAMEFilters, CANLibBadge<PartneredControlFunction>);
51
54
68 void add_parameter_group_number_callback(std::uint32_t parameterGroupNumber, CANLibCallback callback, void *parent, std::shared_ptr<InternalControlFunction> internalControlFunction = nullptr);
69
75 void remove_parameter_group_number_callback(std::uint32_t parameterGroupNumber, CANLibCallback callback, void *parent, std::shared_ptr<InternalControlFunction> internalControlFunction = nullptr);
76
80
83 std::size_t get_number_name_filters() const;
84
89
95 bool get_name_filter_parameter(std::size_t index, NAME::NAMEParameters &parameter, std::uint32_t &filterValue) const;
96
100 bool check_matches_name(NAME NAMEToCheck) const;
101
102 private:
103 friend class CANNetworkManager;
104
106 static std::shared_ptr<ControlFunction> create(NAME, std::uint8_t, std::uint8_t) = delete;
107
112
113 const std::vector<NAMEFilter> NAMEFilterList;
114 std::vector<ParameterGroupNumberCallbackData> parameterGroupNumberCallbacks;
115 bool initialized = false;
116 };
117
118} // namespace isobus
119
120#endif // CAN_PARTNERED_CONTROL_FUNCTION
Defines a filter value for an ISONAME component. Used to tell the stack what kind of ECU you want to ...
Defines a class for managing the address claiming process.
A way to only allow certain object types to access certain functions that is enforced at compile time...
An object to represent common callbacks used within this CAN stack.
Defines a base class to represent a generic ISOBUS control function.
This is a way to protect functions on public interfaces from being accessed by objects that shouldn't...
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.
A class that represents an ISO11783 control function NAME from an address claim.
Definition can_NAME.hpp:24
NAMEParameters
The encoded components that comprise a NAME.
Definition can_NAME.hpp:28
A storage class to hold data about callbacks for a specific PGN.
This represents any device on the bus you want to talk to.
bool check_matches_name(NAME NAMEToCheck) const
Checks to see if a NAME matches this CF's NAME filters.
std::size_t get_number_name_filters_with_parameter_type(NAME::NAMEParameters parameter)
Returns the number of NAME filters with a specific NAME parameter component, like manufacturer code.
std::size_t get_number_parameter_group_number_callbacks() const
Returns the number of parameter group number callbacks associated with this control function.
ParameterGroupNumberCallbackData & get_parameter_group_number_callback(std::size_t index)
Returns a parameter group number associated with this control function by index.
void remove_parameter_group_number_callback(std::uint32_t parameterGroupNumber, CANLibCallback callback, void *parent, std::shared_ptr< InternalControlFunction > internalControlFunction=nullptr)
Removes a callback matching exactly the parameters passed in.
PartneredControlFunction(PartneredControlFunction &)=delete
Deleted copy constructor for PartneredControlFunction to avoid slicing.
void add_parameter_group_number_callback(std::uint32_t parameterGroupNumber, CANLibCallback callback, void *parent, std::shared_ptr< InternalControlFunction > internalControlFunction=nullptr)
This is how you get notified that this control function has sent you a destination specific message.
static std::shared_ptr< PartneredControlFunction > create(std::uint8_t CANPort, const std::vector< NAMEFilter > NAMEFilters)
The factory function to construct a partnered control function.
bool initialized
A way to track if the network manager has processed this CF against existing CFs.
std::vector< ParameterGroupNumberCallbackData > parameterGroupNumberCallbacks
A list of all parameter group number callbacks associated with this control function.
const std::vector< NAMEFilter > NAMEFilterList
A list of NAME parameters that describe this control function's identity.
std::size_t get_number_name_filters() const
Returns the number of NAME filter objects that describe the identity of this control function.
bool get_name_filter_parameter(std::size_t index, NAME::NAMEParameters &parameter, std::uint32_t &filterValue) const
Returns a NAME filter by index.
static std::shared_ptr< ControlFunction > create(NAME, std::uint8_t, std::uint8_t)=delete
Make inherited factory function private so that it can't be called.
PartneredControlFunction(std::uint8_t CANPort, const std::vector< NAMEFilter > NAMEFilters, CANLibBadge< PartneredControlFunction >)
the constructor for a PartneredControlFunction, which is called by the factory function
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...
void(*)(const CANMessage &message, void *parentPointer) CANLibCallback
A callback for control functions to get CAN messages.