You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2017/04/11 00:55:13 UTC

[07/11] incubator-mynewt-core git commit: nimble/l2cap: Fix logs on LE CoC receive data

nimble/l2cap: Fix logs on LE CoC receive data


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/8a64a498
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/8a64a498
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/8a64a498

Branch: refs/heads/master
Commit: 8a64a498afdcc1d7b7b46436f87e16a393521c77
Parents: 41c9c79
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Fri Mar 17 13:35:37 2017 +0100
Committer: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Committed: Thu Apr 6 10:04:03 2017 +0200

----------------------------------------------------------------------
 net/nimble/host/src/ble_l2cap_coc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/8a64a498/net/nimble/host/src/ble_l2cap_coc.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_coc.c b/net/nimble/host/src/ble_l2cap_coc.c
index 3f8373f..87d830a 100644
--- a/net/nimble/host/src/ble_l2cap_coc.c
+++ b/net/nimble/host/src/ble_l2cap_coc.c
@@ -197,17 +197,19 @@ ble_l2cap_coc_rx_fn(struct ble_l2cap_chan *chan)
     if (OS_MBUF_PKTLEN(rx->sdu) == rx->data_offset) {
         struct os_mbuf *sdu_rx = rx->sdu;
 
+        BLE_HS_LOG(DEBUG, "Received sdu_len=%d, credits left=%d\n",
+                   OS_MBUF_PKTLEN(rx->sdu), rx->credits);
+
         /* Lets get back control to os_mbuf to application.
          * Since it this callback application might want to set new sdu
          * we need to prepare space for this. Therefore we need sdu_rx
          */
-
         rx->sdu = NULL;
         rx->data_offset = 0;
 
         ble_l2cap_event_coc_received_data(chan, sdu_rx);
 
-        goto done;
+        return 0;
     }
 
     /* If we did not received full SDU and credits are 0 it means
@@ -223,8 +225,7 @@ ble_l2cap_coc_rx_fn(struct ble_l2cap_chan *chan)
         ble_l2cap_sig_le_credits(chan, rx->credits);
     }
 
-done:
-    BLE_HS_LOG(DEBUG, "Received sdu_len=%d, credits left=%d\n",
+    BLE_HS_LOG(DEBUG, "Received partial sdu_len=%d, credits left=%d\n",
                OS_MBUF_PKTLEN(rx->sdu), rx->credits);
 
     return 0;