天天看點

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) , 使能想要擷取特征的通知。

NORDIC Thingy:52 藍牙 BLE 服務 SoC 程式調用流程分析之四, Motion Service

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

程式功能調用流程

NORDIC Thingy:52 藍牙 BLE 服務 SoC 程式調用流程分析之四, Motion Service
NORDIC Thingy:52 藍牙 BLE 服務 SoC 程式調用流程分析之四, Motion Service

繼續閱讀