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/12/15 15:36:54 UTC

[GitHub] andrzej-kaczmarek closed pull request #701: nimble: few fixes

andrzej-kaczmarek closed pull request #701: nimble: few fixes
URL: https://github.com/apache/mynewt-core/pull/701
 
 
   

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/net/nimble/controller/src/ble_ll_adv.c b/net/nimble/controller/src/ble_ll_adv.c
index e362a32d5..5ab08996f 100644
--- a/net/nimble/controller/src/ble_ll_adv.c
+++ b/net/nimble/controller/src/ble_ll_adv.c
@@ -38,7 +38,6 @@
 #include "controller/ble_ll_whitelist.h"
 #include "controller/ble_ll_resolv.h"
 #include "ble_ll_conn_priv.h"
-#include "hal/hal_gpio.h"
 
 /* XXX: TODO
  * 1) Need to look at advertising and scan request PDUs. Do I allocate these
diff --git a/net/nimble/controller/src/ble_ll_conn.c b/net/nimble/controller/src/ble_ll_conn.c
index 0901352df..9d7fe1534 100644
--- a/net/nimble/controller/src/ble_ll_conn.c
+++ b/net/nimble/controller/src/ble_ll_conn.c
@@ -40,7 +40,6 @@
 #include "controller/ble_phy.h"
 #include "controller/ble_hw.h"
 #include "ble_ll_conn_priv.h"
-#include "hal/hal_gpio.h"
 
 #if (BLETEST_THROUGHPUT_TEST == 1)
 extern void bletest_completed_pkt(uint16_t handle);
diff --git a/net/nimble/controller/src/ble_ll_scan.c b/net/nimble/controller/src/ble_ll_scan.c
index c3ac7feed..adbd719be 100644
--- a/net/nimble/controller/src/ble_ll_scan.c
+++ b/net/nimble/controller/src/ble_ll_scan.c
@@ -39,7 +39,6 @@
 #include "controller/ble_ll_resolv.h"
 #include "controller/ble_ll_xcvr.h"
 #include "ble_ll_conn_priv.h"
-#include "hal/hal_gpio.h"
 
 /*
  * XXX:
diff --git a/net/nimble/host/src/ble_att.c b/net/nimble/host/src/ble_att.c
index 8261e09e7..774444ab0 100644
--- a/net/nimble/host/src/ble_att.c
+++ b/net/nimble/host/src/ble_att.c
@@ -471,7 +471,7 @@ ble_att_rx(struct ble_l2cap_chan *chan)
     int rc;
 
     conn_handle = ble_l2cap_get_conn_handle(chan);
-    if (!conn_handle) {
+    if (conn_handle == BLE_HS_CONN_HANDLE_NONE) {
         return BLE_HS_ENOTCONN;
     }
 
diff --git a/net/nimble/host/src/ble_hs_hci.c b/net/nimble/host/src/ble_hs_hci.c
index af07fce5e..72bbeb38d 100644
--- a/net/nimble/host/src/ble_hs_hci.c
+++ b/net/nimble/host/src/ble_hs_hci.c
@@ -28,7 +28,7 @@
 #include "ble_hs_dbg_priv.h"
 #include "ble_monitor_priv.h"
 
-#define BLE_HCI_CMD_TIMEOUT     (OS_TICKS_PER_SEC)
+#define BLE_HCI_CMD_TIMEOUT     ((OS_TICKS_PER_SEC) * 2)
 
 static struct os_mutex ble_hs_hci_mutex;
 static struct os_sem ble_hs_hci_sem;
diff --git a/net/nimble/host/src/ble_l2cap.c b/net/nimble/host/src/ble_l2cap.c
index 1c7e27a2a..883bde78a 100644
--- a/net/nimble/host/src/ble_l2cap.c
+++ b/net/nimble/host/src/ble_l2cap.c
@@ -135,7 +135,7 @@ uint16_t
 ble_l2cap_get_conn_handle(struct ble_l2cap_chan *chan)
 {
     if (!chan) {
-        return 0;
+        return BLE_HS_CONN_HANDLE_NONE;
     }
 
     return chan->conn_handle;
diff --git a/net/nimble/host/src/ble_sm.c b/net/nimble/host/src/ble_sm.c
index 205b05f9a..e53b4ff1a 100644
--- a/net/nimble/host/src/ble_sm.c
+++ b/net/nimble/host/src/ble_sm.c
@@ -2565,7 +2565,7 @@ ble_sm_rx(struct ble_l2cap_chan *chan)
     STATS_INC(ble_l2cap_stats, sm_rx);
 
     conn_handle = ble_l2cap_get_conn_handle(chan);
-    if (!conn_handle) {
+    if (conn_handle == BLE_HS_CONN_HANDLE_NONE) {
         return BLE_HS_ENOTCONN;
     }
 


 

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