android - BLE Device Name irretrievable -
i have project scanning beacons run on ble.
i can scan beacon , list them in nice custom listview
fine. retrieving names seems not work.
in onlescan
callback use device.getname()
appears returning null?
furthermore, when attempt parse scanrecord byte[] array data in concordance this post - still not having luck. ideas/tips?
should retrieving local name bluetoothdevice
class? should retrieve parsing scanrecord/scanresult
class?
here onlescan looks like:
public void onlescan(final bluetoothdevice device, int rssi, final byte[] scanrecord) { runonuithread(new runnable() { @override public void run() { log.v(device.getname(),device.getname()); mledevicelistadapter.adddevice(device); mledevicelistadapter.notifydatasetchanged(); } } }); }
edit:
i attempted modification of code linked post. adding case 0x08: suggested in comments. listview still lists found devices "unknown device" default , not retrieve friendly name.
see this answer breakdown of ibeacon advertisement packet. there no name.
the official spec available via apple's mfi program.
Comments
Post a Comment