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

Attribute Reporting - Client Role. More...

#include <attribute_reporting.h>

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

Public Member Functions

Interface::Role role () const
 Return the Interface::Role this interface implements. More...
 
Events
virtual void report (Type type, const Protocol::Address &address, const Common::ByteArray &payload, uint16_t offset)
 Event indicating a PERIODIC_REPORT_CMD or a EVENT_REPORT_CMD. More...
 
virtual void created (const Protocol::Address &address, const Response &response)
 Event indicating the result of a CREATE_PERIODIC_CMD or CREATE_EVENT_CMD. More...
 
virtual void added (const Protocol::Address &address, const Response &response)
 Event indicating the result of a ADD_PERIODIC_ENTRY_CMD or ADD_EVENT_ENTRY_CMD. More...
 
virtual void deleted (const Protocol::Address &address, const Response &response)
 Event indicating the result of a DELETE_REPORT_CMD. More...
 
virtual void updated (const Protocol::Address &address, const Response &response)
 Event indicating the result of a UPDATE_INTERVAL_CMD. More...
 
- Public Member Functions inherited from HF::Interfaces::Interface< HF::Interface::ATTRIBUTE_REPORTING >
uint16_t uid () const
 This method returns the interface UID. 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...
 
virtual 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...
 

Protected Member Functions

uint16_t payload_size (Protocol::Message &message) const
 Return the minimal payload size that should be present for the given message. 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...
 
Common::Result handle_command (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
- Protected Member Functions inherited from HF::Interfaces::Interface< HF::Interface::ATTRIBUTE_REPORTING >
bool check_uid (uint16_t uid) const
 
- Protected Member Functions inherited from HF::Interfaces::AbstractInterface
virtual void send (const Protocol::Address &addr, Protocol::Message &message)=0
 Send message msg to the network address given by addr. More...
 
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...
 
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.
 

Detailed Description

Attribute Reporting - Client Role.

Definition at line 1361 of file attribute_reporting.h.

Member Function Documentation

◆ added()

virtual void HF::Core::AttributeReporting::Client::added ( const Protocol::Address address,
const Response &  response 
)
inlinevirtual

Event indicating the result of a ADD_PERIODIC_ENTRY_CMD or ADD_EVENT_ENTRY_CMD.

Parameters
[in]addressdevice address that originated the event.
[in]responseresult of the operation.

Definition at line 1420 of file attribute_reporting.h.

References HF::Protocol::response(), and UNUSED.

1421  {
1422  UNUSED(address);
1423  UNUSED(response);
1424  }
bool response(Message::Type type)
Check if message is a response.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
+ Here is the call graph for this function:

◆ created()

virtual void HF::Core::AttributeReporting::Client::created ( const Protocol::Address address,
const Response &  response 
)
inlinevirtual

Event indicating the result of a CREATE_PERIODIC_CMD or CREATE_EVENT_CMD.

Parameters
[in]addressdevice address that originated the event.
[in]responseresult of the operation.

Definition at line 1407 of file attribute_reporting.h.

References HF::Protocol::response(), and UNUSED.

1408  {
1409  UNUSED(address);
1410  UNUSED(response);
1411  }
bool response(Message::Type type)
Check if message is a response.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
+ Here is the call graph for this function:

◆ deleted()

virtual void HF::Core::AttributeReporting::Client::deleted ( const Protocol::Address address,
const Response &  response 
)
inlinevirtual

Event indicating the result of a DELETE_REPORT_CMD.

Parameters
[in]addressdevice address that originated the event.
[in]responseresult of the operation.

Definition at line 1432 of file attribute_reporting.h.

References HF::Protocol::response(), and UNUSED.

1433  {
1434  UNUSED(address);
1435  UNUSED(response);
1436  }
bool response(Message::Type type)
Check if message is a response.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
+ Here is the call graph for this function:

◆ handle_command()

Common::Result HF::Core::AttributeReporting::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() [1/2]

uint16_t HF::Core::AttributeReporting::Client::payload_size ( Protocol::Message message) const
protectedvirtual

Return the minimal payload size that should be present for the given message.

Parameters
[in]messagemessage that was received.
Returns
the minimum size in bytes that the packet payload should hold.

Reimplemented from HF::Interfaces::AbstractInterface.

◆ payload_size() [2/2]

uint16_t HF::Core::AttributeReporting::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.

◆ report()

virtual void HF::Core::AttributeReporting::Client::report ( Type  type,
const Protocol::Address address,
const Common::ByteArray payload,
uint16_t  offset 
)
inlinevirtual

Event indicating a PERIODIC_REPORT_CMD or a EVENT_REPORT_CMD.

Parameters
[in]typetype of report.
[in]addressdevice address that originated the event.
[in]payloaddata in the report.
[in]offsetoffset from which to start reading the data of the the report in the payload.

Definition at line 1391 of file attribute_reporting.h.

References UNUSED.

1393  {
1394  UNUSED(type);
1395  UNUSED(address);
1396  UNUSED(payload);
1397  UNUSED(offset);
1398  }
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.

◆ role()

Interface::Role HF::Core::AttributeReporting::Client::role ( ) const
inlinevirtual

Return the Interface::Role this interface implements.

Returns
the Interface::Role implemented by the interface.

Implements HF::Interface.

Definition at line 1367 of file attribute_reporting.h.

References HF::Interface::CLIENT_ROLE.

1368  {
1370  }

◆ updated()

virtual void HF::Core::AttributeReporting::Client::updated ( const Protocol::Address address,
const Response &  response 
)
inlinevirtual

Event indicating the result of a UPDATE_INTERVAL_CMD.

Parameters
[in]addressdevice address that originated the event.
[in]responseresult of the operation.

Definition at line 1444 of file attribute_reporting.h.

References HF::Protocol::response(), and UNUSED.

1445  {
1446  UNUSED(address);
1447  UNUSED(response);
1448  }
bool response(Message::Type type)
Check if message is a response.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
+ Here is the call graph for this function:

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