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. */

程序功能调用流程

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值