蓝牙ATT_LIST设置服务指令

简介: 蓝牙ATT_LIST设置服务指令

ATT List表格式

image.png注:Handle是从0x0100开始向上累加的数据,0x0000表示列表的结束。


1.建立一个16bit service,service UUID为 0xfee7


0c 00 02 00 28 02 e7 fe


说明:


0c 00为handle,这个需要根据之前的handle+1得到


02 00 28 是Primary Service UUID,表示后面的数据是service UUID


02 为service UUID length,由于建立16bit UUID,所以长度是02


e7 fe 为service UUID,小端在前


2.


建立一个128bit service,service UUID 为0x000102030405060708090a0b0c0d0e0f


0c 00 02 00 28 10 0f 0e 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00


说明:


0c 00为handle,这个需要根据之前的handle+1得到


02 00 28 是Primary Service UUID,表示后面的数据是service UUID


10 为service UUID length,由于建立128bit UUID,所以长度是10


0f 0e 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00为service UUID,小端在前


3.


建立一个16bit master 写通道,UUID为0xfec7,Characteristic为write & write without Response


0d 00 02 03 28 01 0c


0e 00 02 c7 fe 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


说明:


建立一个通道需要2行数据,第一行是对通道特征的描述,第二行是声明了通道的UUID。


0d 00 为handle,这个需要根据之前的handle+1得到


02 03 28 是Characteristic Declaration UUID,表示后面的数据是Characteristic


01 为Characteristic数据长度,固定为01


0c 为Characteristic数据,每个bit为1有效,0c表示write & write without Response,每个bit的含义见附表。


0e 00为handle,这个需要根据之前的handle(0d 00)+1得到


02 为通道UUID长度,由于建立16bit UUID,所以长度是02


C7 fe 为通道UUID,小端在前


14 为通道UUID的数据长度


00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00为master发送read request时,会发送这里的数据给master,master向0xfec7通道写数据时,会向这里写入。


4.


建立一个128bit master 写通道,UUID为0x00112233445566778899aabbccddeeff,Characteristic为write & write without Response


0d 00 02 03 28 01 0c


0e 00 10 ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


说明:


建立一个通道需要2行数据,第一行是对通道特征的描述,第二行是声明了通道的UUID。


0d 00 为handle,这个需要根据之前的handle+1得到


02 03 28 是Characteristic Declaration UUID,表示后面的数据是Characteristic


01 为Characteristic数据长度,固定为01


0c 为Characteristic数据,每个bit为1有效,0c表示write & write without Response,每个bit的含义见附表。


0e 00为handle,这个需要根据之前的handle(0d 00)+1得到


10 为通道UUID长度,由于建立128bit UUID,所以长度是10


ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00  为通道UUID,小端在前


14 为通道UUID的数据长度


00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00为master发送read request时,会发送这里的数据给master,master向0xfec7通道写数据时,会向这里写入。


5.监听通道

建立一个16bit master 监听通道,UUID为0xfec7,Characteristic为Notify


0d 00 02 03 28 01 20


0e 00 02 c7 fe 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


0f 00 02 02 29 02 00 00


说明:


建立一个通道需要3行数据,第一行是对通道特征的描述,第二行是声明了通道的UUID,第三行Client Characteristic Configuration描述,只有notify和indicate需要


0d 00 为handle,这个需要根据之前的handle+1得到


02 03 28 是Characteristic Declaration UUID,表示后面的数据是Characteristic


01 为Characteristic数据长度,固定为01


20为Characteristic数据,每个bit为1有效,20表示indicate,每个bit的含义见附表。


0e 00为handle,这个需要根据之前的handle(0d 00)+1得到


02 为通道UUID长度,由于建立16bit UUID,所以长度是02


C7 fe 为通道UUID,小端在前


14 为通道UUID的数据长度


00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00为master发送read request时,会发送这里的数据给master,master向0xfec7通道写数据时,会向这里写入。


0f 00为handle,这个需要根据之前的handle(0e 00)+1得到


02 02 29是Client Characteristic Configuration UUID,表示后面的数据固定00 00


02 00 00是Client Characteristic Configuration的固定数据,手机连接使能后会写入


附表:


Characteristic含义描述,其中Broadcast,Authentication Signed Write,Extended Properties芯片不支持使用

image.png


image.pngimage.pngimage.png

目录
相关文章
|
1月前
|
文字识别 Java
文本,文字识别07,SpringBoot服务开发-入参和返回值,编写接口的时候,要注意识别的文字返回的是多行,因此必须是List集合,Bean层,及实体类的搭建
文本,文字识别07,SpringBoot服务开发-入参和返回值,编写接口的时候,要注意识别的文字返回的是多行,因此必须是List集合,Bean层,及实体类的搭建
|
前端开发
前端项目实战玖拾肆react-admin+material ui-踩坑-List的用法之disableAuthentication设置验证
前端项目实战玖拾肆react-admin+material ui-踩坑-List的用法之disableAuthentication设置验证
58 0
|
前端开发
前端项目实战玖拾叁react-admin+material ui-踩坑-List的用法之debounce设置显示时间
前端项目实战玖拾叁react-admin+material ui-踩坑-List的用法之debounce设置显示时间
65 0
|
前端开发
前端项目实战玖拾陆react-admin+material ui-踩坑-List的用法之Empty来设置空列表
前端项目实战玖拾陆react-admin+material ui-踩坑-List的用法之Empty来设置空列表
62 0
|
前端开发
前端项目实战壹佰react-admin+material ui-踩坑-List的用法之filterDefaultValues设置默认值情况
前端项目实战壹佰react-admin+material ui-踩坑-List的用法之filterDefaultValues设置默认值情况
42 0
|
前端开发
前端项目实战柒拾react-admin+material ui-踩坑-List需要Datagrid中hover设置写法
前端项目实战柒拾react-admin+material ui-踩坑-List需要Datagrid中hover设置写法
57 0
|
前端开发
前端项目实战柒拾壹react-admin+material ui-踩坑-List需要Datagrid中isRowExpandable设置写法
前端项目实战柒拾壹react-admin+material ui-踩坑-List需要Datagrid中isRowExpandable设置写法
54 0
|
前端开发
前端项目实战柒拾伍react-admin+material ui-踩坑-List需要Datagrid中rowEdit设置写法
前端项目实战柒拾伍react-admin+material ui-踩坑-List需要Datagrid中rowEdit设置写法
42 0
|
前端开发
前端项目实战柒拾玖react-admin+material ui-踩坑-List的用法需要设置resource
前端项目实战柒拾玖react-admin+material ui-踩坑-List的用法需要设置resource
34 0
|
前端开发
前端项目实战柒拾叁react-admin+material ui-踩坑-List需要Datagrid中optimized设置写法
前端项目实战柒拾叁react-admin+material ui-踩坑-List需要Datagrid中optimized设置写法
70 0