HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Core::GroupManagement::Message Struct Reference

Parent class for the message payload for a HF::GroupManagement::ADD_CMD and HF::GroupManagement::REMOVE_CMD requests. More...

#include <group_management.h>

+ Inheritance diagram for HF::Core::GroupManagement::Message:
+ Collaboration diagram for HF::Core::GroupManagement::Message:

Public Member Functions

 Message (uint16_t group, uint16_t device, uint8_t unit)
 Constructor. More...
 
 Message ()
 Empty Constructor. More...
 
uint16_t size () const
 Number bytes needed to serialize the message. More...
 
uint16_t pack (Common::ByteArray &array, uint16_t offset=0) const
 Write the object on to a ByteArray so it can be sent over the network. More...
 
uint16_t unpack (const Common::ByteArray &array, uint16_t offset=0)
 Read a message from a ByteArray. More...
 
- Public Member Functions inherited from HF::Core::GroupManagement::GroupAddress
 GroupAddress (uint16_t address=0)
 Constructor. More...
 
uint16_t size () const
 Number bytes needed to serialize the message. More...
 
uint16_t pack (Common::ByteArray &array, uint16_t offset=0) const
 Write the object on to a ByteArray so it can be sent over the network. More...
 
uint16_t unpack (const Common::ByteArray &array, uint16_t offset=0)
 Read a message from a ByteArray. More...
 
- Public Member Functions inherited from HF::Protocol::Address
 Address (uint16_t _dev=BROADCAST_ADDR, uint8_t _unit=BROADCAST_UNIT, Type _mod=DEVICE)
 Create a new message address. More...
 
uint16_t size () const
 Number bytes needed to serialize the message. More...
 
uint16_t pack (Common::ByteArray &array, uint16_t offset=0) const
 Write the object on to a ByteArray so it can be sent over the network. More...
 
uint16_t unpack (const Common::ByteArray &array, uint16_t offset=0)
 Read a message from a ByteArray. More...
 
bool is_broadcast ()
 Checks if this address if for the Protocol::BROADCAST_ADDR and Protocol::BROADCAST_UNIT. More...
 
bool is_local (uint16_t address)
 Checks if the given device address is equal to the device address present in this Protocol::Address object. More...
 
int compare (const Address &other) const
 Compare this address with the given address in other. More...
 

Static Public Attributes

static constexpr uint16_t min_size
 Minimum pack/unpack required data size.
 
- Static Public Attributes inherited from HF::Core::GroupManagement::GroupAddress
static constexpr uint16_t NO_ADDR = 0x0000
 Empty Group Address. More...
 
static constexpr uint16_t START_ADDR = 0x0001
 First HAN-FUN Group Address. More...
 
static constexpr uint16_t END_ADDR = 0x7FFF
 Last HAN-FUN Group Address. More...
 
static constexpr uint16_t min_size = sizeof(uint16_t)
 Minimum pack/unpack required data size.
 
- Static Public Attributes inherited from HF::Protocol::Address
static constexpr uint16_t min_size
 Minimum pack/unpack required data size.
 

Additional Inherited Members

- Public Types inherited from HF::Protocol::Address
enum  Type { DEVICE = 0, GROUP = 1 }
 HAN-FUN Network Destination Address Types. More...
 
- Data Fields inherited from HF::Core::GroupManagement::GroupAddress
uint16_t address
 Group Address
 
- Data Fields inherited from HF::Protocol::Address
uint16_t mod: 1
 Address modifier. More...
 
uint16_t device: 15
 Device Address. More...
 
uint8_t unit
 Source Unit. More...
 

Detailed Description

Parent class for the message payload for a HF::GroupManagement::ADD_CMD and HF::GroupManagement::REMOVE_CMD requests.

Definition at line 447 of file group_management.h.

Constructor & Destructor Documentation

◆ Message() [1/2]

HF::Core::GroupManagement::Message::Message ( uint16_t  group,
uint16_t  device,
uint8_t  unit 
)
inline

Constructor.

Parameters
[in]groupthe group's address.
[in]devicethe device's address to add/remove to/from the group.
[in]unitthe device's unit ID to add/remove to/from the group.

Definition at line 456 of file group_management.h.

456  :
457  GroupAddress(group), Protocol::Address(device, unit)
458  {}
uint8_t unit
Source Unit.
Definition: protocol.h:206
uint16_t device
Device Address.
Definition: protocol.h:204
GroupAddress(uint16_t address=0)
Constructor.

◆ Message() [2/2]

HF::Core::GroupManagement::Message::Message ( )
inline

Empty Constructor.

Mainly used for the unpack function.

Definition at line 465 of file group_management.h.

466  {}

Member Function Documentation

◆ pack()

uint16_t HF::Core::GroupManagement::Message::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]arrayByteArray reference to write the object to.
[in]offsetoffset to start writing to.
Returns
the number of bytes written.

◆ size()

uint16_t HF::Core::GroupManagement::Message::size ( ) const

Number bytes needed to serialize the message.

Returns
number of bytes the message requires to be serialized.

◆ unpack()

uint16_t HF::Core::GroupManagement::Message::unpack ( const Common::ByteArray array,
uint16_t  offset = 0 
)

Read a message from a ByteArray.

Parameters
[in]arrayByteArray reference to read the message from.
[in]offsetoffset to start reading from.
Returns
the number of bytes read.

The documentation for this struct was generated from the following file: