0

I want to scan for a specific bluetooth device with his 128bits service uuid.

It seems that there are some issues so I'm using this function to parse my uuid.

startLeScan with 128 bit UUIDs doesn't work on native Android BLE implementation

My uuid is : ffffffff-ffff-ffff-ffff-fffffffffff0 and the byte[] I declared is :byte[] adv = new byte[]{(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xf0};

However, the method startLeScan(uuid[],callback) takes an array instead of List used in the parse function.

So if I put startLeScan(parseUUID(adv),mScanCallBack)), I got en error.. since parseUUID function isn't UUID[] type.

Do you know how can I fix it ? Thank you in advance

Community
  • 1
  • 1
Bob
  • 111
  • 2
  • 9

1 Answers1

1

You should create an array from your list and then use that.

This may help:

Convert list to array in Java

Community
  • 1
  • 1
Tom
  • 7,474
  • 7
  • 40
  • 56
  • Now I have something like : (UUID[])parseUUIDs(adv).toArray() but still doesn't filter well. Is my byte[] array ok according to my uuid ? – Bob Feb 11 '15 at 15:00