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

Why 250 ms interval between subsequent reads?

I observe strange behavior while reading value for long characteristics.

I have characteristic 100 bytes long (read only). In GATT client I must read value with subsequent reads (sd_ble_gattc_read with proper offsets). Everything works fine with one exception. Subsequent packets are received at intervals of 250 ms. Why? Where is this "magic interval" set? With my characteristic 100 byte long I need spend 1 second to get full value (and keep connection!).

Parents
  • I set on both side the same connection parameters (with sd_ble_gap_ppcp_set):

    min:30,  
    max:100,  
    latency:0,  
    timeout:400
    

    and set on both side the same behavior strategy to BLE_CONN_BW_HIGH (6 Tx/Rx buffers in Central and 7 Tx on Peripheral) by this snippet:

    //-----------------
    ...
        if(role == 2)
        	conn_bw.role = BLE_GAP_ROLE_CENTRAL;
        else
        	conn_bw.role = BLE_GAP_ROLE_PERIPH;
        conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_HIGH;
        conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_HIGH;
        ble_opt.common_opt.conn_bw = conn_bw;
        sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, &ble_opt)
    ...
    //-----------------
    

    I find only one place in SDK documentation where 250 ms interval is analysed. (SysTick driver settings, 24-bit counter on 64MHz clock overflows every ~250 ms).

Reply
  • I set on both side the same connection parameters (with sd_ble_gap_ppcp_set):

    min:30,  
    max:100,  
    latency:0,  
    timeout:400
    

    and set on both side the same behavior strategy to BLE_CONN_BW_HIGH (6 Tx/Rx buffers in Central and 7 Tx on Peripheral) by this snippet:

    //-----------------
    ...
        if(role == 2)
        	conn_bw.role = BLE_GAP_ROLE_CENTRAL;
        else
        	conn_bw.role = BLE_GAP_ROLE_PERIPH;
        conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_HIGH;
        conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_HIGH;
        ble_opt.common_opt.conn_bw = conn_bw;
        sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, &ble_opt)
    ...
    //-----------------
    

    I find only one place in SDK documentation where 250 ms interval is analysed. (SysTick driver settings, 24-bit counter on 64MHz clock overflows every ~250 ms).

Children
No Data
Related