ControlFunction API

class ControlFunction

A class that describes an ISO11783 control function, which includes a NAME and address.

Subclassed by isobus::InternalControlFunction, isobus::PartneredControlFunction

Public Types

enum class Type

The type of the control function.

Values:

enumerator Internal

The control function is part of our stack and can address claim.

enumerator External

The control function is some other device on the bus.

enumerator Partnered

An external control function that you explicitly want to talk to.

Public Functions

ControlFunction(NAME NAMEValue, std::uint8_t addressValue, std::uint8_t CANPort, Type type = Type::External)

The constructor of a control function. In most cases use CANNetworkManager::create_internal_control_function() or CANNetworkManager::create_partnered_control_function() instead, only use this constructor if you have advanced needs.

Parameters:
  • NAMEValue[in] The NAME of the control function

  • addressValue[in] The current address of the control function

  • CANPort[in] The CAN channel index that the control function communicates on

  • type[in] The ‘Type’ of control function to create

std::uint8_t get_address() const

Returns the current address of the control function.

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)

Returns:

true if the address is < 0xFE

std::uint8_t get_can_port() const

Returns the CAN channel index the control function communicates on.

Returns:

The control function’s CAN channel index

NAME get_NAME() const

Returns the NAME of the control function as described by its address claim message.

Returns:

The control function’s NAME

Type get_type() const

Returns the Type of the control function.

Returns:

The control function type

std::string get_type_string() const

Returns the ‘Type’ of the control function as a string.

Returns:

The control function type as a string