AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
Each device shall have one single DeviceObject in its device descriptor object pool. see A.2 in ISO11783-10. More...
#include <isobus_task_controller_client_objects.hpp>
Public Member Functions | |
DeviceObject (std::string deviceDesignator, std::string deviceSoftwareVersion, std::string deviceSerialNumber, std::string deviceStructureLabel, std::array< std::uint8_t, 7 > deviceLocalizationLabel, std::vector< std::uint8_t > deviceExtendedStructureLabel, std::uint64_t clientIsoNAME, bool shouldUseExtendedStructureLabel) | |
Constructor for a DeviceObject. | |
~DeviceObject () override=default | |
Destructor for a DeviceObject. | |
std::string | get_table_id () const override |
Returns the XML namespace for the object. | |
ObjectTypes | get_object_type () const override |
Returns the object type. | |
std::vector< std::uint8_t > | get_binary_object () const override |
Returns the binary representation of the TC object, or an empty vector if object is invalid. | |
std::string | get_software_version () const |
Returns the software version of the device. | |
void | set_software_version (const std::string &version) |
Sets the software version for the device, as reported in the DDOP. | |
std::string | get_serial_number () const |
Returns the serial number for the device. | |
void | set_serial_number (const std::string &serial) |
Sets the serial number for the device as reported in the DDOP. | |
std::string | get_structure_label () const |
Returns the structure label for this DDOP. | |
void | set_structure_label (const std::string &label) |
Sets the device structure label to a new value. | |
std::array< std::uint8_t, 7 > | get_localization_label () const |
Returns the localization label for this DDOP. | |
void | set_localization_label (std::array< std::uint8_t, 7 > label) |
Changes the localization label to a new value. | |
std::vector< std::uint8_t > | get_extended_structure_label () const |
Returns the extended structure label (if applicable) | |
void | set_extended_structure_label (const std::vector< std::uint8_t > &label) |
Sets the extended structure label to a new value. Only used for TCs with version 4+. | |
std::uint64_t | get_iso_name () const |
Returns the ISO NAME associated with this DDOP. | |
void | set_iso_name (std::uint64_t name) |
Changes the stored ISO NAME to a new value. | |
bool | get_use_extended_structure_label () const |
Returns if the class will append the extended structure label to its serialized form. | |
void | set_use_extended_structure_label (bool shouldUseExtendedStructureLabel) |
Sets the class' behavior for dealing with the extended structure label. | |
Public Member Functions inherited from isobus::task_controller_object::Object | |
Object (std::string objectDesignator, std::uint16_t uniqueID) | |
Constructor for the TC object base class. | |
virtual | ~Object ()=default |
Destructor for a TC Object. | |
std::string | get_designator () const |
Returns the Descriptive text for this object, UTF-8 encoded, 32 characters max. | |
void | set_designator (const std::string &newDesignator) |
Updates the designator to a new value. | |
std::uint16_t | get_object_id () const |
Returns the object ID of the object. | |
void | set_object_id (std::uint16_t id) |
Updates the object ID of the object to a new value. | |
Static Public Attributes | |
static constexpr std::size_t | MAX_STRUCTURE_AND_LOCALIZATION_LABEL_LENGTH = 7 |
Defines the max length of the device structure label and device localization label (in bytes) | |
static constexpr std::size_t | MAX_EXTENDED_STRUCTURE_LABEL_LENGTH = 32 |
Defines the max length of the device extended structure label (in bytes) | |
Static Public Attributes inherited from isobus::task_controller_object::Object | |
static constexpr std::uint16_t | MAX_OBJECT_ID = 65534 |
The max allowable "valid" object ID. | |
static constexpr std::size_t | MAX_DESIGNATOR_LENGTH = 128 |
Defines the max length of a designator (in bytes) | |
static constexpr std::size_t | MAX_DESIGNATOR_LEGACY_LENGTH = 32 |
Defines the max length of a designator (in bytes) for TCs older than version 4. | |
Private Attributes | |
std::string | serialNumber |
Device and manufacturer-specific serial number of the Device. | |
std::string | softwareVersion |
Software version of the device. | |
std::string | structureLabel |
Label given by device to identify the device descriptor structure. | |
std::array< std::uint8_t, task_controller_object::DeviceObject::MAX_STRUCTURE_AND_LOCALIZATION_LABEL_LENGTH > | localizationLabel |
Label given by device to identify the device descriptor localization. | |
std::vector< std::uint8_t > | extendedStructureLabel |
Continuation of the Label given by Device to identify the Device descriptor Structure. | |
std::uint64_t | NAME |
The NAME of client device as defined in ISO 11783-5. MUST match your address claim. | |
bool | useExtendedStructureLabel |
Tells the device if it should generate binary info using the extended structure label or ignore it. | |
Static Private Attributes | |
static const std::string | tableID = "DVC" |
XML element namespace for device. | |
Additional Inherited Members | |
Protected Attributes inherited from isobus::task_controller_object::Object | |
std::string | designator |
UTF-8 Descriptive text to identify this object. Max length of 32. | |
std::uint16_t | objectID |
Unique object ID in the DDOP. | |
Each device shall have one single DeviceObject in its device descriptor object pool. see A.2 in ISO11783-10.
Definition at line 88 of file isobus_task_controller_client_objects.hpp.
isobus::task_controller_object::DeviceObject::DeviceObject | ( | std::string | deviceDesignator, |
std::string | deviceSoftwareVersion, | ||
std::string | deviceSerialNumber, | ||
std::string | deviceStructureLabel, | ||
std::array< std::uint8_t, 7 > | deviceLocalizationLabel, | ||
std::vector< std::uint8_t > | deviceExtendedStructureLabel, | ||
std::uint64_t | clientIsoNAME, | ||
bool | shouldUseExtendedStructureLabel ) |
Constructor for a DeviceObject.
[in] | deviceDesignator | Descriptive text for the object, UTF-8, 32-128 chars max depending on TC version |
[in] | deviceSoftwareVersion | Software version indicating text (UTF-8) |
[in] | deviceSerialNumber | Device and manufacturer-specific serial number of the Device (UTF-8) |
[in] | deviceStructureLabel | This label allows the device to identify the current version of the device descriptor object pool (byte array /ascii) |
[in] | deviceLocalizationLabel | Defined by the language command PGN (ascii / byte array) |
[in] | deviceExtendedStructureLabel | Continuation of the Label given by Device to identify the Device descriptor Structure (byte array) |
[in] | clientIsoNAME | NAME of client device as defined in ISO 11783-5 |
[in] | shouldUseExtendedStructureLabel | If the device should include the extended structure label during binary serialization |
Definition at line 50 of file isobus_task_controller_client_objects.cpp.
|
overridevirtual |
Returns the binary representation of the TC object, or an empty vector if object is invalid.
Implements isobus::task_controller_object::Object.
Definition at line 79 of file isobus_task_controller_client_objects.cpp.
std::vector< std::uint8_t > isobus::task_controller_object::DeviceObject::get_extended_structure_label | ( | ) | const |
Returns the extended structure label (if applicable)
Definition at line 190 of file isobus_task_controller_client_objects.cpp.
std::uint64_t isobus::task_controller_object::DeviceObject::get_iso_name | ( | ) | const |
Returns the ISO NAME associated with this DDOP.
Definition at line 200 of file isobus_task_controller_client_objects.cpp.
std::array< std::uint8_t, task_controller_object::DeviceObject::MAX_STRUCTURE_AND_LOCALIZATION_LABEL_LENGTH > isobus::task_controller_object::DeviceObject::get_localization_label | ( | ) | const |
Returns the localization label for this DDOP.
Definition at line 180 of file isobus_task_controller_client_objects.cpp.
|
overridevirtual |
Returns the object type.
Implements isobus::task_controller_object::Object.
Definition at line 74 of file isobus_task_controller_client_objects.cpp.
std::string isobus::task_controller_object::DeviceObject::get_serial_number | ( | ) | const |
Returns the serial number for the device.
Definition at line 160 of file isobus_task_controller_client_objects.cpp.
std::string isobus::task_controller_object::DeviceObject::get_software_version | ( | ) | const |
Returns the software version of the device.
Definition at line 150 of file isobus_task_controller_client_objects.cpp.
std::string isobus::task_controller_object::DeviceObject::get_structure_label | ( | ) | const |
Returns the structure label for this DDOP.
Definition at line 170 of file isobus_task_controller_client_objects.cpp.
|
overridevirtual |
Returns the XML namespace for the object.
Implements isobus::task_controller_object::Object.
Definition at line 69 of file isobus_task_controller_client_objects.cpp.
bool isobus::task_controller_object::DeviceObject::get_use_extended_structure_label | ( | ) | const |
Returns if the class will append the extended structure label to its serialized form.
This is TC version 4 behavior. For version 3, this should return false.
true
if the class will append the extended structure label to its serialized form, otherwise false
Definition at line 210 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceObject::set_extended_structure_label | ( | const std::vector< std::uint8_t > & | label | ) |
Sets the extended structure label to a new value. Only used for TCs with version 4+.
[in] | label | The extended structure label to report or an empty vector if none is being used. |
Definition at line 195 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceObject::set_iso_name | ( | std::uint64_t | name | ) |
Changes the stored ISO NAME to a new value.
[in] | name | The new ISO NAME to set |
Definition at line 205 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceObject::set_localization_label | ( | std::array< std::uint8_t, 7 > | label | ) |
Changes the localization label to a new value.
[in] | label | The new label to set |
Definition at line 185 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceObject::set_serial_number | ( | const std::string & | serial | ) |
Sets the serial number for the device as reported in the DDOP.
[in] | serial | The serial number to set as a UTF-8 string (or ascii) |
Definition at line 165 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceObject::set_software_version | ( | const std::string & | version | ) |
Sets the software version for the device, as reported in the DDOP.
[in] | version | The software version to set as a UTF-8 string (or ascii). |
Definition at line 155 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceObject::set_structure_label | ( | const std::string & | label | ) |
Sets the device structure label to a new value.
[in] | label | The new structure label to set |
Definition at line 175 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceObject::set_use_extended_structure_label | ( | bool | shouldUseExtendedStructureLabel | ) |
Sets the class' behavior for dealing with the extended structure label.
When this is set to true, the class will use TC version 4 behavior for the extended structure label. When it is false, it will use < version 4 behavior (the label will not be included in the binary object).
[in] | shouldUseExtendedStructureLabel | true to use version 4 behavior, false to use earlier version behavior |
Definition at line 215 of file isobus_task_controller_client_objects.cpp.
|
private |
Continuation of the Label given by Device to identify the Device descriptor Structure.
Definition at line 195 of file isobus_task_controller_client_objects.hpp.
|
private |
Label given by device to identify the device descriptor localization.
Definition at line 194 of file isobus_task_controller_client_objects.hpp.
|
staticconstexpr |
Defines the max length of the device extended structure label (in bytes)
Definition at line 187 of file isobus_task_controller_client_objects.hpp.
|
staticconstexpr |
Defines the max length of the device structure label and device localization label (in bytes)
Definition at line 184 of file isobus_task_controller_client_objects.hpp.
|
private |
The NAME of client device as defined in ISO 11783-5. MUST match your address claim.
Definition at line 196 of file isobus_task_controller_client_objects.hpp.
|
private |
Device and manufacturer-specific serial number of the Device.
Definition at line 191 of file isobus_task_controller_client_objects.hpp.
|
private |
Software version of the device.
Definition at line 192 of file isobus_task_controller_client_objects.hpp.
|
private |
Label given by device to identify the device descriptor structure.
Definition at line 193 of file isobus_task_controller_client_objects.hpp.
|
staticprivate |
XML element namespace for device.
Definition at line 190 of file isobus_task_controller_client_objects.hpp.
|
private |
Tells the device if it should generate binary info using the extended structure label or ignore it.
Definition at line 197 of file isobus_task_controller_client_objects.hpp.