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 2017/11/20 21:38:23 UTC

[GitHub] ccollins476ad closed pull request #665: MYNEWT-869 net/nimble/host unittest failures

ccollins476ad closed pull request #665: MYNEWT-869 net/nimble/host unittest failures
URL: https://github.com/apache/mynewt-core/pull/665
 
 
   

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/apps/bletiny/src/main.c b/apps/bletiny/src/main.c
index 8445ff4ff..fe7a0be9c 100755
--- a/apps/bletiny/src/main.c
+++ b/apps/bletiny/src/main.c
@@ -1983,9 +1983,7 @@ bletiny_l2cap_send(uint16_t conn_handle, uint16_t idx, uint16_t bytes)
     rc = ble_l2cap_send(coc->chan, sdu_tx);
     if (rc) {
         console_printf("Could not send data rc=%d\n", rc);
-        if (rc == BLE_HS_EBUSY) {
-            os_mbuf_free_chain(sdu_tx);
-        }
+        os_mbuf_free_chain(sdu_tx);
     }
 
     return rc;
diff --git a/apps/btshell/src/main.c b/apps/btshell/src/main.c
index db3c1b306..d6a4df865 100755
--- a/apps/btshell/src/main.c
+++ b/apps/btshell/src/main.c
@@ -1985,9 +1985,7 @@ btshell_l2cap_send(uint16_t conn_handle, uint16_t idx, uint16_t bytes)
     rc = ble_l2cap_send(coc->chan, sdu_tx);
     if (rc) {
         console_printf("Could not send data rc=%d\n", rc);
-        if (rc == BLE_HS_EBUSY) {
-            os_mbuf_free_chain(sdu_tx);
-        }
+        os_mbuf_free_chain(sdu_tx);
     }
 
     return rc;
diff --git a/net/nimble/host/src/ble_l2cap.c b/net/nimble/host/src/ble_l2cap.c
index 04ee4cad5..1c7e27a2a 100644
--- a/net/nimble/host/src/ble_l2cap.c
+++ b/net/nimble/host/src/ble_l2cap.c
@@ -160,6 +160,10 @@ int ble_l2cap_disconnect(struct ble_l2cap_chan *chan)
     return ble_l2cap_sig_disconnect(chan);
 }
 
+/**
+ * Transmits a packet over an L2CAP channel.  This function only consumes the
+ * supplied mbuf on success.
+ */
 int
 ble_l2cap_send(struct ble_l2cap_chan *chan, struct os_mbuf *sdu)
 {
diff --git a/net/nimble/host/src/ble_l2cap_coc.c b/net/nimble/host/src/ble_l2cap_coc.c
index e24359922..537e1e045 100644
--- a/net/nimble/host/src/ble_l2cap_coc.c
+++ b/net/nimble/host/src/ble_l2cap_coc.c
@@ -476,6 +476,10 @@ ble_l2cap_coc_recv_ready(struct ble_l2cap_chan *chan, struct os_mbuf *sdu_rx)
     ble_hs_unlock();
 }
 
+/**
+ * Transmits a packet over a connection-oriented channel.  This function only
+ * consumes the supplied mbuf on success.
+ */
 int
 ble_l2cap_coc_send(struct ble_l2cap_chan *chan, struct os_mbuf *sdu_tx)
 {
@@ -487,12 +491,12 @@ ble_l2cap_coc_send(struct ble_l2cap_chan *chan, struct os_mbuf *sdu_tx)
         return BLE_HS_EBUSY;
     }
 
-    tx->sdu = sdu_tx;
-
     if (OS_MBUF_PKTLEN(sdu_tx) > tx->mtu) {
         return BLE_HS_EBADDATA;
     }
 
+    tx->sdu = sdu_tx;
+
     return ble_l2cap_coc_continue_tx(chan);
 }
 
diff --git a/net/nimble/host/test/src/ble_gatts_read_test.c b/net/nimble/host/test/src/ble_gatts_read_test.c
index f0d0efa1d..92ef8b189 100644
--- a/net/nimble/host/test/src/ble_gatts_read_test.c
+++ b/net/nimble/host/test/src/ble_gatts_read_test.c
@@ -84,8 +84,6 @@ ble_gatts_read_test_misc_init(uint16_t *out_conn_handle)
     TEST_ASSERT_FATAL(ble_gatts_read_test_chr_2_val_handle ==
                       ble_gatts_read_test_chr_2_def_handle + 1);
 
-    ble_gatts_start();
-
     ble_hs_test_util_create_conn(2, ble_gatts_read_test_peer_addr, NULL, NULL);
 
     if (out_conn_handle != NULL) {


 

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