This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to get simultaneous data streaming between two devices using one BLE connection

GOAL: To send one 20-byte data packet from an Android Galaxy S5 to nrf51822 and send three 20-byte packets from the nrf51822 to the S5 in a single connection interval of 10 milliseconds or less. PROBLEM: I have not been able to get both devices to send data simultaneously. Instead, one device always waits to receive data from the other before it starts sending, so the complete transaction always takes at least two connection intervals, often three or four. ADDITIONAL INFO: I am using Android Studio for the Galaxy S5 and mbed for the nrf51822.

  • What ATT operation are you using? (I.E. read request/write request). In cases where high throughput and low latency is required, the Write Command and Notification ATT commands should be considered as they are asynchronous and does not require ATT layer acknowledgement, which allows for multiple data transfers to occur on each connection event.

  • Hey!

    @Shibshab is correct about the GATT operations. Use Notifications on the peripheral and write commands on the central.

    When using mBed, the S130 Softdevice is used. This softdevice support concurrent central/peripheral operation, but has a smaller output buffer for each link. This results in the maximum packet per connection interval being 2. If you want to get maximum troughput, you can use the ble_app_uart example from our SDK, and use Softdevice S110. This gives you 6 packets each connection interval.

    Alternatively, you can export your mBed project to Keil, and manually flash the S110 softdevice. This will require a bit of tweaking of various parameters both in code and compiler settings. Let me know if you go for this solution, and i will help you out.

    -Anders

  • Thanks, Anders! So I am trying to use the ble_app_uart example from your SDK using Softdevice S110, but I'm having some trouble getting started. I am using Keil, and I haven't been able to run any examples because I keep getting the error message "No JLink Devices found" followed by "Error: Flash Download failed - Target DLL has been cancelled." I went to Segger.com and downloaded JLink software but I still get this error. Do you know how to resolve this?

  • Are you using the nRF51 DK? Check the Keil settings under Target options -> Debug ->Settings. Also try searching devzone for the error. There are probably 100 posts about this.

    image description

Related