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

nrf52840 BLE peripheral connection for data transfer managing

Hello Nordic

 

I am using nrf52840, SDK 16.0,

I wish to implement Ble peripheral that advertise a connection request (if no response from central after x seconds then I go to sleep and try few minutes later). After connection has established I need to manage data transfer to the central gateway (also nrf52840)

  1. Is there an example that I can learn from as for how to manage a connection (only connection, not pairing etc.) ?
  2. Also since most examples are written in an event driven way which is great but really hard to flow the code since breakpoints tend to crash the app, is there some explanation somewhere or guide/tutorials for peripheral connection for data of various sizes ?
  3. Starting to play with the peripheral ble_app_blinky I saw that if I try to change the advertise timeout I stop seeing the advertise in the nrf connect cellphone application, why is that ?

 

#define APP_ADV_DURATION                30//BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED   /**< The advertising time-out (in units of seconds). When set to 0, we will never time out. */

hope to read from you soon

best regards

Ziv

  • Hi Ziv, 

    If you want to test with the ATT_MTU, I would suggest to start with the documentation. 

    But I would strongly suggest to start with the ble_app_uart. You need to study the code and get to understand how things work in the code before moving to more advanced application. 
    ble_app_blinky would also a good start. 

  • hi Hung

    If you want to test with the ATT_MTU, I would suggest to start with the documentation. 

    i have seen this link .. could not understand everything yet

    i understand it is a bit more easy to start with the Uart_ble example but i will eventually need to use the large throughput that is the ATT_MTU example and since i was not given so much time i must try to understand the ATT_MTU instead of writing the uart_ble and then change to the ATT_MTU

    i am trying to understand how to configure only peripheral for start. in the ATT_MTU example when pressing the button to get the "dummy"(responder) which to my understanding is the peripheral, there is a start advertising and start scan, if the central (tester) button is pressed there is a user choosing .. but the initiation of all the GAP GATT and so are done before all this decisions, i guess it is somehow fits to both roles,  but what configs and inits should be for peripheral configuration only and which for the central ? how can i organize that ?

    hope to read from you soon

    best regards

    Ziv

  • Hi Ziv, 

    I didn't suggest that you have to modify the ble_app_uart to make it high throughput. What I wanted to suggest is to start with simple example and get to understand how things work. 
    The ble_app_att_mtu is a bit more complex because the server is located on the central device. So the tester is both the central and the one who send data via notification. 

    The ATT table (both client and server) is setup automatically on both device, and when you press the button you only select the application activity, not the GATT attribute table. 

    If you need peripheral + server, this example could be a better option: https://github.com/NordicPlayground/nrf52-ble-image-transfer-demo

    It also comes with an Android/iOS app to test, but you need to have an Adruino camera module, or you need to modify the application to send dummy data instead. 

Related