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 2022/09/06 10:51:22 UTC

[GitHub] [mynewt-nimble] andrzej-kaczmarek opened a new pull request, #1349: nimble/ll: Add support for custom scheduling items

andrzej-kaczmarek opened a new pull request, #1349:
URL: https://github.com/apache/mynewt-nimble/pull/1349

   This adds support for scheduling custom items in NimBLE scheduler.
   
   Custom items shall use BLE_LL_SCHED_EXTERNAL type and set LL state to
   BLE_LL_STATE_EXTERNAL when executing. When in that state, LL will call
   appropriate callbacks as for any other built-in state which shall be
   implemented by application. If different types of custom items are used,
   they can be differentiated by sched_ext_type field which can have an
   arbitrary value set by application.
   
   Note that this featuer is marked as experimental as API is subject to
   change.


-- 
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] apache-mynewt-bot commented on pull request #1349: nimble/ll: Add support for custom scheduling items

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on PR #1349:
URL: https://github.com/apache/mynewt-nimble/pull/1349#issuecomment-1238022494

   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### nimble/controller/include/controller/ble_ll_sched.h
   <details>
   
   ```diff
   @@ -95,20 +95,19 @@
     *  txrx_offset: Number of ticks from start time until tx/rx should occur.
     *
     */
   -struct ble_ll_sched_item
   -{
   +struct ble_ll_sched_item {
    #if MYNEWT_VAL(BLE_LL_EXT_SCHED)
   -    uint8_t         sched_type : 4;
   -    uint8_t         sched_ext_type : 4;
   +    uint8_t sched_type : 4;
   +    uint8_t sched_ext_type : 4;
    #else
   -    uint8_t         sched_type;
   -#endif
   -    uint8_t         enqueued;
   -    uint8_t         remainder;
   -    uint32_t        start_time;
   -    uint32_t        end_time;
   -    void            *cb_arg;
   -    sched_cb_func   sched_cb;
   +    uint8_t sched_type;
   +#endif
   +    uint8_t enqueued;
   +    uint8_t remainder;
   +    uint32_t start_time;
   +    uint32_t end_time;
   +    void *cb_arg;
   +    sched_cb_func sched_cb;
        TAILQ_ENTRY(ble_ll_sched_item) link;
    };
    
   ```
   
   </details>
   
   #### nimble/controller/src/ble_ll_sched.c
   <details>
   
   ```diff
   @@ -143,41 +143,41 @@
    
            switch (entry->sched_type) {
    #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL) || MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
   -            case BLE_LL_SCHED_TYPE_CONN:
   -                connsm = (struct ble_ll_conn_sm *)entry->cb_arg;
   -                ble_ll_event_add(&connsm->conn_ev_end);
   -                break;
   +        case BLE_LL_SCHED_TYPE_CONN:
   +            connsm = (struct ble_ll_conn_sm *)entry->cb_arg;
   +            ble_ll_event_add(&connsm->conn_ev_end);
   +            break;
    #endif
    #if MYNEWT_VAL(BLE_LL_ROLE_BROADCASTER)
   -            case BLE_LL_SCHED_TYPE_ADV:
   -                ble_ll_adv_event_rmvd_from_sched(entry->cb_arg);
   -                break;
   +        case BLE_LL_SCHED_TYPE_ADV:
   +            ble_ll_adv_event_rmvd_from_sched(entry->cb_arg);
   +            break;
    #endif
    #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) && MYNEWT_VAL(BLE_LL_ROLE_OBSERVER)
   -            case BLE_LL_SCHED_TYPE_SCAN_AUX:
   -                ble_ll_scan_aux_break(entry->cb_arg);
   -                break;
   +        case BLE_LL_SCHED_TYPE_SCAN_AUX:
   +            ble_ll_scan_aux_break(entry->cb_arg);
   +            break;
    #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PERIODIC_ADV)
    #if MYNEWT_VAL(BLE_LL_ROLE_BROADCASTER)
   -            case BLE_LL_SCHED_TYPE_PERIODIC:
   -                ble_ll_adv_periodic_rmvd_from_sched(entry->cb_arg);
   -                break;
   +        case BLE_LL_SCHED_TYPE_PERIODIC:
   +            ble_ll_adv_periodic_rmvd_from_sched(entry->cb_arg);
   +            break;
    #endif
    #if MYNEWT_VAL(BLE_LL_ROLE_OBSERVER)
   -            case BLE_LL_SCHED_TYPE_SYNC:
   -                ble_ll_sync_rmvd_from_sched(entry->cb_arg);
   -                break;
   +        case BLE_LL_SCHED_TYPE_SYNC:
   +            ble_ll_sync_rmvd_from_sched(entry->cb_arg);
   +            break;
    #endif
    #endif
    #endif
    #if MYNEWT_VAL(BLE_LL_EXT_SCHED)
   -            case BLE_LL_SCHED_TYPE_EXTERNAL:
   -                ble_ll_ext_sched_removed(entry);
   -                break;
   -#endif
   -            default:
   -                BLE_LL_ASSERT(0);
   -                break;
   +        case BLE_LL_SCHED_TYPE_EXTERNAL:
   +            ble_ll_ext_sched_removed(entry);
   +            break;
   +#endif
   +        default:
   +            BLE_LL_ASSERT(0);
   +            break;
            }
    
            entry = next;
   ```
   
   </details>


-- 
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 commented on a diff in pull request #1349: nimble/ll: Add support for custom scheduling items

Posted by GitBox <gi...@apache.org>.
sjanc commented on code in PR #1349:
URL: https://github.com/apache/mynewt-nimble/pull/1349#discussion_r968046512


##########
nimble/controller/include/controller/ble_ll_sched.h:
##########
@@ -90,7 +97,12 @@ typedef void (*sched_remove_cb_func)(struct ble_ll_sched_item *sch);
  */
 struct ble_ll_sched_item
 {
+#if MYNEWT_VAL(BLE_LL_EXT_SCHED)
+    uint8_t         sched_type : 4;
+    uint8_t         sched_ext_type : 4;

Review Comment:
   I'd just add ext_type as new byte  (there is hole in struct anyway), when we start adding ISO we may get too close to 15 :)
   
   and regardless of that I'd make external type max value (either 15 or 255), alternatively don't put BLE_LL_SCHED_TYPE_EXTERNAL under ifdef



-- 
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 commented on a diff in pull request #1349: nimble/ll: Add support for custom scheduling items

Posted by GitBox <gi...@apache.org>.
sjanc commented on code in PR #1349:
URL: https://github.com/apache/mynewt-nimble/pull/1349#discussion_r968046512


##########
nimble/controller/include/controller/ble_ll_sched.h:
##########
@@ -90,7 +97,12 @@ typedef void (*sched_remove_cb_func)(struct ble_ll_sched_item *sch);
  */
 struct ble_ll_sched_item
 {
+#if MYNEWT_VAL(BLE_LL_EXT_SCHED)
+    uint8_t         sched_type : 4;
+    uint8_t         sched_ext_type : 4;

Review Comment:
   I'd just add ext_type as new byte  (there is hole in struct anyway), when we start adding ISO we may get too close to 15 :)
   
   and regardless of that I'd make external type max value (either 15 or 255)



-- 
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