HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Interfaces::ColourControl::MoveToHueMessage Struct Reference

Move to Hue message class. More...

#include <colour_control.h>

+ Collaboration diagram for HF::Interfaces::ColourControl::MoveToHueMessage:

Public Member Functions

 MoveToHueMessage (uint16_t hue=0, Direction direction=Direction::SHORTEST, uint16_t time=0)
 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...
 

Data Fields

uint16_t hue
 The value of the new Hue. More...
 
Direction direction
 Direction of movement. More...
 
uint16_t time
 Time of transition in units of 100msec. More...
 

Static Public Attributes

static constexpr uint16_t min_size
 Minimum pack/unpack required data size.
 

Detailed Description

Move to Hue message class.

This class implements the necessary functions for message serialization.

Definition at line 438 of file colour_control.h.

Constructor & Destructor Documentation

◆ MoveToHueMessage()

HF::Interfaces::ColourControl::MoveToHueMessage::MoveToHueMessage ( uint16_t  hue = 0,
Direction  direction = Direction::SHORTEST,
uint16_t  time = 0 
)
inline

Constructor.

Parameters
[in]hueNew hue value.
[in]directionDirection of movement
[in]timeTime for the movement

Definition at line 451 of file colour_control.h.

453  {
454  this->hue = hue < HS_Colour::HUE ? hue : HS_Colour::HUE - 1;
455  }
Direction direction
Direction of movement.
uint16_t time
Time of transition in units of 100msec.
uint16_t hue
The value of the new Hue.

Member Function Documentation

◆ pack()

uint16_t HF::Interfaces::ColourControl::MoveToHueMessage::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.,

Serializable obj;
ByteArray payload(obj.size());
obj.pack(payload);
Parameters
[in,out]arrayByteArray reference to write the object to.
[in]offsetoffset to start writing to.
Returns
the number of bytes written.

◆ size()

uint16_t HF::Interfaces::ColourControl::MoveToHueMessage::size ( ) const
inline

Number bytes needed to serialize the message.

Returns
number of bytes the message requires to be serialized.

Definition at line 463 of file colour_control.h.

References min_size.

464  {
465  return min_size;
466  }
static constexpr uint16_t min_size
Minimum pack/unpack required data size.

◆ unpack()

uint16_t HF::Interfaces::ColourControl::MoveToHueMessage::unpack ( const Common::ByteArray array,
uint16_t  offset = 0 
)

Read a message from a ByteArray.

Parameters
[in]arrayByteArray reference to read the message from.
[in]offsetoffset to start reading from.
Returns
the number of bytes read.

Field Documentation

◆ direction

Direction HF::Interfaces::ColourControl::MoveToHueMessage::direction

Direction of movement.

Definition at line 441 of file colour_control.h.

◆ hue

uint16_t HF::Interfaces::ColourControl::MoveToHueMessage::hue

The value of the new Hue.

Definition at line 440 of file colour_control.h.

◆ time

uint16_t HF::Interfaces::ColourControl::MoveToHueMessage::time

Time of transition in units of 100msec.

Definition at line 442 of file colour_control.h.


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