Closed hadiidbouk closed 6 years ago
I'm not sure if I understand the issue. You can get the UUID by calling getProximityUuid()
on the advertising packet, just as we did in the IBeaconTest
:
@Test
public void getProximityUuid() {
assertEquals(UUID.fromString("9114d61a-67d1-11e8-adc0-fa7ae01bbebc"), kontaktAdvertsingPacket.getProximityUuid());
assertEquals(UUID.fromString("03253fdd-55cb-44c2-a1eb-80c8355f8291"), blueupAdvertsingPacket.getProximityUuid());
}
Internally it uses the AdvertisingPacketUtil
to extract the UUID from the given byte array:
public static UUID toUuid(byte[] bytes) {
ByteBuffer bb = ByteBuffer.wrap(bytes);
return new UUID(bb.getLong(), bb.getLong());
}
Nevermind, it was a silly problem.
Hello,
In your IBeaconTest class, you added the blueup frame data, this frame data is smaller than the kontakt frame data :
My Question is, if i want to get the uuid bytes from this array, I will go and pick the bytes from index 9 to index 24+9 like you did in your code.
This logic will let me get a wrong uuid bytes, for blueup i am getting 13 bytes and for kontakt i am getting 16 bytes which is the correct number by the iBeacon advertising packet standards.
How i suppose to get the uuid from only this 13 bytes ?