Lightness Server#
Used to support the control and reporting functionality of a node with a light source that is dimmable. Lightness Server extends Generic Power OnOff Server model and Generic Level Server model. It also has a corresponding Lightness Setup Server model which is present in the same element. The component provides the reporting functions, and the possibility to set current, default, and last values of the lightness value. This component is prepared for integration into SOC applications. This is a Low-Code component. The following weak callback is available to implement the relevant light source handling: void sl_btmesh_lighting_level_pwm_cb(uint16_t level);
Functions#
Stop the lighting level transition timer.
Function Documentation#
sl_btmesh_lighting_set_level#
void sl_btmesh_lighting_set_level (uint16_t level, uint32_t transition_ms)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | level | |
uint32_t | N/A | transition_ms |
sl_btmesh_set_state#
void sl_btmesh_set_state (int state)
Type | Direction | Argument Name | Description |
---|---|---|---|
int | N/A | state |
sl_btmesh_get_level#
uint16_t sl_btmesh_get_level (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
sl_btmesh_lighting_level_pwm_cb#
void sl_btmesh_lighting_level_pwm_cb (uint16_t level)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | N/A | level |
sl_btmesh_lighting_server_on_ui_update#
void sl_btmesh_lighting_server_on_ui_update (uint16_t lightness_level)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | lightness_level | lightness level (0x0001 - FFFE) |
Called when the UI shall be updated with the changed state of lightning server during a transition. The rate of this callback can be controlled by changing the SL_BTMESH_LIGHTING_SERVER_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_stop_transition_timer#
sl_status_t sl_btmesh_stop_transition_timer (void )
Stop the lighting level transition timer.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
Status code indicating success or error.
sl_btmesh_lighting_server_init#
void sl_btmesh_lighting_server_init (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Lighting 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_lighting_server_on_event#
void sl_btmesh_lighting_server_on_event (sl_btmesh_msg_t * evt)
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_btmesh_msg_t * | [in] | evt | Pointer to incoming event. |
Handling of mesh lighting server events.
This function is called automatically after enabling the component.
sl_btmesh_lighting_server_on_node_reset#
void sl_btmesh_lighting_server_on_node_reset (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Handle node reset.
Function for clearing component specific nvm content during node reset. This function is called automatically by Universal Configurator after enabling the component.
sl_btmesh_get_lightness_current#
uint16_t sl_btmesh_get_lightness_current (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Get current lightness value
Returns
Current lightness
sl_btmesh_set_lightness_current#
void sl_btmesh_set_lightness_current (uint16_t lightness)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | lightness | Current lightness |
Set current lightness value
sl_btmesh_get_lightness_target#
uint16_t sl_btmesh_get_lightness_target (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Get target lightness value
Returns
Target lightness
sl_btmesh_set_lightness_target#
void sl_btmesh_set_lightness_target (uint16_t lightness)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | lightness | Target lightness |
Set target lightness value
sl_btmesh_get_lightness_default#
uint16_t sl_btmesh_get_lightness_default (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Get default lightness value
Returns
Default lightness
sl_btmesh_set_lightness_default#
void sl_btmesh_set_lightness_default (uint16_t lightness)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | lightness | Default lightness |
Set default lightness value
sl_btmesh_set_lightness_last#
void sl_btmesh_set_lightness_last (uint16_t lightness)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | lightness | Last lightness |
Set last lightness value
sl_btmesh_get_default_transition_time#
uint32_t sl_btmesh_get_default_transition_time (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
This function converts mesh format of default transition time to milliseconds.
Returns
Default transition time in milliseconds.
sl_btmesh_get_lightness_onpowerup#
uint8_t sl_btmesh_get_lightness_onpowerup (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Get default lightness value on power up
Returns
Default lightness on power up
sl_btmesh_update_lightness#
void sl_btmesh_update_lightness (uint16_t lightness, uint32_t remaining_ms)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint16_t | [in] | lightness | Current lightness level within the transition |
uint32_t | [in] | remaining_ms | Remaining transition time in milliseconds |
This function updates the lightness level in the mesh stack during a transition
pri_level_move_stop#
void pri_level_move_stop (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
This function stops generic level move on primary element.