Francis Mariano
08/03/2022, 8:06 PMScanner { filters = listOf(Filter.Service(uuidFrom("00000123-0000-1000-8000-00805F9B34FB"))) }
return only Product A
but Scanner { filters = listOf(Filter.Service(uuidFrom("00000124-0000-1000-8000-00805F9B34FB"))) }
return Product A
and Product B
Why???? Why???? I don't know more what I can do.travis
08/03/2022, 8:33 PMStarting scan with X filter(s)
Where X
is likely 1
in your example (since you provided a single service filter).travis
08/03/2022, 8:35 PMParcelUuid
objects that get passed to Android, to make sure they’re as you’d expect.
Let me know if you’d like me to kick off a SNAPSHOT build for you.Francis Mariano
08/04/2022, 11:18 AMJust want to confirm that Kable is properly passing along the filter to Android, did you see a logcat message like?:Yes, I enabled the scan log and I see that message, kable is ok. I also added a log before
scanner.startScan(scanFilters, scanSettings, callback)
.
<http://logger.info|logger.info> { message = "scanFilters = $scanFilters" }
And I get correct info :
I/Kable/Scanner: scanFilters = [BluetoothLeScanFilter [mDeviceName=null, mDeviceAddress=null, mUuid=00000123-0000-1000-8000-00805f9b34fb, mUuidMask=null, mServiceSolicitationUuid=null, mServiceSolicitationUuidMask=null, mServiceDataUuid=null, mServiceData=null, mServiceDataMask=null, mManufacturerId=-1, mManufacturerData=null, mManufacturerDataMask=null]]
And
I/Kable/Scanner: scanFilters = [BluetoothLeScanFilter [mDeviceName=null, mDeviceAddress=null, mUuid=00000124-0000-1000-8000-00805f9b34fb, mUuidMask=null, mServiceSolicitationUuid=null, mServiceSolicitationUuidMask=null, mServiceDataUuid=null, mServiceData=null, mServiceDataMask=null, mManufacturerId=-1, mManufacturerData=null, mManufacturerDataMask=null]]
So Kable is correct.Francis Mariano
08/04/2022, 11:50 AMProduct A : 00000123-0000-1000-8000-00805F9B34FB and F0000124-0451-4000-B000-000000000000
Product B : 00000124-0000-1000-8000-00805F9B34FB and F0000124-0451-4000-B000-000000000000
The scan must filter using 16-bits uuid 0x0124. I can't explain about that. So, I change the product A :
Product A : 00000123-0000-1000-8000-00805F9B34FB and F0000123-0451-4000-B000-000000000000
And the scan worked as expected.travis
08/04/2022, 4:19 PM