NORDIC Thingy:52 蓝牙 BLE 服务 SoC 程序调用流程分析之二, Environment Service

Nordic Thingy 52 BLE Services

* Thingy configuration service 

* Environment service 

* User interface service 

* Motion service 

* Sound service 

* Battery service 

* DFU service


* Environment service 

The environment module is responsible for reading the temperature, pressure, humidity, air quality/gas, and light intensity/color sensors, as well as for sending data and configuration. It is running on top of the environment BLE service (ble_tes), the environment sensor drivers, and the environment flash storage with base UUID EF68xxxx-9B35-4933-9B10-52FFA9740042. The configuration is stored in flash. To turn on sensor reading, enable notifications from the desired characteristic by writing 0x0001 to the Client Characteristic Configuration Descriptor (CCCD) for that characteristic.

Environment Module 可读取温度、压力、湿度、空气质量、颜色识别传感器测量数据,并且可传送并设定传感器配置参数。此服务基于 BLE Server(ble_tes), 环境传感器驱动, 环境数据 Flash 储存基于 UUID: EF68xxxx-9B35-4933-9B10-52FFA9740042. 所有的环境传感器配置参数存储于 SoC Flash 中. 使能通知(notifications), 写入 0x0001 到客户端特征配置描述 <Client Characteristic Configuration Descriptor (CCCD)>,即可读取传感器数据。


服务 UUID 定义

文件: ble_tes.h

#define BLE_UUID_TES_SERVICE 0x0200                      /**< The UUID of the Thingy Environment Service. */

文件: ble_tes.c

#define BLE_UUID_TES_TEMPERATURE_CHAR 0x0201                      /**< The UUID of the temperature Characteristic. */
#define BLE_UUID_TES_PRESSURE_CHAR    0x0202                      /**< The UUID of the pressure Characteristic. */
#define BLE_UUID_TES_HUMIDITY_CHAR    0x0203                      /**< The UUID of the humidity Characteristic. */
#define BLE_UUID_TES_GAS_CHAR         0x0204                      /**< The UUID of the gas Characteristic. */
#define BLE_UUID_TES_COLOR_CHAR       0x0205                      /**< The UUID of the gas Characteristic. */
#define BLE_UUID_TES_CONFIG_CHAR      0x0206                      /**< The UUID of the config Characteristic. */
// EF68xxxx-9B35-4933-9B10-52FFA9740042
#define TES_BASE_UUID                  {{0x42, 0x00, 0x74, 0xA9, 0xFF, 0x52, 0x10, 0x9B, 0x33, 0x49, 0x35, 0x9B, 0x00, 0x00, 0x68, 0xEF}} /**< Used vendor specific UUID. */

程序功能调用流程

猜你喜欢

转载自blog.csdn.net/weixin_42396877/article/details/81172923
今日推荐