Connection parameters in nrf ble

want to know how can i judge that the variation is caused in the connection interval, connection supervision timeout, slave latency once i have flashed ble_app_template code in nrf52832 s132.

Parents Reply
  • Hello agian, RIDHIMA

    Connection interval is the agreed upon period between connection events. Connection events is the event in which the devices communicate, and their radios are active. The connection interval will be agreed upon at the start of the connection, so you should be able to see it in the nRF Connect app's logs right after a connection is established.

    Best regards,
    Karl

Children
  • i want to know what is the connection interval set?

  • The central decides the connection interval (and all the other connection parameters), but the peripheral might request certain changes, or reject the connection parameters the central decides (rejecting the parameters means that the peripheral will terminate the connection).

    You can set the connection interval by changing the NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL and NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL in sdk_config.
    You may set them to the same value, to force a specific connection interval.

    Best regards,
    Karl

  • this NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL  you have told for central code??

    if want want to set the Connection Interval as 100ms in peripheral,  how will i set it? i know that this

     #define MIN_CONN_INTERVAL               MSEC_TO_UNITS(20, UNIT_1_25_MS) and 

    #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(75, UNIT_1_25_MS)       commands are used but how to set value of Connection Interval as 100ms using these?? 

  • Ridhi said:
    this NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL  you have told for central code??

    Yes, these defines are used on the central side.
    The equivalent defines for the peripheral side are the ones you mention, MIN_CONN_INTERVAL and MAX_CONN_INTERVAL.
    If you want to set exactly 100 ms as the interval you must set both of these to 100 ms, like so:

    #define MIN_CONN_INTERVAL               MSEC_TO_UNITS(100, UNIT_1_25_MS)
    
    #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(100, UNIT_1_25_MS)


    But keep in mind that the central has the final word, and may not always listen to the requests of the peripheral.

    Best regards,
    Karl

  • KARL, pls administer my queries

    1). if i want to set Connection interval as 1000ms say then, is this i will have to do:

    #define MIN_CONN_INTERVAL MSEC_TO_UNITS(1000, UNIT_1_25_MS)

    #define MAX_CONN_INTERVAL MSEC_TO_UNITS(1000, UNIT_1_25_MS) ?

    2). I have nrf connect app for android, ran nordic blinky code of nrf sdk v17.2 on nrf52832 dk. i checked this on power profiler kit 11. that as i clik on connect option in nrf app power profiler gives abou 50 ms delay between connection events and then later after 20ms then first connection parameters get changed and then it shows about 200ms CI. is this right i am understanding that master has intially set the CI as 50ms and then based on peripheral this interval was updated

Related