Hello: Just a heads up. If you are trying to obtain better throughput using the nimble stack there is a configuration option you can modify to improve the throughput. Note that there is a ticket to address this issue as we can do this alot better in the controller (and we will): MYNEWT-382.
When the controller finishes sending a packet to a peer device it updates the number of completed packets for that connection. The controller needs to send a “number of completed packets” event to the host to inform the host that the data buffer has been freed so that the host can send more data if it chooses. The default timeout for this event is quite large (2 seconds). If you have a short connection interval and are sending many packets the connection throughput will suffer as the host will be blocked until it receives this event. Changing this timeout to the connection interval will give the fastest throughout possible (assuming you have one connection). Thus, if you have a connection interval of 20 msecs you would modify the macro so that the timeout is 20 msecs. To change this, modify the following code in nimble_opt.h. Note that the rate is defined in terms of os time ticks which is definitely confusing. I am not going to change that for now as once we address this ticket this macro will go away but be careful when modifying the code. The easiest way to do that is to determine your timeout in milliseconds and change 2000 to that number. For example, if you want a 20 msec timeout the macro would look like: NIMBLE_OPT_NUM_COMP_PKT_RATE ((20 * OS_TICKS_PER_SEC) / 1000) /* * Determines the maximum rate at which the controller will send the * number of completed packets event to the host. Rate is in os time ticks */ #ifndef NIMBLE_OPT_NUM_COMP_PKT_RATE #define NIMBLE_OPT_NUM_COMP_PKT_RATE ((2000 * OS_TICKS_PER_SEC) / 1000) #endif
