What Works: (prior to bonding scanForPeripherals reports 1x peripheral)
What doesn't: (once bonded, scanForPeripherals reports 10-30x peripherals instantly) this happens instantly - the moment 'pair' dialog is confirmed -> bunch of peripherals are discovered.
- Why is iOS/OSX reporting so many peripherals when it's actually one physical device?
- Since it does not happen with prior Android versions, problem might be with Android randomising mac.. any opinions?
- It's not an issue to reconnect to this one devices - BUT when I need to discover a new device - I can't possibly distinguish it from the other 30x already reported by 'scan'. Is there a way to resolve this ( connect to new device in reliable way )?
iOS/OSX Environment: iOS 12 / OSX 10.15).
Android Environment: (> SDK 26 => Android 8/9: testing on Samsung A20s)
NOTE: with Android phones running SDK <= 26 all works flawlessly ( only 1x devices discovered )
Setup:
iOS/OSX (CBCentralManager) scans for particular service UUID
Android (Peripheral) exposes GATT with 'encryption required characteristics'
Sample output: (didDiscover callback - list shows first 4 bytes of each peripheral.identifier for readability purposes )
2020-03-23 08:40:12.945 start scan B448A5C9-C9D3-E175-3B18-9186C14555FF
( CBCentralManagerScanOptionAllowDuplicatesKey: false )
08:40:13.626 discovered device: AE2E
08:40:13.626 discovered device: 28C1
08:40:13.627 discovered device: 6D36
08:40:13.629 discovered device: 2C14 [ ->> already bonded ]
08:40:13.627 discovered device: 3DF2
... ( listing keeps going - up to 30x peripherals within 25 ms ) ...