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

Discovery timeout in BLE Central Example Code

Hi, I have taken the BLE Central Example code (ble_app_uart_c)in one nRF51822 hardware and in the other nRF51822 hardware, I have taken the BLE Peripheral Example(ble_app_uart) code. I made changes in the central code such that whenever a button is pressed, BLE central would wake up and scan for peripheral.

All works fine for a while (meaning central connects to peripheral, discovers services, exchanges data). After some 10 times, Discovery timeout event happens at BLE Central example code. This is because, after starting a discovery in the central code, a disconnect event happens. This happens especially when the button is pressed in the central board very quickly (meaning, time between successive button presses is very short).

Is there a reason why this happens / has this been already identified? I used sdk10.0.0 and sdk12.3.0 and the above happens in both.

Parents
  • Hi Petter Myhre, thanks for the reply. I didnt know what caused the disconnected event - do you recommend any way to check that? Before the short press of the button the nrf51 runs in peripheral mode. After the short button press, the nRF51 reboots into central mode and scans and connects to peripheral if uuid matches. I run the example code of ble_central and ble_peripheral_uart. In the central code, I disabled all the places where start_scan is called, except for the first time. So, the central code basically scans only once upon boot up.

Reply
  • Hi Petter Myhre, thanks for the reply. I didnt know what caused the disconnected event - do you recommend any way to check that? Before the short press of the button the nrf51 runs in peripheral mode. After the short button press, the nRF51 reboots into central mode and scans and connects to peripheral if uuid matches. I run the example code of ble_central and ble_peripheral_uart. In the central code, I disabled all the places where start_scan is called, except for the first time. So, the central code basically scans only once upon boot up.

Children
No Data
Related