Update to iBeacon to use only MAC to recognise different beacons - this brings it into line with common use.

A further update would be nice to display major & minor in the web ui, not included here.
This commit is contained in:
Simon Hailes 2021-04-08 18:00:14 +01:00
parent 1a2addfc16
commit 970f4652f5
1 changed files with 3 additions and 3 deletions

View File

@ -337,7 +337,7 @@ uint32_t ibeacon_add(struct IBEACON *ib) {
if (!strncmp(ib->MAC,"FFFF",4) || strncmp(ib->FACID,"00000000",8)) {
for (uint32_t cnt=0;cnt<MAX_IBEACONS;cnt++) {
if (ibeacons[cnt].FLAGS) {
if (!strncmp_P(ib->UID,PSTR("00000000000000000000000000000000"),32)) {
// if (!strncmp_P(ib->UID,PSTR("00000000000000000000000000000000"),32)) {
if (!strncmp(ibeacons[cnt].MAC,ib->MAC,12)) {
// exists
strncpy(ibeacons[cnt].NAME,ib->NAME,sizeof(ibeacons[cnt].NAME));
@ -350,7 +350,7 @@ uint32_t ibeacon_add(struct IBEACON *ib) {
ibeacons[cnt].count++;
return 2;
}
} else {
/* } else {
if (!strncmp(ibeacons[cnt].UID,ib->UID,32)) {
// exists
strncpy(ibeacons[cnt].NAME,ib->NAME,sizeof(ibeacons[cnt].NAME));
@ -363,7 +363,7 @@ uint32_t ibeacon_add(struct IBEACON *ib) {
ibeacons[cnt].count++;
return 2;
}
}
}*/
}
}
for (uint32_t cnt=0;cnt<MAX_IBEACONS;cnt++) {