Bluetooth Mesh Light Control Server Model#

Bluetooth Mesh Light Control Server Model.

Bluetooth Mesh Light Control Server model functionality.

All LC Server state resides in and is own by the Model (stack). The state update notification events to the application are informational: the application is not required to react to them. The application may choose to save the LC Server state in persistent storage and set the states in the LC Server following a restart. To do this the application can utilize the notification events and update command.

Each LC Server instance requires that a Lightness Server is initialized in the element preceding the LC Server element: LC Server controls the Lightness Server residing in the preceding element. Each LC Server instance requires that a generic OnOff Server is initialized in the same element as the LC Server.

Modules#

sl_btmesh_evt_lc_server_mode_updated

sl_btmesh_evt_lc_server_om_updated

sl_btmesh_evt_lc_server_light_onoff_updated

sl_btmesh_evt_lc_server_occupancy_updated

sl_btmesh_evt_lc_server_ambient_lux_level_updated

sl_btmesh_evt_lc_server_linear_output_updated

sl_btmesh_evt_lc_server_state_updated

sl_btmesh_evt_lc_server_regulator_debug_info

Enumerations#

enum
sl_btmesh_lc_server_lc_state_off = 0x0
sl_btmesh_lc_server_lc_state_standby = 0x1
sl_btmesh_lc_server_lc_state_fade_on = 0x2
sl_btmesh_lc_server_lc_state_run = 0x3
sl_btmesh_lc_server_lc_state_fade = 0x4
sl_btmesh_lc_server_lc_state_prolong = 0x5
sl_btmesh_lc_server_lc_state_fade_standby_auto = 0x6
sl_btmesh_lc_server_lc_state_fade_standby_manual = 0x7
}

These values define the possible states of Light Controller.

enum
sl_btmesh_lc_server_lc_event_state_updated = 0x1
sl_btmesh_lc_server_lc_event_regulator_debug_info = 0x2
}

These values identify optional diagnostic events that provide more information to the application about LC behavior.

Functions#

sl_status_t
sl_btmesh_lc_server_init(uint16_t elem_index)
sl_status_t
sl_btmesh_lc_server_deinit(uint16_t elem_index)
sl_status_t
sl_btmesh_lc_server_update_mode(uint16_t elem_index, uint8_t mode)
sl_status_t
sl_btmesh_lc_server_update_om(uint16_t elem_index, uint8_t om)
sl_status_t
sl_btmesh_lc_server_update_light_onoff(uint16_t elem_index, uint8_t light_onoff, uint32_t transition_time_ms)
sl_status_t
sl_status_t
sl_btmesh_lc_server_set_publish_mask(uint16_t elem_index, uint16_t status_type, uint8_t value)
sl_status_t
sl_btmesh_lc_server_set_regulator_interval(uint16_t elem_index, uint8_t value)
sl_status_t
sl_btmesh_lc_server_set_event_mask(uint16_t elem_index, uint16_t event_type, uint8_t value)
sl_status_t
sl_btmesh_lc_server_get_lc_state(uint16_t elem_index, uint8_t *state, uint32_t *transition_time)

Enumeration Documentation#

sl_btmesh_lc_server_lc_state_t#

sl_btmesh_lc_server_lc_state_t

These values define the possible states of Light Controller.

Enumerator
sl_btmesh_lc_server_lc_state_off

(0x0) The controller is turned off and does not control lighting.

sl_btmesh_lc_server_lc_state_standby

(0x1) The controller is turned on and awaits an event from an occupancy sensor or a manual switch.

sl_btmesh_lc_server_lc_state_fade_on

(0x2) The controller has been triggered and gradually transitions to the Run phase, gradually dimming the lights up.>

sl_btmesh_lc_server_lc_state_run

(0x3) The lights are on and the timer counts down (but may be re-triggered by a sensor or a switch event).

sl_btmesh_lc_server_lc_state_fade

(0x4) The Run timer has expired and the controller gradually transitions to the Prolong state.

sl_btmesh_lc_server_lc_state_prolong

(0x5) The lights are at a lower level and the timer counts down (but may be re-triggered by a sensor or a switch event).

sl_btmesh_lc_server_lc_state_fade_standby_auto

(0x6) The controller gradually returns to the Standby state

sl_btmesh_lc_server_lc_state_fade_standby_manual

(0x7) The controller gradually returns to the Standby state after external event.


Definition at line 13928 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_lc_debug_events_t#

sl_btmesh_lc_server_lc_debug_events_t

