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

How to solve the stop scanning due to unknown reason?

Hi, everyone,

We are developing BLE project on nRF52832 chip by using SDK14.0 software.

The project is build from one master-device and many slave- devices.

The master device must establish connection to one of the slave-devices from time to time.

During connection establishing the function "sd_ble_gap_connect()" stops scanning until the finish of connection establishing and if due to anycase the device was disappeared from the air before executing this command the scanning stops and doesn't resume until the device returns to air or the command "sd_ble_gap_connect()" wasn't been canceled by command "sd_ble_gap_connect_cancel()". (The restart scanning by commands "sd_ble_gap_scan_stop()" and "sd_ble_gap_scan_start()" doesn't work.)

To prevent this problem we had to make additional protecting commands as checking device disapearance time and canceling connection by "sd_ble_gap_connect_cancel()" if it wasn't established after defined period of time.

This solved the problem, but during the long-time-test the scanning was stopped for 45 days. How you understand correctly to give this program to client is not possible. To determine the problem we weren't be able because the device wan't connected to computer via programmer. In SDK no function exists that whould be able to give acknoledge if scanning works or not. Also saving boolean variable manualy doesn't solve this problem. So we have no other choice than to check manualy to check last discover event time receiving. But it is only the half ot the solution although not very elegant. After detecting stop of the scanning we must resume this scanning anyway. If the scanning was stopped not due to connecting to unexisting device the cancelling of connection will not solve the problem. In this case we have to restart bluetooth program even by reinitilising it.

Due to this reason we loocked which functions make BLE initialisation and which of them have the oposite-functions that make BLE uninitialisation and couldn't find them.

How is it possible to make the full BLE softdevice program restart without restarting all application?

Thank you forward for paying attention.

Best regards

Boris Fridman

Parents Reply Children
No Data
Related