ATT_GATT協議數據分析
下面我們將對ATT完整的一次建立過程進行數據分析,數據來源於btsnoop_hci_gatt.log。
以下藍色爲hci部分、綠色爲l2cap部分、紅色爲ATT部分,這裏我只針對ATT協議進行解析
1、Client(Master):Request
00000010 00000010 00000000 00001011 00000000 00000111 00000000 00000100 00000000 00010000 00000001 00000000 11111111 11111111 00000000 00101000
Authentication Signature Flag:0(協議包末尾沒有認證簽名)
PDU Type is Command:0(不是一個命令包)
Opcode:010000(0x10,Read by Group Type Request)
Attribute Parameters:
Starting Attribute Handle:00000001 00000000(0x0001,起始句柄爲1)
Ending Attribute Handle: 11111111 11111111(0xffff,結束句柄爲65535)
Attribute Group Type: 00000000 00101000(UUID=0x2800,首要服務)
2、Server(Master):Notification
00000010 00000010 00000000 00001111 00000000 00001011 00000000 00000100 00000000 00011011 00101010 00000000 00000100 00000110 01111000 00000010 11111000 11101100 01111101 01000000
Authentication Signature Flag:0(協議包末尾沒有認證簽名)
PDU Type is Command:0(不是一個命令包)
Opcode:011011(0x1b,Handle Value Notification)
Attribute Parameters:
Starting Attribute Handle:00000001 00000000(0x0001,起始句柄爲1)
Ending Attribute Handle: 11111111 11111111(0xffff,結束句柄爲65535)
Attribute Group Type: 00000000 00101000(UUID=0x2800,首要服務)
3、Server(Slave):Response
00000010 00000010 00100000 00010010 00000000 00001110 00000000 00000100 00000000 00010001 00000110 00000001 00000000 00001001 00000000 00000000 11111111 00001010 00000000 00010001 00000000 11100111 11111110
Authentication Signature Flag:0(協議包末尾沒有認證簽名)
PDU Type is Command:0(不是一個命令包)
Opcode:010001(0x11,Read by Group Type Response)
Length:00000110(0x06,每個attribute的長度爲6)
Attribute Data List:
Attribute 1:
Starting Attribute Handle:00000001 00000000(0x0001,起始句柄爲1)
Ending Attribute Handle: 00001001 00000000(0x0009,結束句柄爲9)
Attribute Group Type: 00000000 11111111(UUID=0xff00,IVT數據傳輸服務UUID)
Attribute 2:
Starting Attribute Handle:00001010 00000000(0x000a,起始句柄爲10)
Ending Attribute Handle: 00010001 00000000(0x0011,結束句柄爲17)
Attribute Group Type: 11100111 11111110(UUID=0xfee7,Tencent Holdings Limited)
4、Client(Master):Request
00000010 00000010 00000000 00001011 00000000 00000111 00000000 00000100 00000000 00010000 00010010 00000000 11111111 11111111 00000000 00101000
Authentication Signature Flag:0(協議包末尾沒有認證簽名)
PDU Type is Command:0(不是一個命令包)
Opcode:010000(0x10,Read by Group Type Request)
Attribute Parameters:
Starting Attribute Handle:00010010 00000000(0x0012,起始句柄爲18)
Ending Attribute Handle: 11111111 11111111(0xffff,結束句柄爲65535)
Attribute Group Type: 00000000 00101000(UUID=0x2800,首要服務)