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

Group Table Service : Client side implementation. More...

#include <group_table.h>

+ Inheritance diagram for HF::Core::GroupTable::Client:
+ Collaboration diagram for HF::Core::GroupTable::Client:

Public Member Functions

Commands
void add (const Protocol::Address &addr, const Entry &entry)
 Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given network address. More...
 
void add (const uint16_t device, const Entry &entry)
 Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given device and the given entry. More...
 
void add (const Protocol::Address &addr, uint16_t group, uint8_t unit)
 Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given network address, for the given group and unit. More...
 
void add (const uint16_t device, uint16_t group, uint8_t unit)
 Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given device, for the given group and unit. More...
 
void remove (const Protocol::Address &addr, const Entry &entry)
 Send a HAN-FUN message containing a GroupTable::REMOVE_CMD, to the given network address. More...
 
void remove (const uint16_t device, const Entry &entry)
 Send a HAN-FUN message containing a GroupTable::REMOVE_CMD, to the given device and the given entry. More...
 
void remove (const Protocol::Address &addr, uint16_t group, uint8_t unit)
 Send a HAN-FUN message containing a GroupTable::REMOVE_CMD, to the given network address, for the given group and unit. More...
 
void remove (const uint16_t device, uint16_t group, uint8_t unit)
 Send a HAN-FUN message containing a GroupTable::REMOVE_CMD, to the given device, for the given group and unit. More...
 
void remove_all (const Protocol::Address &addr)
 Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the given network address. More...
 
void remove_all (uint16_t device)
 Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the device with the given address. More...
 
void read_entries (const Protocol::Address &addr, const ReadEntries &params)
 Send a HAN-FUN message containing a GroupTable::READ_ENTRIES_CMD, to the given network address. More...
 
void read_entries (const Protocol::Address &addr, const uint8_t offset, const uint8_t count)
 Send a HAN-FUN message containing a GroupTable::READ_ENTRIES_CMD, to the given network address. More...
 
void read_entries (const uint16_t device, const ReadEntries &params)
 Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the device with the given address. More...
 
void read_entries (const uint16_t device, const uint8_t offset, const uint8_t count)
 Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the device with the given address. More...
 
Events
virtual void added (const Protocol::Address &addr, const GroupTable::Response &response)
 Callback for processing the response of a GroupTable::ADD_CMD. More...
 
virtual void removed (const Protocol::Address &addr, const GroupTable::Response &response)
 Callback for processing the response of a GroupTable::REMOVE_CMD. More...
 
virtual void removed_all (const Protocol::Address &addr, const Protocol::Response &response)
 Callback for processing the response of a GroupTable::REMOVE_ALL_CMD. More...
 
virtual void read_entries (const Protocol::Address &addr, const ReadEntriesResponse &response)
 Callback for processing the response of a GroupTable::READ_ENTRIES_CMD. More...
 
- Public Member Functions inherited from HF::Core::ServiceRole< GroupTable::Base, HF::Interface::CLIENT_ROLE >
Interface::Role role () const
 Return the Interface::Role this interface implements. More...
 
- Public Member Functions inherited from HF::Core::Service< HF::Interface::GROUP_TABLE >
uint16_t uid () const
 This method returns the interface UID. More...
 
- Public Member Functions inherited from HF::Core::AbstractService
Unit0unit () const
 The device this unit is associated with.
 
HF::Attributes::IAttributeattribute (uint8_t uid)
 Return a pointer to the interface attribute with the given uid. More...
 
HF::Attributes::UIDS attributes (uint8_t pack_id=HF::Attributes::Pack::MANDATORY) const
 Return a vector containing the attribute UIDs, for the given pack ID. More...
 
- Public Member Functions inherited from HF::Interfaces::AbstractInterface
Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
void periodic (uint32_t time)
 Handle periodic processing. More...
 
HF::Attributes::IAttributeattribute (uint8_t uid)
 Return a pointer to the interface attribute with the given uid. More...
 

Protected Member Functions

