Lightness Client#
Used to support the functionality of a node that can set the dim level of a light source (Lightness Server) on another node. This component integrates the Generic OnOff Client functionality, for ease of use. It provides functions to change the dim value by, or set the dim value to a certain percentage, and a function for getting the current lightness level. This component is prepared for integration into SOC applications. This is a Low-Code component. For example, toggling all Light Lightness Servers in the network can be achieved by adding an event handler for mesh events and calling the following code: #include "sl_btmesh_lighting_client.h" void event_handler(sl_btmesh_msg_t *evt) { case sl_btmesh_evt_node_initialized_id: if (evt->data.evt_node_initialized.provisioned) { sl_btmesh_change_switch_position(SL_BTMESH_LIGHTING_CLIENT_TOGGLE); } break; }
Functions#
Macros#
Set switch state to off.
Set switch state to on.
Toggle switch state.
Function Documentation#
sl_btmesh_set_lightness#
void sl_btmesh_set_lightness (uint8_t new_lightness_percentage)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | new_lightness_percentage | Defines new lightness value as percentage Valid values 0-100 % |
This function change the lightness and send it to the server.
sl_btmesh_change_switch_position#
void sl_btmesh_change_switch_position (uint8_t position)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | position | Defines switch position change, possible values are:
|
This function change the switch position and send it to the server.
sl_btmesh_get_lightness#
uint16_t sl_btmesh_get_lightness (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Get lightness.
This function returns actual lightness to set.
Returns
Actual lightness value