mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccoll...@apache.org
Subject [1/2] incubator-mynewt-core git commit: BLE Host - More log cleanup.
Date Thu, 09 Jun 2016 00:42:19 GMT
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop b1f2c51e5 -> 4300d57c8


BLE Host - More log cleanup.


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/86dcaf93
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/86dcaf93
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/86dcaf93

Branch: refs/heads/develop
Commit: 86dcaf93dba50f5caa1f0d6cb5ade01829dd468b
Parents: b1f2c51
Author: Christopher Collins <ccollins@apache.org>
Authored: Tue Jun 7 08:00:04 2016 +0800
Committer: Christopher Collins <ccollins@apache.org>
Committed: Thu Jun 9 08:36:18 2016 +0800

----------------------------------------------------------------------
 net/nimble/host/src/ble_att_svr.c |  9 +++++----
 net/nimble/host/src/ble_hs_priv.h | 24 ++++++++++++------------
 2 files changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/86dcaf93/net/nimble/host/src/ble_att_svr.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_att_svr.c b/net/nimble/host/src/ble_att_svr.c
index 210d421..8508240 100644
--- a/net/nimble/host/src/ble_att_svr.c
+++ b/net/nimble/host/src/ble_att_svr.c
@@ -440,7 +440,8 @@ ble_att_svr_tx_error_rsp(struct ble_hs_conn *conn, struct ble_l2cap_chan
*chan,
     rsp.baep_error_code = error_code;
 
     ble_att_error_rsp_write(dst, BLE_ATT_ERROR_RSP_SZ, &rsp);
-    BLE_ATT_LOG_CMD(1, "error rsp", conn_handle, ble_att_error_rsp_log, &rsp);
+    BLE_ATT_LOG_CMD(1, "error rsp", conn->bhc_handle,
+                    ble_att_error_rsp_log, &rsp);
 
     rc = ble_l2cap_tx(conn, chan, txom);
     txom = NULL;
@@ -1510,7 +1511,6 @@ ble_att_svr_build_read_blob_rsp(void *attr_data, int attr_len, uint16_t
mtu,
         goto done;
     }
 
-    BLE_ATT_LOG_EMPTY_CMD(1, "read blob rsp", conn_handle);
     rc = 0;
 
 done:
@@ -1575,6 +1575,7 @@ ble_att_svr_rx_read_blob(uint16_t conn_handle, struct os_mbuf **rxom)
         err_handle = req.babq_handle;
         goto done;
     }
+    BLE_ATT_LOG_EMPTY_CMD(1, "read blob rsp", conn_handle);
 
     rc = 0;
 
@@ -2086,7 +2087,6 @@ ble_att_svr_build_write_rsp(struct os_mbuf **out_txom, uint8_t *att_err)
 
     *dst = BLE_ATT_OP_WRITE_RSP;
 
-    BLE_ATT_LOG_EMPTY_CMD(1, "write rsp", conn_handle);
     rc = 0;
 
 done:
@@ -2142,6 +2142,7 @@ ble_att_svr_rx_write(uint16_t conn_handle, struct os_mbuf **rxom)
         err_handle = req.bawq_handle;
         goto done;
     }
+    BLE_ATT_LOG_EMPTY_CMD(1, "write rsp", conn_handle);
 
     rc = 0;
 
@@ -2687,7 +2688,6 @@ ble_att_svr_build_indicate_rsp(struct os_mbuf **out_txom)
     }
 
     ble_att_indicate_rsp_write(dst, BLE_ATT_INDICATE_RSP_SZ);
-    BLE_ATT_LOG_EMPTY_CMD(1, "indicate rsp", conn_handle);
 
     rc = 0;
 
@@ -2744,6 +2744,7 @@ ble_att_svr_rx_indicate(uint16_t conn_handle, struct os_mbuf **rxom)
     if (rc != 0) {
         goto done;
     }
+    BLE_ATT_LOG_EMPTY_CMD(1, "indicate rsp", conn_handle);
 
     rc = 0;
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/86dcaf93/net/nimble/host/src/ble_hs_priv.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs_priv.h b/net/nimble/host/src/ble_hs_priv.h
index 70f0de8..ba74b92 100644
--- a/net/nimble/host/src/ble_hs_priv.h
+++ b/net/nimble/host/src/ble_hs_priv.h
@@ -127,20 +127,20 @@ void ble_hci_set_phony_ack_cb(ble_hci_cmd_phony_ack_fn *cb);
 
 #if LOG_LEVEL <= LOG_LEVEL_DEBUG
 
-#define BLE_HS_LOG_CMD(is_tx, cmd_type, cmd_name, conn_handle,          \
-                       log_cb, cmd) do                                  \
-{                                                                       \
-    BLE_HS_LOG(DEBUG, "%sed %s command: %s; conn=%d",                   \
-               is_tx ? "tx" : "rx", cmd_type, cmd_name);                \
-    (log_cb)(cmd);                                                      \
-    BLE_HS_LOG(DEBUG, "\n");                                            \
+#define BLE_HS_LOG_CMD(is_tx, cmd_type, cmd_name, conn_handle,                \
+                       log_cb, cmd) do                                        \
+{                                                                             \
+    BLE_HS_LOG(DEBUG, "%sed %s command: %s; conn=%d ",                        \
+               (is_tx) ? "tx" : "rx", (cmd_type), (cmd_name), (conn_handle)); \
+    (log_cb)(cmd);                                                            \
+    BLE_HS_LOG(DEBUG, "\n");                                                  \
 } while (0)
 
-#define BLE_HS_LOG_EMPTY_CMD(is_tx, cmd_type, cmd_name, conn_handle) do \
-{                                                                       \
-    BLE_HS_LOG(DEBUG, "%sed %s command: %s; conn=%d",                   \
-               is_tx ? "tx" : "rx", cmd_type, cmd_name);                \
-    BLE_HS_LOG(DEBUG, "\n");                                            \
+#define BLE_HS_LOG_EMPTY_CMD(is_tx, cmd_type, cmd_name, conn_handle) do       \
+{                                                                             \
+    BLE_HS_LOG(DEBUG, "%sed %s command: %s; conn=%d ",                        \
+               (is_tx) ? "tx" : "rx", (cmd_type), (cmd_name), (conn_handle)); \
+    BLE_HS_LOG(DEBUG, "\n");                                                  \
 } while (0)
 
 #else


Mime
View raw message