![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
Colour Control Interface : Client side implementation. More...
#include <colour_control.h>
Public Member Functions | |
Commands | |
void | move_to_hue (const Protocol::Address &addr, uint16_t hue, Direction direction, uint16_t transition) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_HUE_CMD , to the given network address. More... | |
void | move_hue (const Protocol::Address &addr, Direction direction, uint16_t rate) |
Send a HAN-FUN message containing a ColourControl::MOVE_HUE_CMD , to the given network address. More... | |
void | step_hue (const Protocol::Address &addr, uint8_t step, Direction direction, uint8_t time) |
Send a HAN-FUN message containing a ColourControl::STEP_HUE_CMD , to the given network address. More... | |
void | move_to_saturation (const Protocol::Address &addr, uint8_t saturation, Direction direction, uint16_t transition) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_SATURATION_CMD , to the given network address. More... | |
void | move_saturation (const Protocol::Address &addr, Direction direction, uint8_t rate) |
Send a HAN-FUN message containing a ColourControl::MOVE_SATURATION_CMD , to the given network address. More... | |
void | step_saturation (const Protocol::Address &addr, uint8_t step, Direction direction, uint8_t time) |
Send a HAN-FUN message containing a ColourControl::STEP_SATURATION_CMD , to the given network address. More... | |
void | move_to_hue_and_saturation (const Protocol::Address &addr, HS_Colour colour, Direction direction, uint16_t time) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_HUE_AND_SATURATION_CMD , to the given network address. More... | |
void | move_to_xy (const Protocol::Address &addr, XY_Colour colour, uint16_t time) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_XY_CMD , to the given network address. More... | |
void | move_xy (const Protocol::Address &addr, int16_t X_rate, int16_t Y_rate) |
Send a HAN-FUN message containing a ColourControl::MOVE_XY_CMD , to the given network address. More... | |
void | step_xy (const Protocol::Address &addr, int16_t X_step, int16_t Y_step, uint8_t time) |
Send a HAN-FUN message containing a ColourControl::STEP_XY_CMD , to the given network address. More... | |
void | move_to_colour_temperature (const Protocol::Address &addr, uint16_t colour, uint16_t time) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_COLOUR_TEMPERATURE_CMD , to the given network address. More... | |
void | stop (const Protocol::Address &addr) |
Send a HAN-FUN message containing a ColourControl::STOP_CMD , to the given network address. More... | |
![]() | |
HF::Interface::Role | role () const |
Return the Interface::Role this interface implements. More... | |
![]() | |
uint16_t | uid () const |
This method returns the interface UID. More... | |
![]() | |
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::IAttribute * | attribute (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... | |
Additional Inherited Members | |
![]() | |
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 constexpr uint8_t | MAX_CMD_ID = 0xFF |
Maximum value for command IDs in interfaces. | |
![]() | |
Base () | |
Constructor. | |
![]() | |
bool | check_uid (uint16_t uid) const |
![]() | |
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... | |
virtual uint16_t | payload_size (Protocol::Message &message) const |
Return the minimal payload size that should be present for the given message. More... | |
virtual 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... | |
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_command (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset) |
Handle incoming messages from the network. More... | |
virtual Common::Result | handle_attribute (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset) |
Handle incoming messages from the network. More... | |
Colour Control Interface : Client side implementation.
This class provides the client side of the Colour Control interface.
Definition at line 1670 of file colour_control.h.
void HF::Interfaces::ColourControl::Client::move_hue | ( | const Protocol::Address & | addr, |
Direction | direction, | ||
uint16_t | rate | ||
) |
Send a HAN-FUN message containing a ColourControl::MOVE_HUE_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | direction | the direction of change. |
[in] | rate | the rate of change. |
void HF::Interfaces::ColourControl::Client::move_saturation | ( | const Protocol::Address & | addr, |
Direction | direction, | ||
uint8_t | rate | ||
) |
Send a HAN-FUN message containing a ColourControl::MOVE_SATURATION_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | direction | the direction of change. |
[in] | rate | the rate of change. |
void HF::Interfaces::ColourControl::Client::move_to_colour_temperature | ( | const Protocol::Address & | addr, |
uint16_t | colour, | ||
uint16_t | time | ||
) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_COLOUR_TEMPERATURE_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | colour | the colour temperature to move to. |
[in] | time | the number of milliseconds to perform the move in. |
void HF::Interfaces::ColourControl::Client::move_to_hue | ( | const Protocol::Address & | addr, |
uint16_t | hue, | ||
Direction | direction, | ||
uint16_t | transition | ||
) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_HUE_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | hue | the hue value to move to. |
[in] | direction | the direction of change. |
[in] | transition | the time interval to make the transition. |
void HF::Interfaces::ColourControl::Client::move_to_hue_and_saturation | ( | const Protocol::Address & | addr, |
HS_Colour | colour, | ||
Direction | direction, | ||
uint16_t | time | ||
) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_HUE_AND_SATURATION_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | colour | the new colour value. |
[in] | direction | direction of movement. |
[in] | time | transition time (in units of 100ms). |
void HF::Interfaces::ColourControl::Client::move_to_saturation | ( | const Protocol::Address & | addr, |
uint8_t | saturation, | ||
Direction | direction, | ||
uint16_t | transition | ||
) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_SATURATION_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | saturation | the new saturation value. |
[in] | direction | direction of movement. |
[in] | transition | transition time (in units of 100ms). |
void HF::Interfaces::ColourControl::Client::move_to_xy | ( | const Protocol::Address & | addr, |
XY_Colour | colour, | ||
uint16_t | time | ||
) |
Send a HAN-FUN message containing a ColourControl::MOVE_TO_XY_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | colour | the new colour value. |
[in] | time | transition time (in units of 100ms). |
void HF::Interfaces::ColourControl::Client::move_xy | ( | const Protocol::Address & | addr, |
int16_t | X_rate, | ||
int16_t | Y_rate | ||
) |
Send a HAN-FUN message containing a ColourControl::MOVE_XY_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | X_rate | the X rate of change (in units of sec). |
[in] | Y_rate | the Y rate of change (in units of sec). |
void HF::Interfaces::ColourControl::Client::step_hue | ( | const Protocol::Address & | addr, |
uint8_t | step, | ||
Direction | direction, | ||
uint8_t | time | ||
) |
Send a HAN-FUN message containing a ColourControl::STEP_HUE_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | step | the step size. |
[in] | direction | the direction of change. |
[in] | time | time to perform a single step. |
void HF::Interfaces::ColourControl::Client::step_saturation | ( | const Protocol::Address & | addr, |
uint8_t | step, | ||
Direction | direction, | ||
uint8_t | time | ||
) |
Send a HAN-FUN message containing a ColourControl::STEP_SATURATION_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | step | the step size. |
[in] | direction | the direction of change. |
[in] | time | time to perform a single step. |
void HF::Interfaces::ColourControl::Client::step_xy | ( | const Protocol::Address & | addr, |
int16_t | X_step, | ||
int16_t | Y_step, | ||
uint8_t | time | ||
) |
Send a HAN-FUN message containing a ColourControl::STEP_XY_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |
[in] | X_step | the X rate of change. (in units of sec) |
[in] | Y_step | the Y rate of change. (in units of sec) |
[in] | time | time to perform a single step. (in units of 100msec) |
void HF::Interfaces::ColourControl::Client::stop | ( | const Protocol::Address & | addr | ) |
Send a HAN-FUN message containing a ColourControl::STOP_CMD
, to the given network address.
[in] | addr | the network address to send the message to. |