HSL Server#

sl_btmesh_hsl_server.h

sl_btmesh_hsl_signal_transition_handler.h

Hue, Saturation and Lightness (HSL) Server model. Used to support the control and reporting functionality of a node with a light source that is dimmable and whose color can be selected. It extends Lightness Server and corresponds with HSL Hue Server and HSL Saturation Server models. It also has a corresponding HSL Setup Server model. This component implements callbacks, control, and report functionality. This component is prepared for integration into SOC applications. This is a Low-Code component. The following weak callbacks are available to implement the relevant light source handling: void sl_btmesh_hsl_hue_cb(uint16_t hue); void sl_btmesh_hsl_saturation_cb(uint16_t saturation);

License#

Copyright 2023 Silicon Laboratories Inc. www.silabs.com

SPDX-License-Identifier: Zlib

The licensor of this software is Silicon Laboratories Inc.

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

  3. This notice may not be removed or altered from any source distribution.

License#

Copyright 2022 Silicon Laboratories Inc. www.silabs.com

SPDX-License-Identifier: Zlib

The licensor of this software is Silicon Laboratories Inc.

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

  3. This notice may not be removed or altered from any source distribution.

Functions#

void
sl_btmesh_hsl_server_on_event(sl_btmesh_msg_t *evt)
uint16_t
void
sl_btmesh_hsl_set_hue_level(uint16_t hue, uint32_t transition_ms)
void
sl_btmesh_hsl_set_saturation_level(uint16_t saturation, uint32_t transition_ms)
void
sl_btmesh_hsl_hue_cb(uint16_t hue)
void
sl_btmesh_hsl_saturation_cb(uint16_t saturation)
void

Function Documentation#

sl_btmesh_hsl_server_on_event#

void sl_btmesh_hsl_server_on_event (sl_btmesh_msg_t * evt)
Parameters
TypeDirectionArgument NameDescription
sl_btmesh_msg_t *[in]evt

Pointer to incoming event.

Handle HSL Server events.

This function is called automatically after enabling the component.


sl_btmesh_hsl_server_init#

void sl_btmesh_hsl_server_init (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

HSL Server initialization. This should be called at each boot if provisioning is already done. Otherwise this function should be called after provisioning is completed. This function is called automatically after enabling the component.


sl_btmesh_hsl_server_on_node_reset#

void sl_btmesh_hsl_server_on_node_reset (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Component node reset handler. Clearing component specific nvm content during node reset. This function is called automatically by Universal Configurator after enabling the component.


sl_btmesh_get_hue#

uint16_t sl_btmesh_get_hue (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Function for retrieving current hue.

Returns

  • Current hue level.


sl_btmesh_get_saturation#

uint16_t sl_btmesh_get_saturation (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Function for retrieving current saturation.

Returns

  • Current saturation level.


sl_btmesh_hsl_set_hue_level#

void sl_btmesh_hsl_set_hue_level (uint16_t hue, uint32_t transition_ms)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]hue

Hue level.

uint32_t[in]transition_ms

Transition time in milliseconds.

Set LED hue in given transition time.


sl_btmesh_hsl_set_saturation_level#

void sl_btmesh_hsl_set_saturation_level (uint16_t saturation, uint32_t transition_ms)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]saturation

Saturation level.

uint32_t[in]transition_ms

Transition time in milliseconds.

Set LED saturation in given transition time.


sl_btmesh_hsl_hue_cb#

void sl_btmesh_hsl_hue_cb (uint16_t hue)
Parameters
TypeDirectionArgument NameDescription
uint16_tN/Ahue

sl_btmesh_hsl_saturation_cb#

void sl_btmesh_hsl_saturation_cb (uint16_t saturation)
Parameters
TypeDirectionArgument NameDescription
uint16_tN/Asaturation

sl_btmesh_hsl_hue_on_ui_update#

void sl_btmesh_hsl_hue_on_ui_update (uint16_t hue)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]hue

Hue value.

Called when the UI shall be updated with the changed HSL Model state during a transition. The rate of this callback can be controlled by changing the SL_BTMESH_HSL_SERVER_HUE_UI_UPDATE_PERIOD_CFG_VAL macro.

This is a callback which can be implemented in the application. Note

  • If no implementation is provided in the application, then the default weak implementation will be an empty function.


sl_btmesh_hsl_saturation_on_ui_update#

void sl_btmesh_hsl_saturation_on_ui_update (uint16_t saturation)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]saturation

Saturation value.

Called when the UI shall be updated with the changed HSL Model state during a transition. The rate of this callback can be controlled by changing the SL_BTMESH_HSL_SERVER_SATURATION_UI_UPDATE_PERIOD_CFG_VAL macro.

This is a callback which can be implemented in the application. Note

  • If no implementation is provided in the application, then the default weak implementation will be an empty function.