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

how to reduce ble_nus_string_send cost?

today simple test ble_nus_string_send time-consuming function, but found that the implementation of a ble_nus_string_send and wait for the success of transmission time-consuming about 11~13ms is a normal value? (ATT_MTU = 247, LL payload size = 31,event length =6) The time I got by calculating tick2 - tick1.

If I want to send 6 LL packets in a connection event, what should I call? Sd_ble_gatts_hvx call seems to be just a connection event sent a LL packet? I am a bit confused

APP_TIMER_DEF(test_timer);

ble_nus_on_ble_evt()
{
    .
    .
    case BLE_GATTS_EVT_HVN_TX_COMPLETE:
        tx_completeflg = 1;
    break;
    .
    .
}


main()
{
    uint32_t tick1,tick2;
    .
    .
    app_timer_start(test_timer);
    tick1 = app_timer_cnt_get();

    ble_nus_string_send();
    while(tx_completeflg ==0)
    tick2 = app_timer_cnt_get();
    app_timer_stop(test_timer);
    .
    .
}
Parents Reply Children
Related