• 12
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Android BluetoothDevice type DUAL

When using ScanCallback for LE devices I get following condition as true:

bluetoothDevice.getType() == BluetoothDevice.DEVICE_TYPE_DUAL

Device supposedly should only support BLE, then how come I get type dual?

Does that mean, that I can use classic bluetooth connection logic on this device? (It fails if I try)

    • When I want to connect to a BLE, I check for both BluetoothDevice.DEVICE_TYPE_LE and BluetoothDevice.DEVICE_TYPE_DUAL

That is correct, a dual type device means that it supports classic Bluetooth (BR/EDR) as well as Low Energy (LE) Bluetooth. You can find more about this here.

Almost all Android devices (phones/tablets) would support dual type by default. This is because these devices (as well as desktops and laptops and other devices) have enough resources to support all the subsets of Bluetooth. Please note that a common pitfall is to assume that a device can be LE or classic, but not both. This is clarified in this answer:-

Can a Bluetooth LE powered device discover a classic Bluetooth device and vice-versa?

LE only devices tend to be sensors and battery-powered devices that are resource constrained and therefore cannot support classic Bluetooth.

As to why your phone is failing to connect over classic Bluetooth, this may be a separate issue. Please try using different apps or connecting from the Android settings. A good method would be to use two other classic devices to connect to each other (proving there is no issue with any of the devices), and if that succeeds, you can try and connect your phone to one of them.

Finally, please note that there is a difference between dual mode device and dual role device. A dual mode device is when both classic and LE are supported, whereas a dual role device is a feature of LE only and it means that a device can be a master/slave simultaneously.

I hope this helps.

  • 1
Reply Report
    • Thanks for clarification. It seems I don'e even have to use LE scan logic as my old startDiscovery() scan logic picks up LE devices just fine and only then I use different API to connect to them. Also I tread all devices with type 2 and 3 as LE now.