This is an automated email from the ASF dual-hosted git repository.

rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 01ac200e9978c77d0cab9c081282af40ffafb9af
Author: Ɓukasz Rymanowski <[email protected]>
AuthorDate: Sat Jan 11 16:14:47 2020 +0100

    nimble/l2cap: Rename opcodes for LE CoC
    
    Preparation to add new ones
---
 nimble/host/include/host/ble_l2cap.h  | 4 ++--
 nimble/host/src/ble_l2cap_sig.c       | 8 ++++----
 nimble/host/test/src/ble_l2cap_test.c | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/nimble/host/include/host/ble_l2cap.h 
b/nimble/host/include/host/ble_l2cap.h
index b77ef25..2f7c6a6 100644
--- a/nimble/host/include/host/ble_l2cap.h
+++ b/nimble/host/include/host/ble_l2cap.h
@@ -51,8 +51,8 @@ struct ble_hs_conn;
 #define BLE_L2CAP_SIG_OP_MOVE_CHAN_CONF_RSP     0x11
 #define BLE_L2CAP_SIG_OP_UPDATE_REQ             0x12
 #define BLE_L2CAP_SIG_OP_UPDATE_RSP             0x13
-#define BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ     0x14
-#define BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP     0x15
+#define BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ  0x14
+#define BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP  0x15
 #define BLE_L2CAP_SIG_OP_FLOW_CTRL_CREDIT       0x16
 #define BLE_L2CAP_SIG_OP_MAX                    0x17
 
diff --git a/nimble/host/src/ble_l2cap_sig.c b/nimble/host/src/ble_l2cap_sig.c
index 0cd19ca..11b8a88 100644
--- a/nimble/host/src/ble_l2cap_sig.c
+++ b/nimble/host/src/ble_l2cap_sig.c
@@ -121,8 +121,8 @@ static ble_l2cap_sig_rx_fn * const ble_l2cap_sig_dispatch[] 
= {
     [BLE_L2CAP_SIG_OP_MOVE_CHAN_CONF_RSP]   = ble_l2cap_sig_rx_noop,
     [BLE_L2CAP_SIG_OP_UPDATE_REQ]           = ble_l2cap_sig_update_req_rx,
     [BLE_L2CAP_SIG_OP_UPDATE_RSP]           = ble_l2cap_sig_update_rsp_rx,
-    [BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ]   = ble_l2cap_sig_coc_req_rx,
-    [BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP]   = ble_l2cap_sig_coc_rsp_rx,
+    [BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ]   = ble_l2cap_sig_coc_req_rx,
+    [BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP]   = ble_l2cap_sig_coc_rsp_rx,
     [BLE_L2CAP_SIG_OP_FLOW_CTRL_CREDIT]     = ble_l2cap_sig_le_credits_rx,
 };
 
@@ -651,7 +651,7 @@ ble_l2cap_sig_coc_req_rx(uint16_t conn_handle, struct 
ble_l2cap_sig_hdr *hdr,
         return rc;
     }
 
-    rsp = ble_l2cap_sig_cmd_get(BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP,
+    rsp = ble_l2cap_sig_cmd_get(BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP,
                                 hdr->identifier, sizeof(*rsp), &txom);
     if (!rsp) {
         /* Well, nothing smart we can do if there is no memory for response.
@@ -840,7 +840,7 @@ ble_l2cap_sig_coc_connect(uint16_t conn_handle, uint16_t 
psm, uint16_t mtu,
     proc->conn_handle = conn_handle;
     proc->connect.chan = chan;
 
-    req = ble_l2cap_sig_cmd_get(BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ, proc->id,
+    req = ble_l2cap_sig_cmd_get(BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ, 
proc->id,
                                 sizeof(*req), &txom);
     if (!req) {
         ble_l2cap_chan_free(conn, chan);
diff --git a/nimble/host/test/src/ble_l2cap_test.c 
b/nimble/host/test/src/ble_l2cap_test.c
index 0d636dc..167b9a1 100644
--- a/nimble/host/test/src/ble_l2cap_test.c
+++ b/nimble/host/test/src/ble_l2cap_test.c
@@ -796,7 +796,7 @@ ble_l2cap_test_coc_connect(struct test_data *t)
 
     /* Ensure an update request got sent. */
     id = ble_hs_test_util_verify_tx_l2cap_sig(
-                                            
BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ,
+                                            
BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ,
                                             &req, sizeof(req));
 
     /* Use some different parameters for peer. Just keep mtu same for testing
@@ -808,7 +808,7 @@ ble_l2cap_test_coc_connect(struct test_data *t)
     rsp.result = htole16(ev->l2cap_status);
 
     rc = ble_hs_test_util_inject_rx_l2cap_sig(2,
-                                              
BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP,
+                                              
BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP,
                                               id, &rsp, sizeof(rsp));
     TEST_ASSERT(rc == 0);
 
@@ -837,7 +837,7 @@ ble_l2cap_test_coc_connect_by_peer(struct test_data *t)
 
     /* Receive remote request*/
     rc = ble_hs_test_util_inject_rx_l2cap_sig(2,
-                                              
BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ,
+                                              
BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ,
                                               id, &req, sizeof(req));
     TEST_ASSERT_FATAL(rc == 0);
 
@@ -862,7 +862,7 @@ ble_l2cap_test_coc_connect_by_peer(struct test_data *t)
 
     /* Ensure we sent response. */
     TEST_ASSERT(id == ble_hs_test_util_verify_tx_l2cap_sig(
-                                            
BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP,
+                                            
BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP,
                                             &rsp, sizeof(rsp)));
 
     if (ev->l2cap_status == 0) {

Reply via email to