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

程序功能调用流程

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值