You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by "sjanc (via GitHub)" <gi...@apache.org> on 2023/04/04 13:02:00 UTC

[GitHub] [mynewt-nimble] sjanc opened a new pull request, #1482: nimble/ll: Account for host provided Max_CE_length

sjanc opened a new pull request, #1482:
URL: https://github.com/apache/mynewt-nimble/pull/1482

   If host provides maximum CE length (when initiating connection or updating its parameters) LL will take it into account when checking if more packages can be send in current event.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-nimble] sjanc merged pull request #1482: nimble/ll: Account for host provided Max_CE_length

Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc merged PR #1482:
URL: https://github.com/apache/mynewt-nimble/pull/1482


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-nimble] andrzej-kaczmarek commented on a diff in pull request #1482: nimble/ll: Account for host provided Max_CE_length

Posted by "andrzej-kaczmarek (via GitHub)" <gi...@apache.org>.
andrzej-kaczmarek commented on code in PR #1482:
URL: https://github.com/apache/mynewt-nimble/pull/1482#discussion_r1159543135


##########
nimble/controller/include/controller/ble_ll_conn.h:
##########
@@ -293,6 +293,7 @@ struct ble_ll_conn_sm
     uint16_t supervision_tmo;
     uint16_t min_ce_len;
     uint16_t max_ce_len;

Review Comment:
   remove this? does not seem to be used anywhere



##########
nimble/controller/src/ble_ll_conn_hci.c:
##########
@@ -480,14 +480,22 @@ ble_ll_conn_hci_create_check_params(struct ble_ll_conn_create_params *cc_params)
         return BLE_ERR_INV_HCI_CMD_PARMS;
     }
 
-    /* Adjust min/max ce length to be less than interval */
-    if (cc_params->min_ce_len > cc_params->conn_itvl) {
-        cc_params->min_ce_len = cc_params->conn_itvl;
+    /* Adjust min/max ce length to be less than interval, note that CE is in
+     * 0.625ms and interval in 1.25ms units
+     */
+    if (cc_params->min_ce_len > (cc_params->conn_itvl / 2)) {
+        cc_params->min_ce_len = cc_params->conn_itvl / 2;
     }
-    if (cc_params->max_ce_len > cc_params->conn_itvl) {
-        cc_params->max_ce_len = cc_params->conn_itvl;
+
+    if (cc_params->max_ce_len > (cc_params->conn_itvl / 2)) {
+        cc_params->max_ce_len = cc_params->conn_itvl / 2;
     }
 
+    /* Precalculate max CE length, we don't have to be very accurate so just add
+     * extra tick to round up
+     */
+    cc_params->max_ce_len_ticks = ble_ll_tmr_u2t(cc_params->max_ce_len * BLE_LL_CONN_CE_USECS) + 1;

Review Comment:
   `ble_ll_tmr_u2t_up`



##########
nimble/controller/src/ble_ll_conn.c:
##########
@@ -1654,7 +1674,8 @@ ble_ll_conn_can_send_next_pdu(struct ble_ll_conn_sm *connsm, uint32_t begtime,
 #endif
 
     rc = 1;
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL &&
+        ble_ll_conn_max_ce_end_time(connsm)) {

Review Comment:
   ce end time is calculated in `ble_ll_conn_get_next_sched_time` so max ce end time can be simply applied there



##########
nimble/controller/src/ble_ll_conn.c:
##########
@@ -2576,6 +2598,12 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
         ble_ll_conn_itvl_to_ticks(connsm->conn_itvl, &connsm->conn_itvl_ticks,
                                   &connsm->conn_itvl_usecs);
 
+        if (connsm->conn_param_req.handle != 0) {

Review Comment:
   handle does not seem to be reset anywhere so better reset it after procedure is completed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org