Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Simultaneous BLE (custom SPP) and Br/Edr (regular SPP)

$
0
0

We are currently encountering some problems when simultaneously communicating with an iOS device (custom SPP over GATT) and an Android device (regular SPP).

This information might be helpful to answer our question: Both the Br/Edr device and the BLE device are bonded: For BLE we use IRK to resolve iOS's ever changing addresses, and LTK for encryption. The bonding processes work flawlessly for both standards. For Br/Edr the Android devices initiate the connection to our device.  As soon as the connection is established our device tries to assume the master role in the connection (this never failed so far in our tests, if it would we would disconnect the BrEdr device). To do that we use some code from the SPPLE example. For BLE connections we make the iPhone behave like a peripheral, so the iPhone advertises and our device initiates the connection assuming the master role by default. Secuity is successfully reestablished using the information stored in our bonding structure. The BLE connection parameters are set to use the minimum connection interval (I believe that this means a 7.5 ms interval), these parameters are acknowledged by the iOS device. Our SPPLE implementation uses notifications to get data from the iPhone to our device. Our device uses write without response to send data to the iPhone. The application protocol is designed for the limited data rates of BLE. We can see that we are using only about 10% of the connection events to transmit something when looking at the communication between host and CC2564B. Our goal is to support a combined total of up to 4 BR/EDR and BLE devices. So the distributions migt be (4/0, 3/1, 2/2, 1/3 and 0/4). 

Problem: Our problem is that if an android device is connected via (Br/Edr SPP) and an iPhone is connected via our custom SPP over BLE/GATT, the BLE side becomes unstable when we start generating traffic. Please don't misunderstand: There is also traffic right after the connection. Our device sends a message every second to each connected device. The connected devices do the same. This works with high stability. BLE alone without Br/Edr connections also works very well. The same holds for 4 simultaneous Br/Edr connections. It seems to be the combination of the two that messes things up.

So what does unstable mean? Well, on the iOS side we are still able to send notifications, so the iOS bluetooth stack still thinks it is connected. On our device's side we are still able to issue write without response calls to Bluetopia without error, so Bluetopia still thinks it is connected. However, neither the iPhone nor our device receives any of the data sent by the other side. The Android (Br/Edr) device still communicates without problems. After 10 s our application disconnects from the BLE device due to inactivity. If the iPhone is still in range and advertising, our device will try to re-initiate the connection. The connection attempt succeeds but when reestablishing security with the iPhone the process stalls and fails after 30 seconds with a "disconnected" error. Only a reboot of our device, which includes a reboot of the CC2564 is capable of fixing the issue. I am open to any suggestions about what might be causing the problem.

Our debugging attempts: We thought that such problems might be related to UART driver problems. We have our own UART driver implementation which we use to implement Bluetopia's HCITRANS.h interface. So we thought mabye we did something wrong there, and replaced our implementation with the one from the Bluetopia examples. This did not solve the issue. Unfortunately we have no HCI protocol analysis tools to dig any deeper.

My current theory: My current theory is that due to the minimum connection interval of 7.5 ms the CC2564B is not capable of maintaining that interval if a BR/EDR device is connected as well. Are there any known limitations that I have to account for when choosing the connection parameters for BLE especially when there are multiple simultaneous Br/Edr connections?


Viewing all articles
Browse latest Browse all 262198

Trending Articles