Android Bluetooth: Get UUIDs of discovered devices

后端 未结 6 1644
悲哀的现实
悲哀的现实 2020-12-01 08:15

As I\'m currently working on a little bluetooth library for Android, I\'m trying to get all the service uuids of the devices I discovered in my surrounding.

When my

6条回答
  •  我在风中等你
    2020-12-01 08:27

    The documentation on this states...

    Always contains the extra field BluetoothDevice.EXTRA_UUID

    However, just like you, I have found this not to be true.

    If you call fetchUuidsWithSdp() while device discovery is still taking place BluetoothDevice.EXTRA_UUID can be null.

    You should wait until you receive BluetoothAdapter.ACTION_DISCOVERY_FINISHED before you make any calls to fetchUuidsWithSdp().

提交回复
热议问题