CTL Server#

Color Tunable Lighting (CTL) Server model. Used to support the control and reporting functionality of a node with a light source that is dimmable and whose color temperature can be selected. This component implements this control and reporting functionality, extending on lighting server, and also provides callbacks on lighting related events. For more details about lighting, please see Lighting Server. 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_lighting_level_pwm_cb(uint16_t level); void sl_btmesh_lighting_color_pwm_cb(uint16_t color);

Functions#

void
sl_btmesh_ctl_server_on_event(sl_btmesh_msg_t *evt)
uint16_t
void
sl_btmesh_ctl_set_temperature_deltauv_level(uint16_t temperature, int16_t deltauv, uint32_t transition_ms)
int
sl_btmesh_ctl_server_snprint_deltauv(char *buffer, uint16_t buffer_size, uint16_t deltauv_raw)
void
sl_btmesh_ctl_on_ui_update(uint16_t temperature, uint16_t deltauv)

Function Documentation#

sl_btmesh_ctl_server_on_event#

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

Pointer to incoming event.

Handle CTL Server events.

This function is called automatically after enabling the component.


sl_btmesh_ctl_server_init#

void sl_btmesh_ctl_server_init (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

CTL 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_ctl_server_on_node_reset#

void sl_btmesh_ctl_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_temperature#

uint16_t sl_btmesh_get_temperature (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Function for retrieving actual temperature.

Returns

  • Actual temperature level.


sl_btmesh_get_deltauv#

uint16_t sl_btmesh_get_deltauv (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Function for retrieving actual delta UV.

Returns

  • Actual delta UV level.


sl_btmesh_ctl_set_temperature_deltauv_level#

void sl_btmesh_ctl_set_temperature_deltauv_level (uint16_t temperature, int16_t deltauv, uint32_t transition_ms)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]temperature

Temperature of color.

int16_t[in]deltauv

Delta UV value.

uint32_t[in]transition_ms

Transition time in milliseconds.

Set LED temperature and delta UV in given transition time.


sl_btmesh_ctl_server_snprint_deltauv#

int sl_btmesh_ctl_server_snprint_deltauv (char * buffer, uint16_t buffer_size, uint16_t deltauv_raw)
Parameters
TypeDirectionArgument NameDescription
char *[out]buffer

Character buffer where the formatted delta UV is stored

uint16_t[in]buffer_size

Size of the character buffer

uint16_t[in]deltauv_raw

Raw value of the Delta UV CTL parameter

Utility function to print the delta UV raw value into the passed character buffer in the <sign>X.XX format.

Returns

  • same as snprintf


sl_btmesh_lighting_color_pwm_cb#

void sl_btmesh_lighting_color_pwm_cb (uint16_t color)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]color

Desired light color PWM level.

Callback for setting Light Color by PWM level (0x0001 - FFFE)


sl_btmesh_ctl_on_ui_update#

void sl_btmesh_ctl_on_ui_update (uint16_t temperature, uint16_t deltauv)
Parameters
TypeDirectionArgument NameDescription
uint16_t[in]temperature

Temperature of color.

uint16_t[in]deltauv

Delta UV value.

Called when the UI shall be updated with the changed CTL Model state during a transition. The rate of this callback can be controlled by changing the SL_BTMESH_CTL_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.