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

How do I wait until a response come after data sent through UART module of nRF51822?

On a BLE_GAP_EVT_CONNECTED, I'll send some data to an attached microcontroller via UART. The code will expect a response of that data, all while being inside that BLE_GAP_EVT_CONNECTED switch block. Can anybody please share a code snippet to do that? Your help is greatly appreciated. Thanks in advance.

Parents
  • The reason I am trying to this is because, after a connection is made to the nRF51822(which will be a GAP Peripheral/GATT Server) by a mobile app(GAP Central/GATT Client), I want to check the ID of that central/client as soon as possible(with the help of the microcontroller), and disconnect if the ID is not matched to our pre-specified database. So, I want the process to be blocking intentionally. I know, there's whitelisting, but for multiple reasons, I have to avoid it.

Reply
  • The reason I am trying to this is because, after a connection is made to the nRF51822(which will be a GAP Peripheral/GATT Server) by a mobile app(GAP Central/GATT Client), I want to check the ID of that central/client as soon as possible(with the help of the microcontroller), and disconnect if the ID is not matched to our pre-specified database. So, I want the process to be blocking intentionally. I know, there's whitelisting, but for multiple reasons, I have to avoid it.

Children
No Data
Related