You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/12/03 18:35:14 UTC

[GitHub] wes3 closed pull request #255: net/nimble/controller: Slave connection update fix

wes3 closed pull request #255: net/nimble/controller: Slave connection update fix
URL: https://github.com/apache/mynewt-nimble/pull/255
 
 
   

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/nimble/controller/src/ble_ll_ctrl.c b/nimble/controller/src/ble_ll_ctrl.c
index 108fb158..44363c0d 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -1571,10 +1571,10 @@ ble_ll_ctrl_rx_reject_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         break;
 #endif
     case BLE_LL_CTRL_PROC_DATA_LEN_UPD:
-	/* That should not happen according to Bluetooth 5.0 Vol6 Part B, 5.1.9
-	 * However we need this workaround as there are devices on the market
-	 * which do send LL_REJECT on LL_LENGTH_REQ when collision happens
-	 */
+        /* That should not happen according to Bluetooth 5.0 Vol6 Part B, 5.1.9
+         * However we need this workaround as there are devices on the market
+         * which do send LL_REJECT on LL_LENGTH_REQ when collision happens
+         */
         ble_ll_ctrl_proc_stop(connsm, BLE_LL_CTRL_PROC_DATA_LEN_UPD);
         break;
     default:
@@ -1623,6 +1623,21 @@ ble_ll_ctrl_rx_conn_update(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
         ble_ll_conn_timeout(connsm, BLE_ERR_INSTANT_PASSED);
     } else {
         connsm->csmflags.cfbit.conn_update_sched = 1;
+
+        /*
+         * Errata says that receiving a connection update when the event
+         * counter is equal to the instant means wesimply ignore the window
+         * offset and window size. Anchor point has already been set based on
+         * first packet received in connection event. Given that we increment
+         * the event counter BEFORE checking to see if the instant is equal to
+         * the event counter what we do here is increment the instant and set
+         * the window offset and size to 0.
+         */
+        if (conn_events == 0) {
+            reqdata->winoffset = 0;
+            reqdata->winsize = 0;
+            reqdata->instant += 1;
+        }
     }
 
     return rsp_opcode;


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services