nimble/ll: Update handling of HCI Number of Completed Packets event

The calculations for sending this HCI event periodically are a bit
mysterious at first glance - let's make them more obvious.

X-Original-Commit: 29d5d03fc888c414fb21ac22d6df4b970847f92f
This commit is contained in:
Andrzej Kaczmarek
2018-02-26 11:26:56 +01:00
parent c1272bd6dd
commit 1e7940c858
2 changed files with 4 additions and 5 deletions
+3 -4
View File
@@ -279,8 +279,8 @@ ble_ll_conn_num_comp_pkts_event_send(struct ble_ll_conn_sm *connsm)
* have completed but there are data packets in the controller buffers
* (i.e. enqueued in a connection state machine).
*/
if ((uint32_t)(g_ble_ll_last_num_comp_pkt_evt - os_time_get()) <
(MYNEWT_VAL(BLE_NUM_COMP_PKT_RATE) * OS_TICKS_PER_SEC)) {
if ((int32_t)(os_time_get() - g_ble_ll_last_num_comp_pkt_evt) <
MYNEWT_VAL(BLE_NUM_COMP_PKT_RATE)) {
/*
* If this connection has completed packets, send an event right away.
* We do this to increase throughput but we dont want to search the
@@ -354,8 +354,7 @@ skip_conn:
}
if (event_sent) {
g_ble_ll_last_num_comp_pkt_evt = os_time_get() +
(MYNEWT_VAL(BLE_NUM_COMP_PKT_RATE) * OS_TICKS_PER_SEC);
g_ble_ll_last_num_comp_pkt_evt = os_time_get();
}
}
+1 -1
View File
@@ -79,7 +79,7 @@ syscfg.defs:
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.
value: '((2000 * OS_TICKS_PER_SEC) / 1000)'
value: '(2 * OS_TICKS_PER_SEC)'
BLE_LL_MFRG_ID:
description: >