Bluetooth Mesh Sensor Client Model#

Bluetooth Mesh Sensor Client Model.

This class provides the commands and messages to interface with the Sensor Client model.

Modules#

sl_btmesh_evt_sensor_client_descriptor_status

sl_btmesh_evt_sensor_client_cadence_status

sl_btmesh_evt_sensor_client_settings_status

sl_btmesh_evt_sensor_client_setting_status

sl_btmesh_evt_sensor_client_status

sl_btmesh_evt_sensor_client_column_status

sl_btmesh_evt_sensor_client_series_status

sl_btmesh_evt_sensor_client_publish

Functions#

sl_status_t
sl_btmesh_sensor_client_get_descriptor(uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id)
sl_status_t
sl_btmesh_sensor_client_get(uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id)
sl_status_t
sl_btmesh_sensor_client_get_column(uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, size_t column_id_len, const uint8_t *column_id)
sl_status_t
sl_btmesh_sensor_client_get_series(uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, size_t column_ids_len, const uint8_t *column_ids)
sl_status_t
sl_btmesh_sensor_client_get_cadence(uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id)
sl_status_t
sl_btmesh_sensor_client_set_cadence(uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, size_t params_len, const uint8_t *params)
sl_status_t
sl_btmesh_sensor_client_get_settings(uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id)
sl_status_t
sl_btmesh_sensor_client_get_setting(uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, uint16_t setting_id)
sl_status_t
sl_btmesh_sensor_client_set_setting(uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, uint16_t setting_id, size_t raw_value_len, const uint8_t *raw_value)

Function Documentation#

sl_btmesh_sensor_client_init#

sl_status_t sl_btmesh_sensor_client_init ()

Initialize the Sensor Client model. Sensor Client does not have any internal configuration, it only activates the model in the Bluetooth mesh stack.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


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

sl_btmesh_sensor_client_deinit#

sl_status_t sl_btmesh_sensor_client_deinit ()

Deinitialize the Sensor Client model. There are no sensor-specific configurations to reset. Normally, models are initialized at boot and never deinitialized.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


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

sl_btmesh_sensor_client_get_descriptor#

sl_status_t sl_btmesh_sensor_client_get_descriptor (uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id)
Parameters
[in]server_address

Destination server model address. The address 0x0000 can be used to publish the message according to model configuration

[in]elem_index

Client model element index

[in]appkey_index

The application key index to use.

[in]flags

No flags defined currently

[in]property_id

ProperyID for the sensor (optional). Range: 0x0001 - 0xffff for a specific device property ID or 0x0000 to get all (the value 0x0000 is prohibited as a real ID).

Get the Sensor Descriptor state of one specific sensor or all sensors within a model. Results in a Sensor Descriptor Status event

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


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

sl_btmesh_sensor_client_get#

sl_status_t sl_btmesh_sensor_client_get (uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id)
Parameters
[in]server_address

Destination server model address. The address 0x0000 can be used to publish the message according to model configuration

[in]elem_index

Client model element index

[in]appkey_index

The application key index to use.

[in]flags

No flags defined currently

[in]property_id

Property ID for the sensor. Range: 0x0001 - 0x0ffff for a specific device property, or 0x0000 when not used to get values for all sensors present in the element.

Send a Sensor Get message to fetch the Sensor Data state of one specific sensor given by its Property ID, results in a Sensor Status event. The Property ID 0x0000 can be used to fetch all sensor values present at a server element.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


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

sl_btmesh_sensor_client_get_column#

sl_status_t sl_btmesh_sensor_client_get_column (uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, size_t column_id_len, const uint8_t * column_id)
Parameters
[in]server_address

Destination server model address. The address 0x0000 can be used to publish the message according to model configuration

[in]elem_index

Client model element index

[in]appkey_index

The application key index to use.

[in]flags

No flags defined currently

[in]property_id

Property ID for the sensor. Range: 0x0001 - 0x0ffff for a specific device property, the value 0x0000 is prohibited.

[in]column_id_len

Length of data in column_id

[in]column_id

Raw value identifying a column

Get a Sensor Series Column state, results in a Sensor Column Status event.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


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

sl_btmesh_sensor_client_get_series#

sl_status_t sl_btmesh_sensor_client_get_series (uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, size_t column_ids_len, const uint8_t * column_ids)
Parameters
[in]server_address

Destination server model address. The address 0x0000 can be used to publish the message according to model configuration

