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

How to know the actual connection parameters

Hello,

I am working with the nRF51822 and S110 Softdevice. I have so far successfully created several examples of fairly complex Peripherals. Now I am trying to,

A) Set up the preferred communication parameters before actually starting the advertising.

B) Re-negotiating with the Central just at the beginning of a newly established connection (in fact, I am doing it from the onConnection callback function).

My questions,

  1. So far, I have been unable to affect the connection params by issuing a setPreferedConnectionParams() before starting the advertising process. I get the same conn params when I use the above function and when not. I have tried connecting from different Central devices (iPhone 5, Android tablet, OS X Bluetooth Explorer), but I don't get different results. What's your experience on the topic? Do you know if Central devices honor the preferred conn params broadcasted during the advertising process?

  2. How can I know the newly (if any) applied communication parameters after the re-negotiation with the Central (procedure B)? Is there any API function which I can call to retrieve the actual communication parameters, at any time, during a connection? Immediately after the connection has been established, I get the actual conn params from the onConnection callback function, but I cannot find how to do it outside the callback, at a later time of the same connection.

Thanks for your support!

Best regards, José Ángel Jiménez

Parents
  • Hi José

    I do not think the centrals honor the preferred connection parameter information of the peripheral. You will have to send a connection parameter update request to the central when connection has been established. See more about how that works on this thread.

    To see what connection parameters are actually used, look at this thread.

    Update 23.2.2015 You can see how to receive connection parameter updates from the cenral device in e.g. the heart rate example in the nRF51 SDK. in the main.c file you will find ble_evt_dispatch functions which is called on BLE softdevice events. The ble_conn_params_on_ble_evt function is called in turn to handle the connection parameter update request from the central.

  • Thanks a lot for your nice response. Now I have a good understanding on how the connection parameter update request negotiation works.

    I am now having some issues trying to register/intercept BLE_GAP_EVT_CONN_PARAM_UPDATE, in order to LOG the connection parameters received at each stage of the negociation.

    Is there a simple way to attach/register a callback function to this event? I would like to register one of my app's functions so that it is called whenever the event occurs.

    Thank you!

Reply
  • Thanks a lot for your nice response. Now I have a good understanding on how the connection parameter update request negotiation works.

    I am now having some issues trying to register/intercept BLE_GAP_EVT_CONN_PARAM_UPDATE, in order to LOG the connection parameters received at each stage of the negociation.

    Is there a simple way to attach/register a callback function to this event? I would like to register one of my app's functions so that it is called whenever the event occurs.

    Thank you!

Children
No Data
Related