Now I receive a lot of transmitted BLE advertisement packet from BLE devices.
How can I know that is beacon or not?
I think I can check base on below information:
That mean I think I will check the BLE advertisement as below sample code:
do {
uint8_t entryLen = info->data[n];
uint8_t entryType = info->data[n + 1];
if (entryType == 0xff) {
int m = n + 2;
if (((uint8_t)info->data[m] == 0x4c) && ((uint8_t)info->data[m + 1] == 0x00) &&
((uint8_t)info->data[m + 2] == 0x02) && ((uint8_t)info->data[m + 3] == 0x15)) {
printf("---------------iBeacon-------------------------\n");
} else if (((uint8_t)info->data[m + 2] == 0xbe) && ((uint8_t)info->data[m + 3] == 0xac)) {
printf("---------------AltBeacon-------------------------\n");
}
} else if (entryType == 0x16) {
int m = n + 2;
if (((uint8_t)info->data[m] == 0xaa) && ((uint8_t)info->data[m + 1] == 0xfe)) {
printf("---------------Eddystone-------------------------\n");
m += 2;
switch ((uint8_t)info->data[m]) {
case 0x00:
printf("---------------EddystoneBeaconUIDdata-------------------------\n");
break;
case 0x20:
printf("---------------EddystoneBeaconTLM-------------------------\n");
break;
default:
printf("Eddystone Type %s\n", (uint8_t)info->data[m]);
break;
}
}
} else {
printf("---------------Other BLE Device-------------------------\n");
}
n += (entryLen + 1);
} while (n < info->length);
If the device is not iBeacon, AltBeacon or Eddystone that means it is other BLE device (not beacon).
It is ok?