[in]elem_index

Client model element index

[in]appkey_index

The application key index to use.

[in]flags

No flags defined currently

[in]property_id

Property ID for the sensor. Range: 0x0001 - 0x0ffff for a specific device property, the value 0x0000 is prohibited.

[in]column_ids_len

Length of data in column_ids

[in]column_ids

Raw values identifying starting and ending columns

Get a Sensor Series Column state, which results in a Sensor Series Status event.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


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

sl_btmesh_sensor_client_get_cadence#

sl_status_t sl_btmesh_sensor_client_get_cadence (uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id)
Parameters
[in]server_address

Destination server model address. The address 0x0000 can be used to publish the message according to model configuration

[in]elem_index

Client model element index

[in]appkey_index

The application key index to use

[in]flags

No flags defined currently

[in]property_id

Property ID for the sensor. Range: 0x0001 - 0x0ffff for a specific device property, the value 0x0000 is prohibited.

Send a Sensor Get Cadence message to get the Sensor Cadence state, which results in a Sensor Cadence Status message.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


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

sl_btmesh_sensor_client_set_cadence#

sl_status_t sl_btmesh_sensor_client_set_cadence (uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, size_t params_len, const uint8_t * params)
Parameters
[in]server_address

Destination server model address. The address 0x0000 can be used to publish the message according to model configuration

[in]elem_index

Client model element index

[in]appkey_index

The application key index to use

[in]flags

Bit 1 (0x02) defines whether response is required. If set to 1, SET CADENCE message will be sent, zero will send SET CADENCE UNACKNOWLEDGED

[in]property_id

Property ID for the sensor. Range: 0x0001 - 0x0ffff for a specific device property, the value 0x0000 is prohibited.

[in]params_len

Length of data in params

[in]params

Byte array containing serialized fields of Sensor Cadence state, excluding the property ID

  • Fast Cadence Period Divisor, 7 bits

  • Status Trigger type, 1 bit (0 = discrete value, 1 = percentage)

  • Status Trigger Delta Down, variable length

  • Status Trigger Delta Up, variable length

  • Status Min Interval, 8 bits, representing a power of 2 milliseconds. Valid range is 0-26

  • Fast Cadence Low, variable length, lower bound for the fast cadence range

  • Low Cadence Low, variable length, higher bound for the fast cadence range

Send a Sensor Cadence Set message, either acknowledged or unacknowledged, depending on the message flags. Acknowledged message results in a Cadence Status reply message and event. The server must publish its new state in any case.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


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

sl_btmesh_sensor_client_get_settings#

sl_status_t sl_btmesh_sensor_client_get_settings (uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id)
Parameters
[in]server_address

Destination server model address. The address 0x0000 can be used to publish the message according to model configuration

[in]elem_index

Client model element index

[in]appkey_index

The application key index to use

[in]flags

No flags defined currently

[in]property_id

Property ID for the sensor. Range: 0x0001 - 0x0ffff for a specific device property, the value 0x0000 is prohibited.

Send a Sensor Settings Get message to fetch the Sensor Property IDs present for the given sensor, which results in a Sensor Settings Status event.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


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

sl_btmesh_sensor_client_get_setting#

sl_status_t sl_btmesh_sensor_client_get_setting (uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, uint16_t setting_id)
Parameters
[in]server_address

Destination server model address. The address 0x0000 can be used to publish the message according to model configuration

[in]elem_index

Client model element index

[in]appkey_index

The application key index to use.

[in]flags

No flags defined currently

[in]property_id

Property ID for the sensor. Range: 0x0001 - 0x0ffff for a specific device property, the value 0x0000 is prohibited.

[in]setting_id

Sensor Setting Property ID field identifying the device property of a setting. Range: 0x0001 - 0xffff, 0x0000 is prohibited.

Send a Sensor Get Setting message to get the value of a specific setting for the given sensor, which results in a Sensor Setting Status event.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


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

sl_btmesh_sensor_client_set_setting#

sl_status_t sl_btmesh_sensor_client_set_setting (uint16_t server_address, uint16_t elem_index, uint16_t appkey_index, uint8_t flags, uint16_t property_id, uint16_t setting_id, size_t raw_value_len, const uint8_t * raw_value)
Parameters
[in]server_address

Destination server model address. The address 0x0000 can be used to publish the message according to model configuration

[in]elem_index

Client model element index

[in]appkey_index

The application key index to use

