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 2016/06/07 14:41:11 UTC
[04/12] incubator-mynewt-core git commit: BLE Host - More log cleanup.
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/b0eebf9e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/b0eebf9e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/b0eebf9e
Branch: refs/heads/upf54
Commit: b0eebf9efbdefa557bda73666424d747b06040f0
Parents: a056e9f
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Jun 7 08:00:04 2016 +0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Jun 7 22:40:09 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/b0eebf9e/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/b0eebf9e/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