Common::Result handle_command (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
uint16_t payload_size (Protocol::Message::Interface &itf) const
 Return the minimal payload size that a message should hold when addressed at the given interface. More...
 
- Protected Member Functions inherited from HF::Core::ServiceRole< GroupTable::Base, HF::Interface::CLIENT_ROLE >
 ServiceRole (Unit0 &unit)
 Constructor. More...
 
- Protected Member Functions inherited from HF::Core::GroupTable::Base
 Base (Unit0 &unit)
 Constructor.
 
- Protected Member Functions inherited from HF::Core::Service< HF::Interface::GROUP_TABLE >
 Service (Unit0 &unit)
 Constructor. More...
 
bool check_uid (uint16_t uid) const
 Check if the given uid value matches the service's UID value. More...
 
- Protected Member Functions inherited from HF::Core::AbstractService
 AbstractService (Unit0 &unit)
 Constructor. More...
 
void send (const Protocol::Address &addr, Protocol::Message &message)
 Send message msg to the network address given by addr. More...
 
void send (const Protocol::Address &addr, Protocol::Message &message, Transport::Link *link)
 Create and send a new packet with the given message to the given address. More...
 
- Protected Member Functions inherited from HF::Interfaces::AbstractInterface
virtual void notify (const HF::Attributes::IAttribute &old_value, const HF::Attributes::IAttribute &new_value) const
 Notify that an attribute value as changed. More...
 
Common::Result check (Protocol::Message &message, Common::ByteArray &payload, uint16_t offset)
 Check if message has correct attributes to be processed by the interface. More...
 
Common::Result check_payload_size (Protocol::Message &message, Common::ByteArray &payload, uint16_t offset)
 Check if payload data size if sufficient for processing the message. More...
 
virtual uint16_t payload_size (Protocol::Message &message) const
 Return the minimal payload size that should be present for the given message. More...
 
template<typename _Message >
uint16_t payload_size_helper () const
 Helper function template to retrieve minimum size required for serializing/deserializing the class given. More...
 
virtual Common::Result handle_attribute (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 

Additional Inherited Members

- Public Types inherited from HF::Interface
enum  Role { CLIENT_ROLE = 0, SERVER_ROLE = 1 }
 Interface roles. More...
 
enum  UID {
  DEVICE_MANAGEMENT = 0x0001, BIND_MANAGEMENT = 0x0002, GROUP_MANAGEMENT = 0x0003, IDENTIFY = 0x0004,
  DEVICE_INFORMATION = 0x0005, ATTRIBUTE_REPORTING = 0x0006, BATCH_PROGRAM_MANAGEMENT = 0x0007, EVENT_SCHEDULING = 0x0008,
  WEEKLY_SCHEDULING = 0x0009, GROUP_TABLE = 0x000A, TAMPER_ALERT = 0x0101, TIME = 0x0102,
  POWER = 0x0110, KEEP_ALIVE = 0x0115, RSSI = 0x0111, SUOTA = 0x0400,
  ALERT = 0x0100, ON_OFF = 0x0200, LEVEL_CONTROL = 0x0201, COLOUR_CONTROL = 0x0202,
  SIMPLE_KEYPAD = 0x0203, SIMPLE_POWER_METER = 0x0300, SIMPLE_TEMPERATURE = 0x0301, SIMPLE_HUMIDITY = 0x0302,
  SIMPLE_THERMOSTAT = 0x0303, SIMPLE_BUTTON = 0x0304, SIMPLE_VISUAL_EFFECTS = 0x0305, SIMPLE_AIR_PRESSURE = 0x0306,
  SIMPLE_LIGHT_SENSOR = 0x0307, RESERVED = 0x7F00, MAX_UID = 0x7FFE, ANY_UID = 0x7FFF
}
 Interfaces Unique Identifiers (UID). More...
 
- Static Public Attributes inherited from HF::Interface
static constexpr uint8_t MAX_CMD_ID = 0xFF
 Maximum value for command IDs in interfaces.
 
- Protected Attributes inherited from HF::Core::AbstractService
Unit0_unit
 Reference to the unit the service belongs to.
 

Detailed Description

Group Table Service : Client side implementation.

This class provides the client side of the Group Table interface.

Definition at line 610 of file group_table.h.

Member Function Documentation

◆ add() [1/4]

void HF::Core::GroupTable::Client::add ( const Protocol::Address addr,
const Entry entry 
)

Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given network address.

Parameters
[in]addrthe network address to send the message to.
[in]entrythe group table entry to add.

Referenced by add().

+ Here is the caller graph for this function:

◆ add() [2/4]

void HF::Core::GroupTable::Client::add ( const uint16_t  device,
const Entry entry 
)
inline

Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given device and the given entry.

Parameters
[in]devicethe device address to send the entry to.
[in]entrythe group table entry to add.

Definition at line 638 of file group_table.h.

References add().

639  {
640  Protocol::Address addr(device, 0);
641  add(addr, entry);
642  }
void add(const Protocol::Address &addr, const Entry &entry)
Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given network address.
+ Here is the call graph for this function:

◆ add() [3/4]

void HF::Core::GroupTable::Client::add ( const Protocol::Address addr,
uint16_t  group,
uint8_t  unit 
)
inline

Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given network address, for the given group and unit.

Parameters
[in]addrthe network address to send the message to.
[in]groupthe group address for the entry to add.
[in]unitthe unit ID for the entry to add.

Definition at line 652 of file group_table.h.

References add(), and HF::Core::AbstractService::unit().

653  {
654  Entry entry(group, unit);
655 
656  add(addr, entry);
657  }
Scheduling::Entry< Interval > Entry
Specific part for the Event Scheduler of the HF::Scheduling::Entry.
void add(const Protocol::Address &addr, const Entry &entry)
Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given network address.
Unit0 & unit() const
The device this unit is associated with.
Definition: core.h:142
+ Here is the call graph for this function:

◆ add() [4/4]

void HF::Core::GroupTable::Client::add ( const uint16_t  device,
uint16_t  group,
uint8_t  unit 
)
inline

Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given device, for the given group and unit.

Parameters
[in]devicethe device address to send the entry to.
[in]groupthe group address for the entry to add.
[in]unitthe unit ID for the entry to add.

Definition at line 667 of file group_table.h.

References add(), and HF::Core::AbstractService::unit().

668  {
669  Protocol::Address addr(device, 0);
670  Entry entry(group, unit);
671  add(addr, entry);
672  }
Scheduling::Entry< Interval > Entry
Specific part for the Event Scheduler of the HF::Scheduling::Entry.
void add(const Protocol::Address &addr, const Entry &entry)
Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given network address.
Unit0 & unit() const
The device this unit is associated with.
Definition: core.h:142
+ Here is the call graph for this function:

◆ added()

virtual void HF::Core::GroupTable::Client::added ( const Protocol::Address addr,
const GroupTable::Response response 
)
virtual

Callback for processing the response of a GroupTable::ADD_CMD.

Parameters
[in]addraddress for device that sent the response.
[in]responsethe response received.

Reimplemented in HF::Core::GroupManagement::GroupTableClient.

◆ handle_command()

Common::Result HF::Core::GroupTable::Client::handle_command ( Protocol::Packet packet,
Common::ByteArray payload,
uint16_t  offset 
)
protectedvirtual

Handle incoming messages from the network.

Parameters
[in]packetthe packet receive from the network.
[in]payloadthe byte array containing the data received from the network.
[in]offsetthe offset the payload start at in the byte array.
Returns
the result of the message processing.

Handle command request/response messages, i.e. :

  • Protocol::Message:Type::COMMAND_REQ;
  • Protocol::Message:Type::COMMAND_RESP_REQ;
  • Protocol::Message:Type::COMMAND_RES;

Reimplemented from HF::Interfaces::AbstractInterface.

◆ payload_size()

uint16_t HF::Core::GroupTable::Client::payload_size ( Protocol::Message::Interface itf) const
protectedvirtual

Return the minimal payload size that a message should hold when addressed at the given interface.

Parameters
[in]itfthe interface being address.
Returns
the minimum number of bytes for the message for the interface.

Reimplemented from HF::Interfaces::AbstractInterface.

◆ read_entries() [1/5]

void HF::Core::GroupTable::Client::read_entries ( const Protocol::Address addr,
const ReadEntries params 
)

Send a HAN-FUN message containing a GroupTable::READ_ENTRIES_CMD, to the given network address.

Parameters
[in]addrthe network address to send the message to.
[in]paramsparameters to the GroupTable::READ_ENTRIES_CMD.

Referenced by read_entries().

+ Here is the caller graph for this function:

◆ read_entries() [2/5]

void HF::Core::GroupTable::Client::read_entries ( const Protocol::Address addr,
const uint8_t  offset,
const uint8_t  count 
)
inline

Send a HAN-FUN message containing a GroupTable::READ_ENTRIES_CMD, to the given network address.

Parameters
[in]addrthe network address to send the message to.
[in]offsetoffset to start reading the entries from.
[in]countnumber of entries to read.

Definition at line 763 of file group_table.h.

References read_entries().

765  {
766  ReadEntries params(offset, count);
767 
768  read_entries(addr, params);
769  }
void read_entries(const Protocol::Address &addr, const ReadEntries &params)
Send a HAN-FUN message containing a GroupTable::READ_ENTRIES_CMD, to the given network address...
+ Here is the call graph for this function:

◆ read_entries() [3/5]

void HF::Core::GroupTable::Client::read_entries ( const uint16_t  device,
const ReadEntries params 
)
inline

Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the device with the given address.

Parameters
[in]devicethe device's network address to send the message to.
[in]paramsparameters to the GroupTable::READ_ENTRIES_CMD.

Definition at line 778 of file group_table.h.

References read_entries().

779  {
780  Protocol::Address addr(device, 0);
781  read_entries(addr, params);
782  }
void read_entries(const Protocol::Address &addr, const ReadEntries &params)
Send a HAN-FUN message containing a GroupTable::READ_ENTRIES_CMD, to the given network address...
+ Here is the call graph for this function:

◆ read_entries() [4/5]

void HF::Core::GroupTable::Client::read_entries ( const uint16_t  device,
const uint8_t  offset,
const uint8_t  count 
)
inline

Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the device with the given address.

Parameters
[in]devicethe device's network address to send the message to.
[in]offsetoffset to start reading the entries from.
[in]countnumber of entries to read.

Definition at line 792 of file group_table.h.

References read_entries().

793  {
794  Protocol::Address addr(device, 0);
795  ReadEntries params(offset, count);
796  read_entries(addr, params);
797  }
void read_entries(const Protocol::Address &addr, const ReadEntries &params)
Send a HAN-FUN message containing a GroupTable::READ_ENTRIES_CMD, to the given network address...
+ Here is the call graph for this function:

◆ read_entries() [5/5]

virtual void HF::Core::GroupTable::Client::read_entries ( const Protocol::Address addr,
const ReadEntriesResponse response 
)
virtual

Callback for processing the response of a GroupTable::READ_ENTRIES_CMD.

Parameters
[in]addraddress for device that sent the response.
[in]responsethe response received.

◆ remove() [1/4]

void HF::Core::GroupTable::Client::remove ( const Protocol::Address addr,
const Entry entry 
)

Send a HAN-FUN message containing a GroupTable::REMOVE_CMD, to the given network address.

Parameters
[in]addrthe network address to send the message to.
[in]entrythe group table entry to remove.

◆ remove() [2/4]

void HF::Core::GroupTable::Client::remove ( const uint16_t  device,
const Entry entry 
)
inline

Send a HAN-FUN message containing a GroupTable::REMOVE_CMD, to the given device and the given entry.

Parameters
[in]devicethe device address to remove the entry from.
[in]entrythe group table entry to remove.

Definition at line 690 of file group_table.h.

691  {
692  Protocol::Address addr(device, 0);
693  remove(addr, entry);
694  }

◆ remove() [3/4]

void HF::Core::GroupTable::Client::remove ( const Protocol::Address addr,
uint16_t  group,
uint8_t  unit 
)
inline

Send a HAN-FUN message containing a GroupTable::REMOVE_CMD, to the given network address, for the given group and unit.

Parameters
[in]addrthe network address to send the message to.
[in]groupthe group address for the entry to remove.
[in]unitthe unit ID for the entry to remove.

Definition at line 704 of file group_table.h.

References HF::Core::AbstractService::unit().

705  {
706  Entry entry(group, unit);
707 
708  remove(addr, entry);
709  }
Scheduling::Entry< Interval > Entry
Specific part for the Event Scheduler of the HF::Scheduling::Entry.
Unit0 & unit() const
The device this unit is associated with.
Definition: core.h:142
+ Here is the call graph for this function:

◆ remove() [4/4]

void HF::Core::GroupTable::Client::remove ( const uint16_t  device,
uint16_t  group,
uint8_t  unit 
)
inline

Send a HAN-FUN message containing a GroupTable::REMOVE_CMD, to the given device, for the given group and unit.

Parameters
[in]devicethe device address to send the entry to.
[in]groupthe group address for the entry to remove.
[in]unitthe unit ID for the entry to remove.

Definition at line 719 of file group_table.h.

References HF::Core::AbstractService::unit().

720  {
721  Protocol::Address addr(device, 0);
722  Entry entry(group, unit);
723  remove(addr, entry);
724  }
Scheduling::Entry< Interval > Entry
Specific part for the Event Scheduler of the HF::Scheduling::Entry.
Unit0 & unit() const
The device this unit is associated with.
Definition: core.h:142
+ Here is the call graph for this function:

◆ remove_all() [1/2]

void HF::Core::GroupTable::Client::remove_all ( const Protocol::Address addr)

Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the given network address.

Parameters
[in]addrthe network address to send the message to.

Referenced by remove_all().

+ Here is the caller graph for this function:

◆ remove_all() [2/2]

void HF::Core::GroupTable::Client::remove_all ( uint16_t  device)
inline

Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the device with the given address.

Parameters
[in]devicethe device's network address to send the message to.

Definition at line 740 of file group_table.h.

References remove_all().

741  {
742  Protocol::Address addr(device, 0);
743  remove_all(addr);
744  }
void remove_all(const Protocol::Address &addr)
Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the given network address...
+ Here is the call graph for this function:

◆ removed()

virtual void HF::Core::GroupTable::Client::removed ( const Protocol::Address addr,
const GroupTable::Response response 
)
virtual

Callback for processing the response of a GroupTable::REMOVE_CMD.

Parameters
[in]addraddress for device that sent the response.
[in]responsethe response received.

◆ removed_all()

virtual void HF::Core::GroupTable::Client::removed_all ( const Protocol::Address addr,
const Protocol::Response response 
)
virtual

Callback for processing the response of a GroupTable::REMOVE_ALL_CMD.

Parameters
[in]addraddress for device that sent the response.
[in]responsethe response received.

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