My problem is the that on some devices the ScanResult.getDevice() or ScanResult.getScanResult() both return null on some devices but works fine on most.
This is probably more of an Android issue but thought I would see if anyone faced similar issues. When I look at the toString of results in my onScanResult of the callback I do see a small difference between devices that work and do not.
This is the result string with a failing device.
{device=F1:6B:2E:01:43:88, scanRecord=ScanRecord [mAdvertiseFlags=5, mServiceUuids=null, mServiceSolicitationUuids=[], mManufacturerSpecificData={}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=MYDEVICE], rssi=-38, timestampNanos=10844927511936, eventType=27, primaryPhy=1, secondaryPhy=0, advertisingSid=255, txPower=127, periodicAdvertisingInterval=0}
This is the result string with a working device.
{device=F1:6B:2E:01:43:88, scanRecord=ScanRecord [mAdvertiseFlags=5, mServiceUuids=null, mServiceSolicitationUuids=[], mManufacturerSpecificData={}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=MYDEVICE, mTDSData=null], rssi=-65, timestampNanos=131383632077590, eventType=27, primaryPhy=1, secondaryPhy=0, advertisingSid=255, txPower=127, periodicAdvertisingInterval=0}
The one difference I noticed was that the failing device does not include mTDSData=null
Details of my setup:
nrf51422 with s310 dual Ant BLE stack.
Compiling Android api 30 min api 23
Working device Moto G7 running Android 10 with Bluetooth 4.2
Failing device RCA 7" running Android 10 with Bluetooth 4.0