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

BLE_ERROR_NO_TX_BUFFERS

Hi.

What is the best way to handle error 0x3004 on ble_nus_string_send(...)?

The issue is that i use scheduler

Parents
  • If you don't care wasting CPU time then simple while loop is fine:

    do{
      err_code = ble_nus_send_string(&m_nus, dbuf, fifo_len);
    }while(err_code == BLE_ERROR_NO_TX_BUFFERS);
    

    That will have maximum throughput. If you need to do something else while BLE stack is busy then leave function which calls ble_nus_send_string(), do other task then put in scheduler function with ble_nus_send_string() again to repeat sending old data.

Reply
  • If you don't care wasting CPU time then simple while loop is fine:

    do{
      err_code = ble_nus_send_string(&m_nus, dbuf, fifo_len);
    }while(err_code == BLE_ERROR_NO_TX_BUFFERS);
    

    That will have maximum throughput. If you need to do something else while BLE stack is busy then leave function which calls ble_nus_send_string(), do other task then put in scheduler function with ble_nus_send_string() again to repeat sending old data.

Children
Related