These values identify optional diagnostic events that provide more information to the application about LC behavior.

Enumerator
sl_btmesh_lc_server_lc_event_state_updated

(0x1) Event reporting LC Server state machine state changes along with the remaining state timer.

sl_btmesh_lc_server_lc_event_regulator_debug_info

(0x2) Event reporting LC Server PI regulator integral term and regulator output.


Definition at line 13990 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

Function Documentation#

sl_btmesh_lc_server_init#

sl_status_t sl_btmesh_lc_server_init (uint16_t elem_index)
Parameters
[in]elem_index

Index of the element.

Initialize the LC Server model. The server does not have any internal configuration. The command only activates the model in the mesh stack.

Each LC Server instance requires that a Lightness Server is initialized in the element preceding the LC Server element: LC Server controls the Lightness Server residing in the preceding element. Each LC Server instance requires that a generic OnOff Server is initialized in the same element as the LC Server.

LC properties are initialized as follows:

PropertyID: PropertyValue 0x002B: 0x111111, 0x002C: 0x011111, 0x002D: 0x001111, 0x002E: 0xf000, 0x002F: 0x0f00, 0x0030: 0x00f0, 0x031: 50, 0x032: 25.0, 0x0033: 250.0, 0x0034: 80.0, 0x0035: 80.0, 0x0036: 3000, 0x0037: 3000, 0x0038: 3000, 0x0039: 3000, 0x003A: 0, 0x003B: 3000, 0x003C: 3000

PI Regulator interval (T) is initialized to 50ms

The rest of the state values are initialized to zero

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14285 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_deinit#

sl_status_t sl_btmesh_lc_server_deinit (uint16_t elem_index)
Parameters
[in]elem_index

Index of the element.

De-initializes the LC Server model.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14296 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_update_mode#

sl_status_t sl_btmesh_lc_server_update_mode (uint16_t elem_index, uint8_t mode)
Parameters
[in]elem_index

Index of the element.

[in]mode

Mode value. Valid range: 0-1.

Update the LC Server model Mode state in the stack. Application may choose to directly set the model state in the stack, this function will pass the state value to the LC Server model.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14310 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_update_om#

sl_status_t sl_btmesh_lc_server_update_om (uint16_t elem_index, uint8_t om)
Parameters
[in]elem_index

Index of the element.

[in]om

Occupancy Mode value. Valid range: 0-1.

Update the LC Server model Occupancy Mode state in the stack. The application may choose to directly set the model state in the stack. This function will pass the state value to the LC Server model.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14324 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_update_light_onoff#

sl_status_t sl_btmesh_lc_server_update_light_onoff (uint16_t elem_index, uint8_t light_onoff, uint32_t transition_time_ms)
Parameters
[in]elem_index

Index of the element.

[in]light_onoff

Light OnOff value. Valid range: 0-1.

[in]transition_time_ms

Amount of time (in milliseconds) that the element will take to transition to the target state from the present state. If set to 0, the transition will be immediate.

Update the LC Server model Light OnOff state in the stack. The application may choose to directly set the model state in the stack. This function will pass the state value to the LC Server model.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14341 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_init_all_properties#

sl_status_t sl_btmesh_lc_server_init_all_properties (uint16_t elem_index)
Parameters
[in]elem_index

Index of the element.

Initialize all LC properties in one attempt. The following values are used:

PropertyID: PropertyValue 0x002B: 0x111111, 0x002C: 0x011111, 0x002D: 0x001111, 0x002E: 0xf000, 0x002F: 0x0f00, 0x0030: 0x00f0, 0x031: 50, 0x032: 25.0, 0x0033: 250.0, 0x0034: 80.0, 0x0035: 80.0, 0x0036: 3000, 0x0037: 3000, 0x0038: 3000, 0x0039: 3000, 0x003A: 0, 0x003B: 3000, 0x003C: 3000

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14359 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_set_publish_mask#

sl_status_t sl_btmesh_lc_server_set_publish_mask (uint16_t elem_index, uint16_t status_type, uint8_t value)
Parameters
[in]elem_index

Index of the element.

[in]status_type

The type of status message to turn on/off. Options for this are:

LC Mode Status 0x8294 LC Occupancy Mode Status 0x8298 LC Light On Off Status 0x829C

[in]value

Turn on or off the status message. Non zero - enable, otherwise disable.

Update the bitmask that controls which messages are sent when the LC Server publishes. By default, the bitmask will be enabled to publish all three status messages.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14380 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_set_regulator_interval#

