Skip to content

Commit

Permalink
Reverse UUID in iBeacon packet
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosun committed Jan 4, 2018
1 parent a49e981 commit 850b180
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,12 @@ bool LBLEAdvertisements::getIBeaconInfo(LBLEUuid& uuid, uint16_t& major, uint16_
if(0x15 != beaconLength)
break;

// note that iBeacon UUID are reversed w.r.t. our BT system
bt_uuid_t tmpUuid;
memcpy(tmpUuid.uuid, iBeaconBuffer, 16);
for(int i = 0; i < 16; ++i)
{
tmpUuid.uuid[i] = iBeaconBuffer[15-i];
}
uuid = tmpUuid;
iBeaconBuffer += 16;

Expand Down

0 comments on commit 850b180

Please sign in to comment.