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 Children
  • 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

  • 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

Related