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

MIN MAX CONN_INTERVAL

I configured nrf51 with MIN MAX connection inverval this way

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

I have a characteristic which send indications, so to my understanding, this require at least two connections (indication send, and acknowledge). so at least it would take 200ms. when I receive 1200 indications on android, the timing seems logical (with wireshark, I can see from 8 to 10 connections per second. but when I receive 1200 indications from iphone, it took really less time (about 45 seconds) and wireshark shows about 30 connections per second with the nrf51 above configurations. what did I miss here????

Parents
  • MIN_CONN_INTERVAL and MAX_CONN_INTERVAL are only used when setting the Peripheral Preferred Connection Parameters in gap_params_init():

    gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
    gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
    gap_conn_params.slave_latency     = SLAVE_LATENCY;
    gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;
    
    err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
    APP_ERROR_CHECK(err_code);
    

    This is a characteristic that the central can use to set the connection parameters to what the peripheral desires, but it is up to the central.

    The initial connection parameters are set by the central on connection, then it can do a connection parameter update to change them.

    You can check the initial connection paramters when you get the BLE_GAP_EVT_CONNECTED event, and the updated connection parameters when you get the BLE_GAP_EVT_CONN_PARAM_UPDATE event. You can also see the actual connection interval in the sniffer trace.

Reply
  • MIN_CONN_INTERVAL and MAX_CONN_INTERVAL are only used when setting the Peripheral Preferred Connection Parameters in gap_params_init():

    gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
    gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
    gap_conn_params.slave_latency     = SLAVE_LATENCY;
    gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;
    
    err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
    APP_ERROR_CHECK(err_code);
    

    This is a characteristic that the central can use to set the connection parameters to what the peripheral desires, but it is up to the central.

    The initial connection parameters are set by the central on connection, then it can do a connection parameter update to change them.

    You can check the initial connection paramters when you get the BLE_GAP_EVT_CONNECTED event, and the updated connection parameters when you get the BLE_GAP_EVT_CONN_PARAM_UPDATE event. You can also see the actual connection interval in the sniffer trace.

Children
No Data
Related