Unit Entry.
More...
#include <device_management.h>
|
static constexpr uint16_t | min_size |
| Minimum pack/unpack required data size.
|
|
Unit Entry.
Definition at line 108 of file device_management.h.
◆ Unit() [1/2]
HF::Core::DeviceManagement::Unit::Unit |
( |
uint8_t |
id = 0 , |
|
|
uint16_t |
profile = 0 |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
[in] | id | unit id. |
[in] | profile | unit UID / Profile UID. |
Definition at line 122 of file device_management.h.
uint16_t profile
Unit UID.
◆ Unit() [2/2]
Constructor.
- Parameters
-
Definition at line 131 of file device_management.h.
uint16_t profile
Unit UID.
virtual uint8_t id() const =0
Get the id number of this unit on the device.
virtual uint16_t uid() const =0
Return this profile HAN-FUN UID.
virtual std::vector< Common::Interface > interfaces() const =0
Return a vector containing a list of extra interfaces, other than the interfaces specified by the pro...
std::vector< Common::Interface > interfaces
Optional interfaces.
◆ has_interface()
bool HF::Core::DeviceManagement::Unit::has_interface |
( |
uint16_t |
itf_uid, |
|
|
HF::Interface::Role |
role |
|
) |
| const |
This method checks if the remote device unit implements the given interface.
The known interfaces for the profile associated with this unit and the declared optional interfaces are searched, to check if the requested interface is available.
- Parameters
-
[in] | itf_uid | the interface UID to check if the profile implements. |
[in] | role | the interface role to match. |
- Return values
-
true | if this unit implements the requested interface, |
false | otherwise. |
◆ pack()
uint16_t HF::Core::DeviceManagement::Unit::pack |
( |
Common::ByteArray & |
array, |
|
|
uint16_t |
offset = 0 |
|
) |
| const |
Write the object on to a ByteArray so it can be sent over the network.
The buffer passed in MUST have enough size to hold the serialized object, e.g.,
Serializable obj;
ByteArray payload(obj.size());
obj.pack(payload);
- Parameters
-
[in,out] | array | ByteArray reference to write the object to. |
[in] | offset | offset to start writing to. |
- Returns
- the number of bytes written.
◆ size()
uint16_t HF::Core::DeviceManagement::Unit::size |
( |
| ) |
const |
Number bytes needed to serialize the message.
- Returns
- number of bytes the message requires to be serialized.
◆ unpack()
uint16_t HF::Core::DeviceManagement::Unit::unpack |
( |
const Common::ByteArray & |
array, |
|
|
uint16_t |
offset = 0 |
|
) |
| |
Read a message from a ByteArray.
- Parameters
-
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
- Returns
- the number of bytes read.
◆ id
uint8_t HF::Core::DeviceManagement::Unit::id |
◆ profile
uint16_t HF::Core::DeviceManagement::Unit::profile |
The documentation for this struct was generated from the following file: