Please find the below different cases we experimented and the issue we are facing :
case 1) BT Classic application and connecting using Android shutter Bluetooth symbol
When there is only a BT classic application running on the board, and an Android device is used to connect to the board. The shutter on Android device is swiped to touch upon the 'bluetooth symbol' to turn on the bluetooth, and then the device is selected, which upon touching, pops up a window for pairing, and subsequently upon entering the pass code the Android device connects to the board successfully. Absolutely no issue in this case.
case 2) BT Classic application and BLE application on target board and connecting using BLE scanner app on Android device
When there is BT Classic app and BLE app, two different applications running simultaneously on the board, and BLE scanner app on Android device is used to connect to the board. But this time, we used an Android application called "BLE scanner" to get connected to the board, and the connection was smooth and successful without any prompt for pass code [as we know, BLE does need pass code to get connected to any device]. Absolutely no issue in this case as well.
case 3) BT Classic application and BLE application on target board and connecting to board using Android shutter bluetooth symbol intending to connect to BT Classic only.
Now, When we run BT Classic app and BLE app, two different applications both simultaneously on our custom board, and an Android device is used to connect to the board. The same way as in case (1) we tried to connect to the board using 'bluetooth symbol' on shutter, intending to connect to BT app only on target board, but this time around the pop up on the Android device doesn't ask for pass code, it simply gives two options either to "PAIR" or "CANCEL" , upon selecting "PAIR' option the device gets connected successfully, and from the log on the target custom board, we found that, it is getting connected to the BLE application, but not to the BT application. Typically, when we connect to the BT Classic, the android device should produce a pop up for pass code, but it is not happening so.
We are curious to know, why is the device getting connected to the BLE but not to the BT Classic even when we select the 'bluetooth symbol' on the Android shutter, and to be noted that, we are not running the BLE android application [BLE scanner] on the Android device.
Even in the case when we have BLE enabled on the target board, the user should be prompted for pass code on the Android device when user tries to connect.
Kindly shed some light on this issue i.e., How BT classic can still send pass code to the client Android device even when there is BLE enabled on the target board.
Hi @shivashankar ,
Can you please clarify the following?
1. What do you mean by two apps running simultaneously? Are you meaning that both the BLE and BR/EDR functionalities of the chip are used at the same time?
2. If both the BLE and BR/EDR functionalities are running together, is the device advertising as well as in inquiry scan mode? If yes, in your host side, do they have the same local name or different local names. Since they have the same BD address, we need to somehow differentiate between the two packets received in the Central side (Android device)
I tried to create a sample project using BTSDK Host to scan for inquiry packets and advertise at the same time. I used a bluetooth enabled Windows PC to scan for these packets and obtained the below results:
bredr_inq is for BR/EDR inquiry response packets and BLE_ADV is the BLE adv packets. You need to connect to the device using the BR/EDR response packet to make a BREDR connection.
Can you please check if you are connecting using the right BREDR packet name if something similar exists in your environment?
Also ensure to clear your android device's bonded list so that it doesn't skip the pairing procedure the next time.
Thanks for the response. Please find below clarifications corresponding to your points.
1) Yes, we are running two different applications to have both the features running on the target.
2) The below commands are used to enable page/inquiry mode, this would enable
BR/EDR inquiry scan mode :
#hciattach /dev/ttymxc1 bcm43xx 3000000 flow -t 20
#hciconfig hci0 up
#start-stop-daemon --start --background --exec /usr/lib/bluez5/bluetooth/bluetoothd -- "--compat"
#bdaddr -i hci0 $mac_addr
#hciconfig hci0 name $BT_NAME
#hciconfig hci0 down
#hciconfig hci0 up
#hciconfig hci0 piscan
#btmgmt -i hci0 ssp off
#start-stop-daemon --start --background --exec /usr/lib/bluez/test/simple-agent
And again, in the BLE application we do have advertise function.
We assigned unique name to each of them namely :
"ALLDATA-OBD" for BR/EDR
"AllData-OBD-BLE" for BLE
Here, I could see only the BR/EDR device name and BLE name is not at all shown when we scanned for Bluetooth devices.
I did try to detect from Windows machine, but I could see only the BR/EDR device name.
Basically, I could see only BR/EDR device name when I detect the device either from Android device or Windows.
Rarely, the BLE device name was seen after establishing BLE connection, it would just come and disappear.
Shiva Shankar K.
Hi @shivashankar ,
We would like to understand how you are running two different applications in the host side? Is it some kind of a RTOS environment you are running two applications on?
Would you be able to show us the HCI logs so that we can determine if both the advertisement and inquiry scan are happening at the same time. Also logs showing the connection request received from the host.
Hi @shivashankar ,
Thank you for sharing the logs. We have the following queries after looking at the logs:
1. The problem statement says that when you are trying to establish a BR/EDR connection, an LE connection is established but BR/EDR connection did not happen. Can you please confirm if this corresponds to line 60 to 70 (LE connection complete event)? We see that an LE connection complete event is received in the host confirming a LE connection event.
We would like to see the peer logs (android device) to see if the peer device sent a LE connection request or BR/EDR Connection request. Please share the logs of the peer device to get more understanding of the issue.
After this we see that both these devices are getting connected through Just Works method of LE as expected, since you have mentioned IO capabilities as none. However, we also see > "HCI Event: Connect Request (0x04) plen 10 [hci0] 62.302355" in line 569 which is a BR/EDR connection request. Subsequently, Accept Connection Request is sent to the peer device. However you had mentioned that BR/EDR connection is not happening. Can you please confirm this?
2. Can you please let us know if you have tested this from a different version of android device and IOS. We would like to see if this issue is device specific. Also share the logs of each of the different os versions.
3. You have already confirmed that you have used two different names for the BLE and BR/EDR. Can you please confirm if you are trying to connect to the BR/EDR name, ie ALLDATA-OBD, but it is still connecting to BLE.
4. It is to be noted that the pairing procedure will occur only once, therefore it is required that you should run only case 3 alone and case 1 should not be run before executing case 3. Otherwise, the bonding keys will be stored in the android device and the pairing procedure will be skipped.
Hi @shivashankar ,
We are locking this thread due to inactivity for more than 3 weeks. Please create a new thread and mention this thread in case if you have any follow up questions.