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

Nordic Thingy 52 BLE Services

* Thingy configuration service 

* Environment service 

* User interface service 

* Motion service 

* Sound service 

* Battery service 

* DFU service


* Motion service *

The motion module is responsible for reading the 9-axis motion sensor and the low power accelerometer, as well as for sending the data and flash storage of the configuration parameters for this module. It is running on top of the motion BLE service (ble_tms) with base UUID EF68xxxx-9B35-4933-9B10-52FFA9740042. The configuration is stored in flash memory. To turn on sensor reading, enable notifications from the desired characteristic by writing 0x0001 to the Client Characteristic Configuration Descriptor (CCCD) for that characteristic.

Motion 模块读取九轴传感器和低功耗加速度传感器数据,并且能传送数据和Flash 存储的配置参数。Motion 模块基于 UUID: EF68xxxx-9B35-4933-9B10-52FFA9740042的 BLE Service (ble_tms). 配置参数存储于 Flash中。开启传感器读取功能,写 0x0001 到客户端特征配置描述 (CCCD) , 使能想要获取特征的通知。


服务 UUID 定义

文件: ble_tms.h

#define BLE_UUID_TMS_SERVICE 0x0400                      /**< The UUID of the Motion Service. */

文件: ble_tms.c

#define BLE_UUID_TMS_CONFIG_CHAR      0x0401                      /**< The UUID of the config Characteristic. */
#define BLE_UUID_TMS_TAP_CHAR         0x0402                      /**< The UUID of the tap Characteristic. */
#define BLE_UUID_TMS_ORIENTATION_CHAR 0x0403                      /**< The UUID of the orientation Characteristic. */
#define BLE_UUID_TMS_QUATERNION_CHAR  0x0404                      /**< The UUID of the quaternion Characteristic. */
#define BLE_UUID_TMS_PEDOMETER_CHAR   0x0405                      /**< The UUID of the pedometer Characteristic. */
#define BLE_UUID_TMS_RAW_CHAR         0x0406                      /**< The UUID of the raw data Characteristic. */
#define BLE_UUID_TMS_EULER_CHAR       0x0407                      /**< The UUID of the euler Characteristic. */
#define BLE_UUID_TMS_ROT_MAT_CHAR     0x0408                      /**< The UUID of the rotation matrix Characteristic. */
#define BLE_UUID_TMS_HEADING_CHAR     0x0409                      /**< The UUID of the compass heading Characteristic. */
#define BLE_UUID_TMS_GRAVITY_CHAR     0x040A                      /**< The UUID of the gravity vector Characteristic. */

// EF68xxxx-9B35-4933-9B10-52FFA9740042
#define TMS_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/81182137
今日推荐