AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
isobus::task_controller_object::DeviceObject Class Reference

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>

Inheritance diagram for isobus::task_controller_object::DeviceObject:
[legend]
Collaboration diagram for isobus::task_controller_object::DeviceObject:
[legend]

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_LENGTHlocalizationLabel
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DeviceObject()

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.

Parameters
[in]deviceDesignatorDescriptive text for the object, UTF-8, 32-128 chars max depending on TC version
[in]deviceSoftwareVersionSoftware version indicating text (UTF-8)
[in]deviceSerialNumberDevice and manufacturer-specific serial number of the Device (UTF-8)
[in]deviceStructureLabelThis label allows the device to identify the current version of the device descriptor object pool (byte array /ascii)
[in]deviceLocalizationLabelDefined by the language command PGN (ascii / byte array)
[in]deviceExtendedStructureLabelContinuation of the Label given by Device to identify the Device descriptor Structure (byte array)
[in]clientIsoNAMENAME of client device as defined in ISO 11783-5
[in]shouldUseExtendedStructureLabelIf the device should include the extended structure label during binary serialization

Definition at line 50 of file isobus_task_controller_client_objects.cpp.

Member Function Documentation

◆ get_binary_object()

std::vector< std::uint8_t > isobus::task_controller_object::DeviceObject::get_binary_object ( ) const
overridevirtual

Returns the binary representation of the TC object, or an empty vector if object is invalid.

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.

Here is the call graph for this function:

◆ get_extended_structure_label()

std::vector< std::uint8_t > isobus::task_controller_object::DeviceObject::get_extended_structure_label ( ) const

Returns the extended structure label (if applicable)

Returns
The extended structure label (if applicable)

Definition at line 190 of file isobus_task_controller_client_objects.cpp.

◆ get_iso_name()

std::uint64_t isobus::task_controller_object::DeviceObject::get_iso_name ( ) const

Returns the ISO NAME associated with this DDOP.

Returns
The raw ISO NAME associated with this DDOP

Definition at line 200 of file isobus_task_controller_client_objects.cpp.

◆ get_localization_label()

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.

Returns
The localization label for this DDOP

Definition at line 180 of file isobus_task_controller_client_objects.cpp.

◆ get_object_type()

ObjectTypes isobus::task_controller_object::DeviceObject::get_object_type ( ) const
overridevirtual

Returns the object type.

Returns
The object type for this object (Object::Device)

Implements isobus::task_controller_object::Object.

Definition at line 74 of file isobus_task_controller_client_objects.cpp.

◆ get_serial_number()

std::string isobus::task_controller_object::DeviceObject::get_serial_number ( ) const

Returns the serial number for the device.

Returns
The serial number for the device

Definition at line 160 of file isobus_task_controller_client_objects.cpp.

◆ get_software_version()

std::string isobus::task_controller_object::DeviceObject::get_software_version ( ) const

Returns the software version of the device.

Returns
The software version of the device

Definition at line 150 of file isobus_task_controller_client_objects.cpp.

◆ get_structure_label()

std::string isobus::task_controller_object::DeviceObject::get_structure_label ( ) const

Returns the structure label for this DDOP.

Returns
The structure label for this DDOP

Definition at line 170 of file isobus_task_controller_client_objects.cpp.

◆ get_table_id()

std::string isobus::task_controller_object::DeviceObject::get_table_id ( ) const
overridevirtual

Returns the XML namespace for the object.

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.

◆ get_use_extended_structure_label()

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.

Returns
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.

◆ set_extended_structure_label()

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+.

Parameters
[in]labelThe 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.

◆ set_iso_name()

void isobus::task_controller_object::DeviceObject::set_iso_name ( std::uint64_t name)

Changes the stored ISO NAME to a new value.

Parameters
[in]nameThe new ISO NAME to set

Definition at line 205 of file isobus_task_controller_client_objects.cpp.

◆ set_localization_label()

void isobus::task_controller_object::DeviceObject::set_localization_label ( std::array< std::uint8_t, 7 > label)

Changes the localization label to a new value.

Parameters
[in]labelThe new label to set

Definition at line 185 of file isobus_task_controller_client_objects.cpp.

◆ set_serial_number()

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.

Parameters
[in]serialThe serial number to set as a UTF-8 string (or ascii)

Definition at line 165 of file isobus_task_controller_client_objects.cpp.

◆ set_software_version()

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.

Parameters
[in]versionThe software version to set as a UTF-8 string (or ascii).

Definition at line 155 of file isobus_task_controller_client_objects.cpp.

◆ set_structure_label()

void isobus::task_controller_object::DeviceObject::set_structure_label ( const std::string & label)

Sets the device structure label to a new value.

Parameters
[in]labelThe new structure label to set

Definition at line 175 of file isobus_task_controller_client_objects.cpp.

◆ set_use_extended_structure_label()

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).

Parameters
[in]shouldUseExtendedStructureLabeltrue to use version 4 behavior, false to use earlier version behavior

Definition at line 215 of file isobus_task_controller_client_objects.cpp.

Member Data Documentation

◆ extendedStructureLabel

std::vector<std::uint8_t> isobus::task_controller_object::DeviceObject::extendedStructureLabel
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.

◆ localizationLabel

std::array<std::uint8_t, task_controller_object::DeviceObject::MAX_STRUCTURE_AND_LOCALIZATION_LABEL_LENGTH> isobus::task_controller_object::DeviceObject::localizationLabel
private

Label given by device to identify the device descriptor localization.

Definition at line 194 of file isobus_task_controller_client_objects.hpp.

◆ MAX_EXTENDED_STRUCTURE_LABEL_LENGTH

constexpr std::size_t isobus::task_controller_object::DeviceObject::MAX_EXTENDED_STRUCTURE_LABEL_LENGTH = 32
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.

◆ MAX_STRUCTURE_AND_LOCALIZATION_LABEL_LENGTH

constexpr std::size_t isobus::task_controller_object::DeviceObject::MAX_STRUCTURE_AND_LOCALIZATION_LABEL_LENGTH = 7
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.

◆ NAME

std::uint64_t isobus::task_controller_object::DeviceObject::NAME
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.

◆ serialNumber

std::string isobus::task_controller_object::DeviceObject::serialNumber
private

Device and manufacturer-specific serial number of the Device.

Definition at line 191 of file isobus_task_controller_client_objects.hpp.

◆ softwareVersion

std::string isobus::task_controller_object::DeviceObject::softwareVersion
private

Software version of the device.

Definition at line 192 of file isobus_task_controller_client_objects.hpp.

◆ structureLabel

std::string isobus::task_controller_object::DeviceObject::structureLabel
private

Label given by device to identify the device descriptor structure.

Definition at line 193 of file isobus_task_controller_client_objects.hpp.

◆ tableID

const std::string isobus::task_controller_object::DeviceObject::tableID = "DVC"
staticprivate

XML element namespace for device.

Definition at line 190 of file isobus_task_controller_client_objects.hpp.

◆ useExtendedStructureLabel

bool isobus::task_controller_object::DeviceObject::useExtendedStructureLabel
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.


The documentation for this class was generated from the following files: