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

Communicate in BLE with NRF52 using Android

Hi everyone,

I'm a beginner in Android development and BLE environment, and I want to communicate with the nRF52 card using an Android app. In fact I have to develop an access control, using the nRF52 board and an Android App.

For now I'm able to scan BLE device and pair the card with my app. Now I want to write on the card (maybe through a BLE characteristic), then compare this value and turn on a LED if this value is correct. My problem is that I don't know how to write on the card and where I would be able to retrieve the value written (on the card) to compute my comparaison. Thus I would like to know where a value written on a BLE characteristic would be stored ?

Thanks, Vivien

Parents
  • Hi Vivien,

    Please have a look at our example apps, such as the nRF UART app or the nRF Toolbox app. You can find how to do a write on a characteristic. The value of a BLE characteristic is stored in the Attribute table on RAM (could be in the Stack's RAM area or in the application's RAM area)

  • Hi Hung, Thanks again four your help and your time. For the moment, I'm able to write on a characteristic of the card using an external Android app called : BLE Scanner. I'm writting on the characteristic : "Device Name" under the service "Generic Access Service". Now I would like to compare this value with another value and then turn on a LED on the board. The point is I don't know how to call the function "sd_ble_gatts_value_get()" in the main file (especially the attribute tu use : conn_handle & handle). Do you have an example of this function ?

    Thanks again for your time.

Reply
  • Hi Hung, Thanks again four your help and your time. For the moment, I'm able to write on a characteristic of the card using an external Android app called : BLE Scanner. I'm writting on the characteristic : "Device Name" under the service "Generic Access Service". Now I would like to compare this value with another value and then turn on a LED on the board. The point is I don't know how to call the function "sd_ble_gatts_value_get()" in the main file (especially the attribute tu use : conn_handle & handle). Do you have an example of this function ?

    Thanks again for your time.

Children
No Data