mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ble_mesh: stack: Enable updating lighting hsl state
This commit is contained in:
parent
c6f7abbe94
commit
fc27117299
@ -2131,6 +2131,11 @@ typedef union {
|
||||
uint16_t temperature; /*!< The value of the Light CTL Temperature state */
|
||||
int16_t delta_uv; /*!< The value of the Light CTL Delta UV state */
|
||||
} light_ctl_temp_delta_uv; /*!< The Light CTL Temperature & Delta UV states */
|
||||
struct {
|
||||
uint16_t lightness; /*!< The value of the Light HSL Lightness state */
|
||||
uint16_t hue; /*!< The value of the Light HSL Hue state */
|
||||
uint16_t saturation; /*!< The value of the Light HSL Saturation state */
|
||||
} light_hsl; /*!< The Light HSL composite state */
|
||||
struct {
|
||||
uint16_t lightness; /*!< The value of the Light HSL Lightness state */
|
||||
} light_hsl_lightness; /*!< The Light HSL Lightness state */
|
||||
@ -2158,6 +2163,7 @@ typedef enum {
|
||||
ESP_BLE_MESH_LIGHT_LIGHTNESS_LINEAR_STATE,
|
||||
ESP_BLE_MESH_LIGHT_CTL_LIGHTNESS_STATE,
|
||||
ESP_BLE_MESH_LIGHT_CTL_TEMP_DELTA_UV_STATE,
|
||||
ESP_BLE_MESH_LIGHT_HSL_STATE,
|
||||
ESP_BLE_MESH_LIGHT_HSL_LIGHTNESS_STATE,
|
||||
ESP_BLE_MESH_LIGHT_HSL_HUE_STATE,
|
||||
ESP_BLE_MESH_LIGHT_HSL_SATURATION_STATE,
|
||||
|
@ -24,6 +24,7 @@ typedef enum {
|
||||
LIGHT_LIGHTNESS_LINEAR_STATE,
|
||||
LIGHT_CTL_LIGHTNESS_STATE,
|
||||
LIGHT_CTL_TEMP_DELTA_UV_STATE,
|
||||
LIGHT_HSL_STATE,
|
||||
LIGHT_HSL_LIGHTNESS_STATE,
|
||||
LIGHT_HSL_HUE_STATE,
|
||||
LIGHT_HSL_SATURATION_STATE,
|
||||
@ -58,6 +59,11 @@ typedef union {
|
||||
uint16_t temperature;
|
||||
int16_t delta_uv;
|
||||
} light_ctl_temp_delta_uv;
|
||||
struct {
|
||||
uint16_t lightness;
|
||||
uint16_t hue;
|
||||
uint16_t saturation;
|
||||
} light_hsl;
|
||||
struct {
|
||||
uint16_t lightness;
|
||||
} light_hsl_lightness;
|
||||
|
@ -252,6 +252,25 @@ int bt_mesh_update_binding_state(struct bt_mesh_model *model,
|
||||
light_ctl_publish(model, BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_STATUS);
|
||||
break;
|
||||
}
|
||||
case LIGHT_HSL_STATE: {
|
||||
if (model->id != BLE_MESH_MODEL_ID_LIGHT_HSL_SRV) {
|
||||
BT_ERR("Invalid Light HSL Server, model id 0x%04x", model->id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
struct bt_mesh_light_hsl_srv *srv = model->user_data;
|
||||
if (srv->state == NULL) {
|
||||
BT_ERR("Invalid Light HSL Server state");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bt_mesh_server_stop_transition(&srv->transition);
|
||||
srv->state->lightness = value->light_hsl.lightness;
|
||||
srv->state->hue = value->light_hsl.hue;
|
||||
srv->state->saturation = value->light_hsl.saturation;
|
||||
light_hsl_publish(model, BLE_MESH_MODEL_OP_LIGHT_HSL_STATUS);
|
||||
break;
|
||||
}
|
||||
case LIGHT_HSL_LIGHTNESS_STATE: {
|
||||
if (model->id != BLE_MESH_MODEL_ID_LIGHT_HSL_SRV) {
|
||||
BT_ERR("Invalid Light HSL Server, model id 0x%04x", model->id);
|
||||
|
Loading…
Reference in New Issue
Block a user