Skip to content

Commit

Permalink
[Darwin] Change the check for the ble advertisement data size from >=…
Browse files Browse the repository at this point in the history
… 7 to == 8 (#20277)
  • Loading branch information
vivien-apple authored Jul 4, 2022
1 parent 74c51c1 commit fa2bf8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/Darwin/BleConnectionDelegateImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ - (void)centralManager:(CBCentralManager *)central
NSData * serviceData = [servicesData objectForKey:serviceUUID];

NSUInteger length = [serviceData length];
if (length >= 7) {
if (length == 8) {
const uint8_t * bytes = (const uint8_t *) [serviceData bytes];
uint8_t opCode = bytes[0];
uint16_t discriminator = (bytes[1] | (bytes[2] << 8)) & 0xfff;
Expand Down

0 comments on commit fa2bf8d

Please sign in to comment.