HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Profiles::Profile< _uid, Interface > Struct Template Reference

Class template for profiles containing only one interface. More...

#include <profiles.h>

+ Inheritance diagram for HF::Profiles::Profile< _uid, Interface >:
+ Collaboration diagram for HF::Profiles::Profile< _uid, Interface >:

Public Member Functions

HF::Attributes::List attributes (Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
 Return a list of all the attributes for a given interface, pack id and list of attributes UID's. More...
 
virtual Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)=0
 Handle incoming messages from the network. More...
 
virtual HF::Attributes::UIDS attributes (uint8_t pack_id=HF::Attributes::Pack::MANDATORY) const=0
 Return a vector containing the attribute UIDs, for the given pack ID. More...
 
- Public Member Functions inherited from HF::Profiles::AbstractProfile< _uid >
uint16_t uid () const
 Return this profile HAN-FUN UID. More...
 
Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
- Public Member Functions inherited from HF::Interface
virtual uint16_t uid () const =0
 This method returns the interface UID. More...
 
virtual Interface::Role role () const =0
 Return the Interface::Role this interface implements. More...
 
virtual Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)=0
 Handle incoming messages from the network. More...
 
virtual void periodic (uint32_t time)=0
 Handle periodic processing. More...
 
virtual HF::Attributes::IAttributeattribute (uint8_t uid)=0
 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 =0
 Return a vector containing the attribute UIDs, for the given pack ID. 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

template<uint16_t _uid, class Interface>
struct HF::Profiles::Profile< _uid, Interface >

Class template for profiles containing only one interface.

Definition at line 305 of file profiles.h.

Member Function Documentation

◆ attributes() [1/2]

template<uint16_t _uid, class Interface>
virtual HF::Attributes::UIDS HF::Interface::attributes

Return a vector containing the attribute UIDs, for the given pack ID.

Parameters
[in]pack_idthe Attribute pack ID to get the attributes UIDs for.
Returns
vector containing the attributes UIDs.

◆ attributes() [2/2]

template<uint16_t _uid, class Interface>
HF::Attributes::List HF::Profiles::Profile< _uid, Interface >::attributes ( Common::Interface  itf,
uint8_t  pack_id,
const HF::Attributes::UIDS uids 
) const
inlinevirtual

Return a list of all the attributes for a given interface, pack id and list of attributes UID's.

Parameters
[in]itfinterface UID.
[in]pack_idattribute pack id.
[in]uidslist of attributes UID's.
Returns
attribute list.

Reimplemented from HF::Profiles::AbstractProfile< _uid >.

Definition at line 314 of file profiles.h.

316  {
317  if (Interface::uid() == itf.id)
318  {
319  return HF::Attributes::get(*this, pack_id, uids);
320  }
321  else
322  {
323  return HF::Attributes::List();
324  }
325  }
List get(const HF::Interface &itf, uint8_t pack_id, const UIDS &uids)
Get a list with the attributes for the given interface, pack id or the uids passed in...
This class has the same behavior has a list, however the list element access methods where overwritte...
Definition: attributes.h:752
virtual uint16_t uid() const =0
This method returns the interface UID.

◆ handle()

template<uint16_t _uid, class Interface>
virtual Common::Result HF::Interface::handle

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.

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