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/05/14 16:17:48 UTC

[GitHub] turon commented on a change in pull request #90: [linux] Add linux port of nimble using npl.

turon commented on a change in pull request #90: [linux] Add linux port of nimble using npl.
URL: https://github.com/apache/mynewt-nimble/pull/90#discussion_r188011885
 
 

 ##########
 File path: nimble/transport/socket/src/ble_hci_socket.c
 ##########
 @@ -743,26 +749,27 @@ static void
 ble_hci_sock_ack_handler(void *arg)
 {
     while (1) {
-        os_eventq_run(&ble_hci_sock_state.evq);
+        ble_npl_eventq_run(&ble_hci_sock_state.evq);
     }
 }
 
 static void
 ble_hci_sock_init_task(void)
 {
-    os_stack_t *pstack;
+    ble_npl_stack_t *pstack;
 
-    pstack = malloc(sizeof(os_stack_t)*BLE_SOCK_STACK_SIZE);
+    pstack = malloc(sizeof(ble_npl_stack_t)*BLE_SOCK_STACK_SIZE);
     assert(pstack);
 
-    os_task_init(&ble_sock_task, "hci_sock", ble_hci_sock_ack_handler, NULL,
-                 MYNEWT_VAL(BLE_SOCK_TASK_PRIO), OS_WAIT_FOREVER, pstack,
-                 BLE_SOCK_STACK_SIZE);
-
-    os_eventq_init(&ble_hci_sock_state.evq);
-    os_callout_stop(&ble_hci_sock_state.timer);
-    os_callout_init(&ble_hci_sock_state.timer, &ble_hci_sock_state.evq,
+    ble_npl_eventq_init(&ble_hci_sock_state.evq);
+    ble_npl_callout_stop(&ble_hci_sock_state.timer);
+    ble_npl_callout_init(&ble_hci_sock_state.timer, &ble_hci_sock_state.evq,
                     ble_hci_sock_rx_ev, NULL);
+
+    ble_npl_task_init(&ble_sock_task, "hci_sock", ble_hci_sock_ack_handler, NULL,
+                      MYNEWT_VAL(BLE_SOCK_TASK_PRIO), OS_WAIT_FOREVER, pstack,
+                      BLE_SOCK_STACK_SIZE);
 
 Review comment:
   But that will fail when compiled for Linux...  Abstracting this call is exactly why NPL exists!

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