sl_status_t sl_btmesh_lc_server_set_regulator_interval (uint16_t elem_index, uint8_t value)
Parameters
[in]elem_index

Index of the element.

[in]value

Valid values are 1 ms-100 ms. (Default: 50 ms)

Update the summation interval (T) at which the PI regulator is run. Only valid when the regulator is disabled (Light LC Mode is 0).

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14395 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_set_event_mask#

sl_status_t sl_btmesh_lc_server_set_event_mask (uint16_t elem_index, uint16_t event_type, uint8_t value)
Parameters
[in]elem_index

Index of the element.

[in]event_type

The type of event to enable/disable. Options are:

lc_event_state_updated = 0x01, state_updated event report state changes lc_event_regulator_debug_info = 0x02, regulator_debug_info Regulator calculation details

[in]value

Valid values are 0 and 1 to disable or enable the event

Enable or disable additional diagnostics events. See lc_debug_events.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14415 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_lc_server_get_lc_state#

sl_status_t sl_btmesh_lc_server_get_lc_state (uint16_t elem_index, uint8_t * state, uint32_t * transition_time)
Parameters
[in]elem_index

Index of the element.

[out]state

The current state of LC state machine

[out]transition_time

Transition time left for the current LC state.

Fetch the current LC state. States can be as Off, Standby, Fade On, Run, Fade, Prolong, Fade Standby Auto, Fade Standby Manual

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 14431 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

Macro Definition Documentation#

sl_btmesh_cmd_lc_server_init_id#

#define sl_btmesh_cmd_lc_server_init_id
Value:
0x004d0028

Definition at line 13904 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lc_server_deinit_id#

#define sl_btmesh_cmd_lc_server_deinit_id
Value:
0x014d0028

Definition at line 13905 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lc_server_update_mode_id#

#define sl_btmesh_cmd_lc_server_update_mode_id
Value:
0x024d0028

Definition at line 13906 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lc_server_update_om_id#

#define sl_btmesh_cmd_lc_server_update_om_id
Value:
0x034d0028

Definition at line 13907 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lc_server_update_light_onoff_id#

#define sl_btmesh_cmd_lc_server_update_light_onoff_id
Value:
0x044d0028

Definition at line 13908 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lc_server_init_all_properties_id#

#define sl_btmesh_cmd_lc_server_init_all_properties_id
Value:
0x054d0028

Definition at line 13909 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lc_server_set_publish_mask_id#

#define sl_btmesh_cmd_lc_server_set_publish_mask_id
Value:
0x064d0028

Definition at line 13910 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lc_server_set_regulator_interval_id#

#define sl_btmesh_cmd_lc_server_set_regulator_interval_id
Value:
0x074d0028

Definition at line 13911 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lc_server_set_event_mask_id#

#define sl_btmesh_cmd_lc_server_set_event_mask_id
Value:
0x084d0028

Definition at line 13912 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_lc_server_get_lc_state_id#

#define sl_btmesh_cmd_lc_server_get_lc_state_id
Value:
0x094d0028

Definition at line 13913 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_init_id#

#define sl_btmesh_rsp_lc_server_init_id
Value:
0x004d0028

Definition at line 13914 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_deinit_id#

#define sl_btmesh_rsp_lc_server_deinit_id
Value:
0x014d0028

Definition at line 13915 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_update_mode_id#

#define sl_btmesh_rsp_lc_server_update_mode_id
Value:
0x024d0028

Definition at line 13916 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_update_om_id#

#define sl_btmesh_rsp_lc_server_update_om_id
Value:
0x034d0028

Definition at line 13917 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_update_light_onoff_id#

#define sl_btmesh_rsp_lc_server_update_light_onoff_id
Value:
0x044d0028

Definition at line 13918 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_init_all_properties_id#

#define sl_btmesh_rsp_lc_server_init_all_properties_id
Value:
0x054d0028

Definition at line 13919 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_set_publish_mask_id#

#define sl_btmesh_rsp_lc_server_set_publish_mask_id
Value:
0x064d0028

Definition at line 13920 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_set_regulator_interval_id#

#define sl_btmesh_rsp_lc_server_set_regulator_interval_id
Value:
0x074d0028

Definition at line 13921 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_set_event_mask_id#

#define sl_btmesh_rsp_lc_server_set_event_mask_id
Value:
0x084d0028

Definition at line 13922 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_lc_server_get_lc_state_id#

#define sl_btmesh_rsp_lc_server_get_lc_state_id
Value:
0x094d0028

Definition at line 13923 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h