2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > 低功耗蓝牙BLE对应Gatt的UUID

低功耗蓝牙BLE对应Gatt的UUID

时间:2021-08-27 13:20:18

相关推荐

低功耗蓝牙BLE对应Gatt的UUID

参考/zhangjs0322/article/details/39048939

参考/p/watch_demo/diff/2/trunk/yqc_watch/Components/ble/include/gatt.h

1、在BLE中UUID由32个Hex字符组成(共16字节)。格式为

88888888-4444-4444-4444-CCCCCCCCCCCC

2、TI协议栈在Components/ble/include/gatt_uuid.h文件中。

3、1800和1801服务UUID为TI蓝牙协议栈的GATT层服务。

/**

* WARNINGS: The 16-bit UUIDs are assigned by the Bluetooth SIG and published in the Bluetooth Assigned Numbers page. Do not change these values. Changing them will cause Bluetooth interoperability issues.

*/

/**

* GATT Services

*/

#define GAP_SERVICE_UUID 0x00001800 // Generic Access Profile 通用接入规范

#define GATT_SERVICE_UUID0x00001801 // Generic Attribute Profile 通用属性规范12345678

4、gatt_uuid.h文件中characteristics定义如下

/**

* GATT Characteristics

*/

#define DEVICE_NAME_UUID 0x00002A00 // Device Name 设备名称

#define APPEARANCE_UUID 0x00002A01 // Appearance 外貌特征

#define PERI_PRIVACY_FLAG_UUID 0x00002A02 // Peripheral Privacy Flag 外围设备隐蔽标志

#define PECONNECT_ADDR_UUID0x00002A03 // Peconnection Address 连接地址

#define PERI_CONN_PARAM_UUID0x00002A04 // Peripheral Preferred Connection Parameters 外围设备首选连接参数

#define SERVICE_CHANGED_UUID0x00002A05 // Service Changed 服务改变123456789

5、手机的BLE默认有2个服务

(1)Service 通用属性规范 00001801-0000-1000-8000-00805f9b34fb (null)

a)Characteristic 服务改变 00002a05-0000-1000-8000-00805f9b34fb

(2)Service 通用接入规范 00001800-0000-1000-8000-00805f9b34fb

a)Characteristic 设备名称 00002a00-0000-1000-8000-00805f9b34fb

b)Characteristic 设备外观 00002a01-0000-1000-8000-00805f9b34fb (00 00)

c)Characteristic 设备外观 00002aa6-0000-1000-8000-00805f9b34fb (01)

注意:因为00002aa6不在定义中,因此可以认为是厂商或者用户自定义的特征(或服务)

作者:福州-司马懿

来源:CSDN

原文:/chy555chy/article/details/52229670

版权声明:本文为博主原创文章,转载请附上博文链接!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。