android bluetooth discovery, device type

1.3k Views Asked by At

I have a bluetooth module that is LE and Classic that is set up to advertise and be discoverable at the same time. In my android app i start a discovery and add all but LE devices to a listView as i want to make a classic connection to the device. When i am discovering devices i find that it takes multiple scans to find my device, due to this i added some debug statements and found that my device shows up as 3 different device types, LE, Classic and dual.

Android dev site only says that a duel device is this;

"Bluetooth device type, Dual Mode - BR/EDR/LE

Constant Value: 3 (0x00000003)"

http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#DEVICE_TYPE_DUAL

i am using

    device.getType() != BluetoothDevice.DEVICE_TYPE_LE

to filter devices and this to find the device type

    DebugWrapper.infoMsg(device.getAddress(), "CYCLOPS C"); 
    DebugWrapper.infoMsg(""+device.getType(), "CYCLOPS TYPE");"

LogCat showing a single scan and the devices found

    08-12 10:32:08.226: D/BtClassicDeviceBase(18064): isConnected
    08-12 10:32:08.226: D/BluetoothAdapterWrapper(18064): startDiscovery
    08-12 10:32:08.236: D/BtClassicDeviceBase(18064): isConnected
    08-12 10:32:08.357: I/System.out(18064): rssi: -67
    08-12 10:32:08.597: I/System.out(18064): rssi: -76
    08-12 10:32:08.647: I/System.out(18064): rssi: -83
    08-12 10:32:08.697: I/BTC device(18064): 00:16:A4:09:3A:AF
    08-12 10:32:08.697: I/BTC TYPE(18064): 1
    08-12 10:32:08.697: I/System.out(18064): rssi: -46
    08-12 10:32:09.628: I/System.out(18064): rssi: -84
    08-12 10:32:09.768: I/System.out(18064): rssi: -78
    08-12 10:32:10.349: I/System.out(18064): rssi: -65
    08-12 10:32:11.059: I/BTC device(18064): 00:16:A4:09:3A:AF
    08-12 10:32:11.059: I/BTC TYPE(18064): 3
    08-12 10:32:11.059: I/System.out(18064): rssi: -47
    08-12 10:32:11.460: I/System.out(18064): rssi: -73
    08-12 10:32:12.871: I/System.out(18064): rssi: -100
    08-12 10:32:13.512: I/System.out(18064): rssi: -70
    08-12 10:32:14.142: I/System.out(18064): rssi: -89
    08-12 10:32:15.454: I/System.out(18064): rssi: -67
    08-12 10:32:15.594: I/System.out(18064): rssi: -72
    08-12 10:32:15.694: I/System.out(18064): rssi: -83
    08-12 10:32:17.095: I/System.out(18064): rssi: -73
    08-12 10:32:17.255: I/BTC device(18064): 00:16:A4:09:3A:AF
    08-12 10:32:17.255: I/BTC TYPE(18064): 3
    08-12 10:32:17.255: I/System.out(18064): rssi: -47
    08-12 10:32:20.148: I/System.out(18064): rssi: -91
    08-12 10:32:21.079: D/BtClassicDeviceBase(18064): isConnected

Does anyone know how android defines what type of device it has found and what determines a duel device?

0

There are 0 best solutions below