Can bt_nus_send be called multiple times within a single connection interval?

Hello,
If I set the connection interval to 300ms, can I call bt_nus_send multiple times (e.g., every 100ms) within that interval?
Additionally:
How can I check if the FIFO queue is empty (i.e., ready to accept new data without overflow)?
Context:
I'm developing a BLE device that needs to:
Maintain active scanning (cannot use very short connection intervals, e.g., <30ms).
Maximize data throughput using bt_nus_send over an existing connection.
Best regards,
Qianjun Wang
Parents
  • Hi,

    Yes, you can call bt_nus_send() repeatedly. If the buffer is full, you will get -ENOMEM returned and will have to try again laiter.

    There is n API to see the number of queued packets, but you can register the sent callback for the NUS service and count yourself if you need this information (incrase a variable wen you call bt_nus_send() successfully, and decrease it when you get the callback).

Reply
  • Hi,

    Yes, you can call bt_nus_send() repeatedly. If the buffer is full, you will get -ENOMEM returned and will have to try again laiter.

    There is n API to see the number of queued packets, but you can register the sent callback for the NUS service and count yourself if you need this information (incrase a variable wen you call bt_nus_send() successfully, and decrease it when you get the callback).

Children
No Data
Related