nRF5 SDK for Mesh v5.0.0
Data Structures | Functions
Sensor model utility functions

Implements the various utilities needed at various locations in the sensor code, from model to mid app to top app. More...

Data Structures

struct  sensor_mpid_a_t
 Format A of the Marshalled Property ID (MPID) field. More...
 
struct  sensor_mpid_b_t
 Format B of the Marshalled Property ID (MPID) field. More...
 

Functions

static bool sensor_property_id_supported (uint16_t *p_properties, uint16_t property_id)
 Look through the supported property_id list to check for property_id support. More...
 
static uint64_t publish_period_get (access_model_handle_t model_handle)
 Gets the publish period for the given model in microseconds. More...
 
static void sensor_mpid_a_create (uint16_t property_id, uint8_t data_bytes, uint8_t *p_buffer)
 Create format A of the Marshalled Property ID (MPID) field. More...
 
static void sensor_mpid_b_create (uint16_t property_id, uint8_t data_bytes, uint8_t *p_buffer)
 Create format B of the Marshalled Property ID (MPID) field. More...
 

Detailed Description

Implements the various utilities needed at various locations in the sensor code, from model to mid app to top app.

Function Documentation

◆ sensor_property_id_supported()

static bool sensor_property_id_supported ( uint16_t *  p_properties,
uint16_t  property_id 
)
inlinestatic

Look through the supported property_id list to check for property_id support.

Parameters
[in]p_propertiesPointer to an array of all supported properties.
[in]property_idThe Property ID to look for.
Returns
true if property_id is found, false otherwise

Definition at line 106 of file sensor_utils.h.

References NRF_MESH_ASSERT.

◆ publish_period_get()

static uint64_t publish_period_get ( access_model_handle_t  model_handle)
inlinestatic

Gets the publish period for the given model in microseconds.

Parameters
[in]model_handleModel handle assigned to this instance.
Returns
publish period in microseconds, or 0 if no publish period is set.

Definition at line 131 of file sensor_utils.h.

References access_model_publish_period_get(), ACCESS_PUBLISH_RESOLUTION_100MS, ACCESS_PUBLISH_RESOLUTION_10MIN, ACCESS_PUBLISH_RESOLUTION_10S, and ACCESS_PUBLISH_RESOLUTION_1S.

◆ sensor_mpid_a_create()

static void sensor_mpid_a_create ( uint16_t  property_id,
uint8_t  data_bytes,
uint8_t *  p_buffer 
)
inlinestatic

Create format A of the Marshalled Property ID (MPID) field.

See Bluetooth Mesh Model Specification (MshMDLv1.0.1) section 4.2.14 for more details.

Parameters
[in]property_idThe Property ID identifying a sensor.
[in]data_bytesLength of the Property Value
[out]p_bufferPointer to buffer where the Marshalled Sensor data will be stored.

Definition at line 178 of file sensor_utils.h.

References sensor_mpid_a_t::format, sensor_mpid_a_t::length, and sensor_mpid_a_t::property_id.

◆ sensor_mpid_b_create()

static void sensor_mpid_b_create ( uint16_t  property_id,
uint8_t  data_bytes,
uint8_t *  p_buffer 
)
inlinestatic

Create format B of the Marshalled Property ID (MPID) field.

See Bluetooth Mesh Model Specification (MshMDLv1.0.1) section 4.2.14 for more details.

Parameters
[in]property_idThe Property ID identifying a sensor.
[in]data_bytesLength of the Property Value
[out]p_bufferPointer to buffer where the Marshalled Sensor data will be stored.

Definition at line 198 of file sensor_utils.h.

References sensor_mpid_b_t::format, sensor_mpid_b_t::length, and sensor_mpid_b_t::property_id.


Documentation feedback | Developer Zone | Subscribe | Updated