[in]flags

Bit 1 (0x02) defines whether response is required. If set to 1, SET SETTING message is sent, zero will use SET SETTING UNACKNOWLEDGED.

[in]property_id

Property ID for the sensor. Range: 0x0001 - 0x0ffff for a specific device property, the value 0x0000 is prohibited.

[in]setting_id

Sensor Setting Property ID field identifying the device property of a setting. Range: 0x0001 - 0xffff, 0x0000 is prohibited.

[in]raw_value_len

Length of data in raw_value

[in]raw_value

Sensor Setting raw value. Size and representation depends on the type defined by the Sensor Setting Property ID.

Send Sensor Setting Set message to update the value of a specific setting for the given sensor, either acknowledged or unacknowledged depending on the message flags. Only acknowledged requests will have a direct Sensor Setting Status reply. The server must publish its new state in any case.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.

Events


Definition at line 13024 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_sensor_client_init_id#

#define sl_btmesh_cmd_sensor_client_init_id
Value:
0x00490028

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

sl_btmesh_cmd_sensor_client_deinit_id#

#define sl_btmesh_cmd_sensor_client_deinit_id
Value:
0x01490028

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

sl_btmesh_cmd_sensor_client_get_descriptor_id#

#define sl_btmesh_cmd_sensor_client_get_descriptor_id
Value:
0x02490028

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

sl_btmesh_cmd_sensor_client_get_id#

#define sl_btmesh_cmd_sensor_client_get_id
Value:
0x03490028

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

sl_btmesh_cmd_sensor_client_get_column_id#

#define sl_btmesh_cmd_sensor_client_get_column_id
Value:
0x04490028

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

sl_btmesh_cmd_sensor_client_get_series_id#

#define sl_btmesh_cmd_sensor_client_get_series_id
Value:
0x05490028

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

sl_btmesh_cmd_sensor_client_get_cadence_id#

#define sl_btmesh_cmd_sensor_client_get_cadence_id
Value:
0x06490028

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

sl_btmesh_cmd_sensor_client_set_cadence_id#

#define sl_btmesh_cmd_sensor_client_set_cadence_id
Value:
0x07490028

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

sl_btmesh_cmd_sensor_client_get_settings_id#

#define sl_btmesh_cmd_sensor_client_get_settings_id
Value:
0x08490028

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

sl_btmesh_cmd_sensor_client_get_setting_id#

#define sl_btmesh_cmd_sensor_client_get_setting_id
Value:
0x09490028

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

sl_btmesh_cmd_sensor_client_set_setting_id#

#define sl_btmesh_cmd_sensor_client_set_setting_id
Value:
0x0a490028

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

sl_btmesh_rsp_sensor_client_init_id#

#define sl_btmesh_rsp_sensor_client_init_id
Value:
0x00490028

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

sl_btmesh_rsp_sensor_client_deinit_id#

#define sl_btmesh_rsp_sensor_client_deinit_id
Value:
0x01490028

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

sl_btmesh_rsp_sensor_client_get_descriptor_id#

#define sl_btmesh_rsp_sensor_client_get_descriptor_id
Value:
0x02490028

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

sl_btmesh_rsp_sensor_client_get_id#

#define sl_btmesh_rsp_sensor_client_get_id
Value:
0x03490028

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

sl_btmesh_rsp_sensor_client_get_column_id#

#define sl_btmesh_rsp_sensor_client_get_column_id
Value:
0x04490028

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

sl_btmesh_rsp_sensor_client_get_series_id#

#define sl_btmesh_rsp_sensor_client_get_series_id
Value:
0x05490028

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

sl_btmesh_rsp_sensor_client_get_cadence_id#

#define sl_btmesh_rsp_sensor_client_get_cadence_id
Value:
0x06490028

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

sl_btmesh_rsp_sensor_client_set_cadence_id#

#define sl_btmesh_rsp_sensor_client_set_cadence_id
Value:
0x07490028

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

sl_btmesh_rsp_sensor_client_get_settings_id#

#define sl_btmesh_rsp_sensor_client_get_settings_id
Value:
0x08490028

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

sl_btmesh_rsp_sensor_client_get_setting_id#

#define sl_btmesh_rsp_sensor_client_get_setting_id
Value:
0x09490028

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

sl_btmesh_rsp_sensor_client_set_setting_id#

#define sl_btmesh_rsp_sensor_client_set_setting_id
Value:
0x0a490028

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