andrzej-kaczmarek closed pull request #837: nimble/ll: Fix sending HCI Number 
of Completed Packets event
URL: https://github.com/apache/mynewt-core/pull/837
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/net/nimble/controller/src/ble_ll_conn_hci.c 
b/net/nimble/controller/src/ble_ll_conn_hci.c
index d8bf4e580..c6ea897ac 100644
--- a/net/nimble/controller/src/ble_ll_conn_hci.c
+++ b/net/nimble/controller/src/ble_ll_conn_hci.c
@@ -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 @@ ble_ll_conn_num_comp_pkts_event_send(struct ble_ll_conn_sm 
*connsm)
     }
 
     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();
     }
 }
 
diff --git a/net/nimble/controller/syscfg.yml b/net/nimble/controller/syscfg.yml
index 00cb1e8cc..8a89a12d3 100644
--- a/net/nimble/controller/syscfg.yml
+++ b/net/nimble/controller/syscfg.yml
@@ -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: >


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to