![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
Helper class that supports the XY colour mode. More...
#include <colour_control.h>
Public Member Functions | |
XY_Colour (uint16_t X, uint16_t Y) | |
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... | |
int | compare (const XY_Colour &other) const |
Compare this attribute with the given attribute in other . More... | |
float | changed (const XY_Colour &other) const |
This method is used to get the percentage of change that the attribute has in relation to the value present in other . More... | |
bool | operator== (const XY_Colour &other) const |
Operator equal. | |
bool | operator!= (const XY_Colour &other) const |
Operator not equal. | |
Static Public Attributes | |
static constexpr uint16_t | min_size |
Minimum pack/unpack required data size. | |
Helper class that supports the XY colour mode.
This class implements the necessary functions for message serialization.
Definition at line 248 of file colour_control.h.
|
inline |
Constructor.
[in] | X | X colour value. |
[in] | Y | Y colour value. |
Definition at line 261 of file colour_control.h.
|
inline |
This method is used to get the percentage of change that the attribute has in relation to the value present in other
.
[in] | other | attribute holding a previous value. |
Definition at line 301 of file colour_control.h.
|
inline |
Compare this attribute with the given attribute in other
.
This method should return < 0 if this attribute is less that, 0 if it is equal and > 0 if greater that the other
attribute.
[in] | other | attribute to compare to. |
<0 | if attribute less than other ; |
0 | if attribute equal to other ; |
>0 | if attribute greater than other . |
Definition at line 281 of file colour_control.h.
uint16_t HF::Interfaces::ColourControl::XY_Colour::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.,
[in,out] | array | ByteArray reference to write the object to. |
[in] | offset | offset to start writing to. |
|
inline |
Number bytes needed to serialize the message.
Definition at line 269 of file colour_control.h.
References min_size.
uint16_t HF::Interfaces::ColourControl::XY_Colour::unpack | ( | const Common::ByteArray & | array, |
uint16_t | offset = 0 |
||
) |
Read a message from a ByteArray.
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |