当前位置:网站首页>BLE之ATT请求
BLE之ATT请求
2022-07-26 10:51:00 【deparks】
BLE之ATT请求
1. mtu交换
request: Exchange MTU Request (client/server都可以发起)
Client Rx MTU: 23
response: Exchange MTU Response
Server Rx MTU: 65
2. 发现服务
request: Find By Type Value Request
start handle: 1
end handle: 65535
attribute type(UUID): primary service
value to find: 0x1801
response: Find By Type Value Response
Attribute Handles:
start handle: 8
end handle: 11
发现所有服务: Read By Group Type Request
start handle: 1
end handle: 65535
attribute type(UUID): primary service
3. 发现特性
request: Read By Type Request
start handle: 23
end handle: 26
attritube type: 0x2803(BT_UUID_GATT_CHRC)
Reponse: Read By Type Response
length: 7(只有7或21:两个值,如果uuid是16 byte,则length为21)
handle: 24
struct gatt_chrc {
u8_t properties=0x12;
u16_t value_handle = 25;
union {
u16_t uuid16 = 0x2a19; // Battery Level
u8_t uuid[16];
};
}
4. 发现描述符
Request: Find Information Request
start handle: 40
end handle: 41
Reponse: Find Information Reponse
handle: 40
UUID: Client Characteristic Configuration
handle: 41
UUID: Report Reference
5. 读特性
Request: Read Request
Attribute Value: 3(Device Name)
Response: Read Response
Attribute Value: MiMouse
6. 写特性
Requese: Write Request
handle: xxx
value: xxx
Reponse: Write Request:
no param
7. 写ccc
Requese: Write Request:
handle: 26(对应Battary Level 的ccc)
value: 1
Reponse: Write Response:
no param
写ccc时协议栈维护了一个链表
8. 发通知
Handle Value Notification
10. 发指示
Handle Value Indication
边栏推荐
- @Notblank, @notnull, @notempty differences and uses
- Bash shell learning notes (II)
- Flutter报错 Incorrect use of ParentDataWidget When the exception was thrown, this was the stack:
- Bash shell学习笔记(二)
- Many people don't know whether they are looking for Kanban software or Kanban software
- logging 学习最终版-配置的不同级别日志打印的颜色
- Sql Server 之SQL语句对基本表及其中的数据的创建和修改
- Stringing of macro parameters and connection of macro parameters in C language
- Flutter TextField怎样去除下划线及有焦点时颜色
- 母亲
猜你喜欢

微信公众号消息通知 “errcode“:40164,“errmsg“:“invalid ip

mysql20210906

349. 两个数组的交集

0x00007ffd977c04a8 (qt5sqld.dll) (in a.exe): 0xc0000005: an access violation occurred when reading position 0x0000000000000010

35. Search the insertion position

Why do I need automated testing? Software testers take you to evaluate different software testing tools

20210807 1 c language program structure

242.有效的字母异位词

nmap弱点扫描结果可视化转换

344.反转字符串
随机推荐
C#halcon用户控件崩溃的一种处理方法
2021-08-12 function recursion_ Learn C language with brother Peng
Pengge C language sixth class
WIRESHARK基础教程以太帧的分析。
pytest conftest.py和fixture的配合使用
Sword finger offer (twenty): stack containing min function
c结构体中定义的成员指针赋值与结构体指针作为成员函数参数的使用
ThreadPoolExecutor是怎样执行任务的
10 let operator= return a reference to *this
访问权限——private,public,protected
logging基本使用
二叉树的遍历 递归+迭代
0x00007ffd977c04a8 (qt5sqld.dll) (in a.exe): 0xc0000005: an access violation occurred when reading position 0x0000000000000010
Bash shell learning notes (III)
解决org.apache.commons.codec.binary.Base64爆红问题
Sword finger offer (43): left rotation string
C language pengge 20210812c language function
Sword finger offer (53): a string representing a numeric value
RT thread learning notes (VII) -- open the elmfat file system based on SPI flash (middle)
Constructors, method overloads, object arrays, and static