Bluetooth Mesh Decode component utility header file.
License#
Copyright 2025 Silicon Laboratories Inc. www.silabs.com
SPDX-License-Identifier: Zlib
The licensor of this software is Silicon Laboratories Inc.
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
This notice may not be removed or altered from any source distribution.
/***************************************************************************/
#ifndef SL_BTMESH_DECODER_UTIL_H
#define SL_BTMESH_DECODER_UTIL_H
// -----------------------------------------------------------------------------
// Includes
#include <stdint.h>
#include <psa/crypto.h>
#include "sl_status.h"
#ifdef __cplusplus
extern "C"
{
#endif
// -----------------------------------------------------------------------------
// Function declarations
/***************************************************************************/
sl_status_t psa_status_to_sl_status(psa_status_t sc);
/***************************************************************************/
const char* sl_mesh_decoder_util_get_sampling_function_str(uint8_t sampling_function);
/***************************************************************************/
const char* sl_mesh_decoder_util_get_sensor_setting_access_str(uint8_t setting_access);
/***************************************************************************/
uint8_t sl_mesh_decoder_util_get_sensor_data_size(uint16_t property_id);
/***************************************************************************/
const char* sl_mesh_decoder_util_get_property_str(uint16_t property_id);
#ifdef __cplusplus
}
#endif
#endif // SL_BTMESH_DECODER_UTIL_H
Functions#
Converts a sensor sampling function identifier into a human-readable string.
Converts a sensor setting access value into a human-readable string.
Gets the size of the sensor data based on the property ID.
Gets the string representation of a property ID.
Function Documentation#
psa_status_to_sl_status#
sl_status_t psa_status_to_sl_status (psa_status_t sc)
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| psa_status_t | [in] | sc | psa_status_t code |
Converts PSA status code to SL status code.
Returns
sl_status_t code
sl_mesh_decoder_util_get_sampling_function_str#
const char * sl_mesh_decoder_util_get_sampling_function_str (uint8_t sampling_function)
Converts a sensor sampling function identifier into a human-readable string.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint8_t | [in] | sampling_function | The identifier of the sensor sampling function. |
Returns
A constant character pointer to the string representation of the sampling function.
sl_mesh_decoder_util_get_sensor_setting_access_str#
const char * sl_mesh_decoder_util_get_sensor_setting_access_str (uint8_t setting_access)
Converts a sensor setting access value into a human-readable string.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint8_t | N/A | setting_access | The sensor setting access value. |
Returns
A constant character pointer to the string representation of the sensor setting access.
sl_mesh_decoder_util_get_sensor_data_size#
uint8_t sl_mesh_decoder_util_get_sensor_data_size (uint16_t property_id)
Gets the size of the sensor data based on the property ID.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint16_t | N/A | property_id | The property ID for which to get the sensor data size. |
This function retrieves the size of the sensor data associated with a given property ID. The size is determined based on the property ID and is used to interpret the sensor data correctly.
Returns
The size of the sensor data in bytes.
sl_mesh_decoder_util_get_property_str#
const char * sl_mesh_decoder_util_get_property_str (uint16_t property_id)
Gets the string representation of a property ID.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint16_t | N/A | property_id | The property ID for which to get the string representation. |
Returns
A constant character pointer to the string representation of the property ID.