Skip to content

Commit e65d9f0

Browse files
AresMasterfpistm
andcommitted
fix(ATT): Find Information Response format
See Bluetooth Core Specification (v4.0 or v5.0), ATTRIBUTE PROTOCOL (ATT) part. Section 3.4.3.2 Find Information Response Table 3.8. uuidLen is 16 or 128-bit. Signed-off-by: Arkadiusz Ambroziak <[email protected]> Co-Authored-by: Frederic Pillon <[email protected]>
1 parent 11b4b48 commit e65d9f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utility/ATT.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1728,8 +1728,8 @@ bool ATTClass::discoverDescriptors(uint16_t connectionHandle, BLERemoteDevice* d
17281728
}
17291729

17301730
if (responseBuffer[0] == ATT_OP_FIND_INFO_RESP) {
1731-
uint16_t lengthPerDescriptor = responseBuffer[1] * 4;
1732-
uint8_t uuidLen = 2;
1731+
uint8_t uuidLen = responseBuffer[1] == 1 ? 2 : 16;
1732+
uint16_t lengthPerDescriptor = uuidLen + 2;
17331733

17341734
for (int i = 2; i < respLength; i += lengthPerDescriptor) {
17351735
struct __attribute__ ((packed)) RawDescriptor {

0 commit comments

Comments
 (0)