Define a command destined to the user layer. Command can only be created by the static make_* methods.
More...
#include <user_commands.h>
|
|
static constexpr uint8_t | maxDataSize = 8 |
| |
|
|
| UserCommand () |
| | Protected constructor to prevent unallowed uses.
|
| |
Define a command destined to the user layer. Command can only be created by the static make_* methods.
◆ Type
Command type.
| Enumerator |
|---|
| Invalid | invalid placeholder message
|
| SetUserRamp | set the user ramp value
|
| Brightness | set brightness
|
| SetMode | set mode index
|
| OnOff | turn on or off
|
| SetRealTime | set the system real time
|
| SetSunsetToTime | set the sunset to a target real time
|
| SetBleCustomColorMode | switch to BLE custom color mode
|
| SetBleMode | switch to a target BLE mode
|
◆ make_brightness_command()
Set this commant to handle brightness.
- Parameters
-
- Returns
- The correct user command
◆ make_set_ble_custom_color_mode_command()
| UserCommand lampda::common::UserCommand::make_set_ble_custom_color_mode_command |
( |
const uint8_t |
red, |
|
|
const uint8_t |
green, |
|
|
const uint8_t |
blue |
|
) |
| |
|
static |
Set this commant to set ble custom color.
- Parameters
-
| [in] | red | |
| [in] | green | |
| [in] | blue | |
- Returns
- The correct user command
◆ make_set_ble_mode_command()
| UserCommand lampda::common::UserCommand::make_set_ble_mode_command |
( |
const uint8_t |
index | ) |
|
|
static |
Set this commant to set ble mode.
- Parameters
-
- Returns
- The correct user command
◆ make_set_mode_command()
| UserCommand lampda::common::UserCommand::make_set_mode_command |
( |
const uint8_t |
groupId, |
|
|
const uint8_t |
modeId |
|
) |
| |
|
static |
Set this commant to handle mode switch.
- Parameters
-
- Returns
- The correct user command
◆ make_set_ramp_command()
| UserCommand lampda::common::UserCommand::make_set_ramp_command |
( |
const uint8_t |
ramp | ) |
|
|
static |
Set this commant to handle user ramp change.
- Parameters
-
- Returns
- The correct user command
◆ make_set_real_time_command()
Set this commant to set system real time.
- Parameters
-
- Returns
- The correct user command
◆ make_set_sunset_to_time_command()
Set this commant to set sunset to real time.
- Parameters
-
- Returns
- The correct user command
◆ make_turn_onoff_command()
| UserCommand lampda::common::UserCommand::make_turn_onoff_command |
( |
const bool |
shouldTurnOn | ) |
|
|
static |
Set this commant to handle turn on/off.
- Parameters
-
- Returns
- The correct user command
◆ parse_brightness()
| bool lampda::common::UserCommand::parse_brightness |
( |
brightness_t & |
brightness | ) |
const |
Parse the current command for a brightness value.
- Parameters
-
- Returns
- True if the current message is valid, and parameter is set
◆ parse_ramp()
| bool lampda::common::UserCommand::parse_ramp |
( |
uint8_t & |
ramp | ) |
const |
Parse the current command for a ramp value.
Parsing functions
- Parameters
-
- Returns
- True if the current message is valid, and parameter is set
◆ parse_set_ble_custom_color_mode_command()
| bool lampda::common::UserCommand::parse_set_ble_custom_color_mode_command |
( |
uint32_t & |
color | ) |
const |
Parse the current command for a set current mode to BLE custom color.
- Parameters
-
- Returns
- True if the current message is valid, and parameter is set
◆ parse_set_ble_mode_command()
| bool lampda::common::UserCommand::parse_set_ble_mode_command |
( |
uint8_t & |
index | ) |
const |
Parse the current command for a set current mode to BLE mode.
- Parameters
-
- Returns
- True if the current message is valid, and parameter is set
◆ parse_set_mode()
| bool lampda::common::UserCommand::parse_set_mode |
( |
uint8_t & |
groupId, |
|
|
uint8_t & |
modeId |
|
) |
| const |
Parse the current command for a set_mode values.
- Parameters
-
- Returns
- True if the current message is valid, and parameters are set
◆ parse_set_real_time_command()
Parse the current command for a set real time value.
- Parameters
-
- Returns
- True if the current message is valid, and parameter is set
◆ parse_set_sunset_to_time_command()
Parse the current command for a set sunset to time value.
- Parameters
-
- Returns
- True if the current message is valid, and parameter is set
◆ parse_turn_onoff()
| bool lampda::common::UserCommand::parse_turn_onoff |
( |
bool & |
shouldTurnOn | ) |
const |
Parse the current command for a on/off value.
- Parameters
-
- Returns
- True if the current message is valid, and parameter is set
The documentation for this class was generated from the following files: