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 2017/02/13 19:31:43 UTC
[08/10] incubator-mynewt-core git commit: nimble/l2cap: Remove prefix
blc_ and blh_ from L2CAP structs
nimble/l2cap: Remove prefix blc_ and blh_ from L2CAP structs
Remove blc_ and blh_ prefix as it does not really gives us any value.
With this patch we make struct fields names shorter.
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/1c66c790
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/1c66c790
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/1c66c790
Branch: refs/heads/develop
Commit: 1c66c7902827ce2830fc1db21dfc0648f1e9ff68
Parents: e9bb23e
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Fri Jan 20 12:39:00 2017 +0100
Committer: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Committed: Thu Feb 2 12:59:59 2017 +0100
----------------------------------------------------------------------
net/nimble/host/src/ble_att.c | 14 +++----
net/nimble/host/src/ble_att_clt.c | 4 +-
net/nimble/host/src/ble_att_svr.c | 4 +-
net/nimble/host/src/ble_gattc.c | 2 +-
net/nimble/host/src/ble_hs_conn.c | 20 ++++-----
net/nimble/host/src/ble_l2cap.c | 52 ++++++++++++------------
net/nimble/host/src/ble_l2cap_priv.h | 22 +++++-----
net/nimble/host/src/ble_l2cap_sig.c | 8 ++--
net/nimble/host/src/ble_sm.c | 8 ++--
net/nimble/host/test/src/ble_att_svr_test.c | 10 ++---
net/nimble/host/test/src/ble_hs_conn_test.c | 18 ++++----
net/nimble/host/test/src/ble_hs_test_util.c | 6 +--
net/nimble/host/test/src/ble_l2cap_test.c | 16 ++++----
13 files changed, 92 insertions(+), 92 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/src/ble_att.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_att.c b/net/nimble/host/src/ble_att.c
index 0e3f00d..91bce94 100644
--- a/net/nimble/host/src/ble_att.c
+++ b/net/nimble/host/src/ble_att.c
@@ -436,7 +436,7 @@ ble_att_set_peer_mtu(struct ble_l2cap_chan *chan, uint16_t peer_mtu)
peer_mtu = BLE_ATT_MTU_DFLT;
}
- chan->blc_peer_mtu = peer_mtu;
+ chan->peer_mtu = peer_mtu;
}
static int
@@ -517,8 +517,8 @@ ble_att_set_preferred_mtu(uint16_t mtu)
chan = ble_hs_conn_chan_find(conn, BLE_L2CAP_CID_ATT);
BLE_HS_DBG_ASSERT(chan != NULL);
- if (!(chan->blc_flags & BLE_L2CAP_CHAN_F_TXED_MTU)) {
- chan->blc_my_mtu = mtu;
+ if (!(chan->flags & BLE_L2CAP_CHAN_F_TXED_MTU)) {
+ chan->my_mtu = mtu;
}
i++;
@@ -539,10 +539,10 @@ ble_att_create_chan(void)
return NULL;
}
- chan->blc_cid = BLE_L2CAP_CID_ATT;
- chan->blc_my_mtu = ble_att_preferred_mtu_val;
- chan->blc_default_mtu = BLE_ATT_MTU_DFLT;
- chan->blc_rx_fn = ble_att_rx;
+ chan->scid = BLE_L2CAP_CID_ATT;
+ chan->my_mtu = ble_att_preferred_mtu_val;
+ chan->default_mtu = BLE_ATT_MTU_DFLT;
+ chan->rx_fn = ble_att_rx;
return chan;
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/src/ble_att_clt.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_att_clt.c b/net/nimble/host/src/ble_att_clt.c
index e167576..cdb4fa3 100644
--- a/net/nimble/host/src/ble_att_clt.c
+++ b/net/nimble/host/src/ble_att_clt.c
@@ -132,7 +132,7 @@ ble_att_clt_tx_mtu(uint16_t conn_handle, const struct ble_att_mtu_cmd *req)
ble_att_conn_chan_find(conn_handle, &conn, &chan);
if (chan == NULL) {
rc = BLE_HS_ENOTCONN;
- } else if (chan->blc_flags & BLE_L2CAP_CHAN_F_TXED_MTU) {
+ } else if (chan->flags & BLE_L2CAP_CHAN_F_TXED_MTU) {
rc = BLE_HS_EALREADY;
} else {
rc = 0;
@@ -159,7 +159,7 @@ ble_att_clt_tx_mtu(uint16_t conn_handle, const struct ble_att_mtu_cmd *req)
ble_hs_lock();
ble_att_conn_chan_find(conn_handle, &conn, &chan);
- chan->blc_flags |= BLE_L2CAP_CHAN_F_TXED_MTU;
+ chan->flags |= BLE_L2CAP_CHAN_F_TXED_MTU;
ble_hs_unlock();
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/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 df1a30d..8932f2f 100644
--- a/net/nimble/host/src/ble_att_svr.c
+++ b/net/nimble/host/src/ble_att_svr.c
@@ -702,7 +702,7 @@ ble_att_svr_build_mtu_rsp(uint16_t conn_handle, struct os_mbuf **rxom,
ble_hs_lock();
ble_att_conn_chan_find(conn_handle, NULL, &chan);
- mtu = chan->blc_my_mtu;
+ mtu = chan->my_mtu;
ble_hs_unlock();
/* Just reuse the request buffer for the response. */
@@ -765,7 +765,7 @@ done:
ble_att_conn_chan_find(conn_handle, &conn, &chan);
ble_att_set_peer_mtu(chan, cmd.bamc_mtu);
- chan->blc_flags |= BLE_L2CAP_CHAN_F_TXED_MTU;
+ chan->flags |= BLE_L2CAP_CHAN_F_TXED_MTU;
mtu = ble_l2cap_chan_mtu(chan);
ble_hs_unlock();
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/src/ble_gattc.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gattc.c b/net/nimble/host/src/ble_gattc.c
index d3a2270..fabb52d 100644
--- a/net/nimble/host/src/ble_gattc.c
+++ b/net/nimble/host/src/ble_gattc.c
@@ -1271,7 +1271,7 @@ ble_gattc_mtu_tx(struct ble_gattc_proc *proc)
ble_hs_lock();
ble_att_conn_chan_find(proc->conn_handle, &conn, &chan);
- req.bamc_mtu = chan->blc_my_mtu;
+ req.bamc_mtu = chan->my_mtu;
ble_hs_unlock();
rc = ble_att_clt_tx_mtu(proc->conn_handle, &req);
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/src/ble_hs_conn.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs_conn.c b/net/nimble/host/src/ble_hs_conn.c
index d5dc17d..02676fa 100644
--- a/net/nimble/host/src/ble_hs_conn.c
+++ b/net/nimble/host/src/ble_hs_conn.c
@@ -58,11 +58,11 @@ ble_hs_conn_chan_find(struct ble_hs_conn *conn, uint16_t cid)
struct ble_l2cap_chan *chan;
- SLIST_FOREACH(chan, &conn->bhc_channels, blc_next) {
- if (chan->blc_cid == cid) {
+ SLIST_FOREACH(chan, &conn->bhc_channels, next) {
+ if (chan->scid == cid) {
return chan;
}
- if (chan->blc_cid > cid) {
+ if (chan->scid > cid) {
return NULL;
}
}
@@ -81,11 +81,11 @@ ble_hs_conn_chan_insert(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan)
struct ble_l2cap_chan *cur;
prev = NULL;
- SLIST_FOREACH(cur, &conn->bhc_channels, blc_next) {
- if (cur->blc_cid == chan->blc_cid) {
+ SLIST_FOREACH(cur, &conn->bhc_channels, next) {
+ if (cur->scid == chan->scid) {
return BLE_HS_EALREADY;
}
- if (cur->blc_cid > chan->blc_cid) {
+ if (cur->scid > chan->scid) {
break;
}
@@ -93,9 +93,9 @@ ble_hs_conn_chan_insert(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan)
}
if (prev == NULL) {
- SLIST_INSERT_HEAD(&conn->bhc_channels, chan, blc_next);
+ SLIST_INSERT_HEAD(&conn->bhc_channels, chan, next);
} else {
- SLIST_INSERT_AFTER(prev, chan, blc_next);
+ SLIST_INSERT_AFTER(prev, chan, next);
}
return 0;
@@ -164,14 +164,14 @@ err:
return NULL;
}
-static void
+void
ble_hs_conn_delete_chan(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan)
{
if (conn->bhc_rx_chan == chan) {
conn->bhc_rx_chan = NULL;
}
- SLIST_REMOVE(&conn->bhc_channels, chan, ble_l2cap_chan, blc_next);
+ SLIST_REMOVE(&conn->bhc_channels, chan, ble_l2cap_chan, next);
ble_l2cap_chan_free(chan);
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/src/ble_l2cap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap.c b/net/nimble/host/src/ble_l2cap.c
index fc8ecb9..6b857f2 100644
--- a/net/nimble/host/src/ble_l2cap.c
+++ b/net/nimble/host/src/ble_l2cap.c
@@ -89,15 +89,15 @@ ble_l2cap_chan_mtu(const struct ble_l2cap_chan *chan)
/* If either side has not exchanged MTU size, use the default. Otherwise,
* use the lesser of the two exchanged values.
*/
- if (!(chan->blc_flags & BLE_L2CAP_CHAN_F_TXED_MTU) ||
- chan->blc_peer_mtu == 0) {
+ if (!(chan->flags & BLE_L2CAP_CHAN_F_TXED_MTU) ||
+ chan->peer_mtu == 0) {
- mtu = chan->blc_default_mtu;
+ mtu = chan->default_mtu;
} else {
- mtu = min(chan->blc_my_mtu, chan->blc_peer_mtu);
+ mtu = min(chan->my_mtu, chan->peer_mtu);
}
- BLE_HS_DBG_ASSERT(mtu >= chan->blc_default_mtu);
+ BLE_HS_DBG_ASSERT(mtu >= chan->default_mtu);
return mtu;
}
@@ -113,8 +113,8 @@ ble_l2cap_parse_hdr(struct os_mbuf *om, int off,
return BLE_HS_EMSGSIZE;
}
- l2cap_hdr->blh_len = get_le16(&l2cap_hdr->blh_len);
- l2cap_hdr->blh_cid = get_le16(&l2cap_hdr->blh_cid);
+ l2cap_hdr->len = get_le16(&l2cap_hdr->len);
+ l2cap_hdr->cid = get_le16(&l2cap_hdr->cid);
return 0;
}
@@ -124,8 +124,8 @@ ble_l2cap_prepend_hdr(struct os_mbuf *om, uint16_t cid, uint16_t len)
{
struct ble_l2cap_hdr hdr;
- put_le16(&hdr.blh_len, len);
- put_le16(&hdr.blh_cid, cid);
+ put_le16(&hdr.len, len);
+ put_le16(&hdr.cid, cid);
om = os_mbuf_prepend_pullup(om, sizeof hdr);
if (om == NULL) {
@@ -141,14 +141,14 @@ static void
ble_l2cap_forget_rx(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan)
{
conn->bhc_rx_chan = NULL;
- chan->blc_rx_buf = NULL;
- chan->blc_rx_len = 0;
+ chan->rx_buf = NULL;
+ chan->rx_len = 0;
}
static void
ble_l2cap_discard_rx(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan)
{
- os_mbuf_free_chain(chan->blc_rx_buf);
+ os_mbuf_free_chain(chan->rx_buf);
ble_l2cap_forget_rx(conn, chan);
}
@@ -160,22 +160,22 @@ ble_l2cap_rx_payload(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan,
int len_diff;
int rc;
- if (chan->blc_rx_buf == NULL) {
- chan->blc_rx_buf = om;
+ if (chan->rx_buf == NULL) {
+ chan->rx_buf = om;
} else {
- os_mbuf_concat(chan->blc_rx_buf, om);
+ os_mbuf_concat(chan->rx_buf, om);
}
/* Determine if packet is fully reassembled. */
- len_diff = OS_MBUF_PKTLEN(chan->blc_rx_buf) - chan->blc_rx_len;
+ len_diff = OS_MBUF_PKTLEN(chan->rx_buf) - chan->rx_len;
if (len_diff > 0) {
/* More data than expected; data corruption. */
ble_l2cap_discard_rx(conn, chan);
rc = BLE_HS_EBADDATA;
} else if (len_diff == 0) {
/* All fragments received. */
- *out_rx_cb = chan->blc_rx_fn;
- *out_rx_buf = chan->blc_rx_buf;
+ *out_rx_cb = chan->rx_fn;
+ *out_rx_buf = chan->rx_buf;
ble_l2cap_forget_rx(conn, chan);
rc = 0;
} else {
@@ -251,7 +251,7 @@ ble_l2cap_rx(struct ble_hs_conn *conn,
/* Strip L2CAP header from the front of the mbuf. */
os_mbuf_adj(om, BLE_L2CAP_HDR_SZ);
- chan = ble_hs_conn_chan_find(conn, l2cap_hdr.blh_cid);
+ chan = ble_hs_conn_chan_find(conn, l2cap_hdr.cid);
if (chan == NULL) {
rc = BLE_HS_ENOENT;
@@ -259,27 +259,27 @@ ble_l2cap_rx(struct ble_hs_conn *conn,
* channel, quietly drop the packet. Otherwise, send an invalid
* CID response.
*/
- if (l2cap_hdr.blh_cid != BLE_L2CAP_CID_BLACK_HOLE) {
+ if (l2cap_hdr.cid != BLE_L2CAP_CID_BLACK_HOLE) {
BLE_HS_LOG(DEBUG, "rx on unknown L2CAP channel: %d\n",
- l2cap_hdr.blh_cid);
- *out_reject_cid = l2cap_hdr.blh_cid;
+ l2cap_hdr.cid);
+ *out_reject_cid = l2cap_hdr.cid;
}
goto err;
}
- if (chan->blc_rx_buf != NULL) {
+ if (chan->rx_buf != NULL) {
/* Previous data packet never completed. Discard old packet. */
ble_l2cap_discard_rx(conn, chan);
}
/* Remember channel and length of L2CAP data for reassembly. */
conn->bhc_rx_chan = chan;
- chan->blc_rx_len = l2cap_hdr.blh_len;
+ chan->rx_len = l2cap_hdr.len;
break;
case BLE_HCI_PB_MIDDLE:
chan = conn->bhc_rx_chan;
- if (chan == NULL || chan->blc_rx_buf == NULL) {
+ if (chan == NULL || chan->rx_buf == NULL) {
/* Middle fragment without the start. Discard new packet. */
rc = BLE_HS_EBADDATA;
goto err;
@@ -319,7 +319,7 @@ ble_l2cap_tx(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan,
{
int rc;
- txom = ble_l2cap_prepend_hdr(txom, chan->blc_cid, OS_MBUF_PKTLEN(txom));
+ txom = ble_l2cap_prepend_hdr(txom, chan->scid, OS_MBUF_PKTLEN(txom));
if (txom == NULL) {
return BLE_HS_ENOMEM;
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/src/ble_l2cap_priv.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_priv.h b/net/nimble/host/src/ble_l2cap_priv.h
index 79d58a7..ecdcf78 100644
--- a/net/nimble/host/src/ble_l2cap_priv.h
+++ b/net/nimble/host/src/ble_l2cap_priv.h
@@ -64,22 +64,22 @@ typedef uint8_t ble_l2cap_chan_flags;
typedef int ble_l2cap_rx_fn(uint16_t conn_handle, struct os_mbuf **rxom);
struct ble_l2cap_chan {
- SLIST_ENTRY(ble_l2cap_chan) blc_next;
- uint16_t blc_cid;
- uint16_t blc_my_mtu;
- uint16_t blc_peer_mtu; /* 0 if not exchanged. */
- uint16_t blc_default_mtu;
- ble_l2cap_chan_flags blc_flags;
+ SLIST_ENTRY(ble_l2cap_chan) next;
+ uint16_t scid;
+ uint16_t my_mtu;
+ uint16_t peer_mtu; /* 0 if not exchanged. */
+ uint16_t default_mtu;
+ ble_l2cap_chan_flags flags;
- struct os_mbuf *blc_rx_buf;
- uint16_t blc_rx_len; /* Length of current reassembled rx packet. */
+ struct os_mbuf *rx_buf;
+ uint16_t rx_len; /* Length of current reassembled rx packet. */
- ble_l2cap_rx_fn *blc_rx_fn;
+ ble_l2cap_rx_fn *rx_fn;
};
struct ble_l2cap_hdr {
- uint16_t blh_len;
- uint16_t blh_cid;
+ uint16_t len;
+ uint16_t cid;
};
typedef int ble_l2cap_tx_fn(struct ble_hs_conn *conn,
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/src/ble_l2cap_sig.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_sig.c b/net/nimble/host/src/ble_l2cap_sig.c
index 33cde78..e7c7704 100644
--- a/net/nimble/host/src/ble_l2cap_sig.c
+++ b/net/nimble/host/src/ble_l2cap_sig.c
@@ -523,10 +523,10 @@ ble_l2cap_sig_create_chan(void)
return NULL;
}
- chan->blc_cid = BLE_L2CAP_CID_SIG;
- chan->blc_my_mtu = BLE_L2CAP_SIG_MTU;
- chan->blc_default_mtu = BLE_L2CAP_SIG_MTU;
- chan->blc_rx_fn = ble_l2cap_sig_rx;
+ chan->scid = BLE_L2CAP_CID_SIG;
+ chan->my_mtu = BLE_L2CAP_SIG_MTU;
+ chan->default_mtu = BLE_L2CAP_SIG_MTU;
+ chan->rx_fn = ble_l2cap_sig_rx;
return chan;
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/src/ble_sm.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_sm.c b/net/nimble/host/src/ble_sm.c
index a4e189d..0227f1a 100644
--- a/net/nimble/host/src/ble_sm.c
+++ b/net/nimble/host/src/ble_sm.c
@@ -2508,10 +2508,10 @@ ble_sm_create_chan(void)
return NULL;
}
- chan->blc_cid = BLE_L2CAP_CID_SM;
- chan->blc_my_mtu = BLE_SM_MTU;
- chan->blc_default_mtu = BLE_SM_MTU;
- chan->blc_rx_fn = ble_sm_rx;
+ chan->scid = BLE_L2CAP_CID_SM;
+ chan->my_mtu = BLE_SM_MTU;
+ chan->default_mtu = BLE_SM_MTU;
+ chan->rx_fn = ble_sm_rx;
return chan;
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/test/src/ble_att_svr_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_att_svr_test.c b/net/nimble/host/test/src/ble_att_svr_test.c
index 8ee9bc6..fa60abc 100644
--- a/net/nimble/host/test/src/ble_att_svr_test.c
+++ b/net/nimble/host/test/src/ble_att_svr_test.c
@@ -83,9 +83,9 @@ ble_att_svr_test_misc_init(uint16_t mtu)
TEST_ASSERT_FATAL(rc == 0);
if (mtu != 0) {
- chan->blc_my_mtu = mtu;
- chan->blc_peer_mtu = mtu;
- chan->blc_flags |= BLE_L2CAP_CHAN_F_TXED_MTU;
+ chan->my_mtu = mtu;
+ chan->peer_mtu = mtu;
+ chan->flags |= BLE_L2CAP_CHAN_F_TXED_MTU;
}
ble_hs_unlock();
@@ -443,7 +443,7 @@ ble_att_svr_test_misc_verify_tx_mtu_rsp(uint16_t conn_handle)
ble_hs_lock();
ble_att_conn_chan_find(conn_handle, &conn, &chan);
- my_mtu = chan->blc_my_mtu;
+ my_mtu = chan->my_mtu;
ble_hs_unlock();
ble_hs_test_util_verify_tx_mtu_cmd(0, my_mtu);
@@ -608,7 +608,7 @@ ble_att_svr_test_misc_mtu_exchange(uint16_t my_mtu, uint16_t peer_sent,
rc = ble_hs_misc_conn_chan_find(conn_handle, BLE_L2CAP_CID_ATT,
&conn, &chan);
TEST_ASSERT_FATAL(rc == 0);
- TEST_ASSERT(chan->blc_peer_mtu == peer_actual);
+ TEST_ASSERT(chan->peer_mtu == peer_actual);
TEST_ASSERT(ble_l2cap_chan_mtu(chan) == chan_mtu);
ble_hs_unlock();
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/test/src/ble_hs_conn_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_hs_conn_test.c b/net/nimble/host/test/src/ble_hs_conn_test.c
index 93e2f14..eb6da38 100644
--- a/net/nimble/host/test/src/ble_hs_conn_test.c
+++ b/net/nimble/host/test/src/ble_hs_conn_test.c
@@ -79,9 +79,9 @@ TEST_CASE(ble_hs_conn_test_direct_connect_success)
chan = ble_hs_conn_chan_find(conn, BLE_L2CAP_CID_ATT);
TEST_ASSERT_FATAL(chan != NULL);
- TEST_ASSERT(chan->blc_my_mtu == BLE_ATT_MTU_PREFERRED_DFLT);
- TEST_ASSERT(chan->blc_peer_mtu == 0);
- TEST_ASSERT(chan->blc_default_mtu == BLE_ATT_MTU_DFLT);
+ TEST_ASSERT(chan->my_mtu == BLE_ATT_MTU_PREFERRED_DFLT);
+ TEST_ASSERT(chan->peer_mtu == 0);
+ TEST_ASSERT(chan->default_mtu == BLE_ATT_MTU_DFLT);
ble_hs_unlock();
}
@@ -134,9 +134,9 @@ TEST_CASE(ble_hs_conn_test_direct_connectable_success)
chan = ble_hs_conn_chan_find(conn, BLE_L2CAP_CID_ATT);
TEST_ASSERT_FATAL(chan != NULL);
- TEST_ASSERT(chan->blc_my_mtu == BLE_ATT_MTU_PREFERRED_DFLT);
- TEST_ASSERT(chan->blc_peer_mtu == 0);
- TEST_ASSERT(chan->blc_default_mtu == BLE_ATT_MTU_DFLT);
+ TEST_ASSERT(chan->my_mtu == BLE_ATT_MTU_PREFERRED_DFLT);
+ TEST_ASSERT(chan->peer_mtu == 0);
+ TEST_ASSERT(chan->default_mtu == BLE_ATT_MTU_DFLT);
ble_hs_unlock();
}
@@ -196,9 +196,9 @@ TEST_CASE(ble_hs_conn_test_undirect_connectable_success)
chan = ble_hs_conn_chan_find(conn, BLE_L2CAP_CID_ATT);
TEST_ASSERT_FATAL(chan != NULL);
- TEST_ASSERT(chan->blc_my_mtu == BLE_ATT_MTU_PREFERRED_DFLT);
- TEST_ASSERT(chan->blc_peer_mtu == 0);
- TEST_ASSERT(chan->blc_default_mtu == BLE_ATT_MTU_DFLT);
+ TEST_ASSERT(chan->my_mtu == BLE_ATT_MTU_PREFERRED_DFLT);
+ TEST_ASSERT(chan->peer_mtu == 0);
+ TEST_ASSERT(chan->default_mtu == BLE_ATT_MTU_DFLT);
ble_hs_unlock();
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/test/src/ble_hs_test_util.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_hs_test_util.c b/net/nimble/host/test/src/ble_hs_test_util.c
index 687920e..5b0902c 100644
--- a/net/nimble/host/test/src/ble_hs_test_util.c
+++ b/net/nimble/host/test/src/ble_hs_test_util.c
@@ -125,7 +125,7 @@ ble_hs_test_util_prev_tx_dequeue(void)
ble_hs_test_util_prev_tx_cur = om;
while (OS_MBUF_PKTLEN(ble_hs_test_util_prev_tx_cur) <
- l2cap_hdr.blh_len) {
+ l2cap_hdr.len) {
om = ble_hs_test_util_prev_tx_dequeue_once(&hci_hdr);
TEST_ASSERT_FATAL(om != NULL);
@@ -2039,8 +2039,8 @@ ble_hs_test_util_mbuf_count(const struct ble_hs_test_util_mbuf_params *params)
}
if (params->rx_queue) {
- SLIST_FOREACH(chan, &conn->bhc_channels, blc_next) {
- count += ble_hs_test_util_mbuf_chain_len(chan->blc_rx_buf);
+ SLIST_FOREACH(chan, &conn->bhc_channels, next) {
+ count += ble_hs_test_util_mbuf_chain_len(chan->rx_buf);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1c66c790/net/nimble/host/test/src/ble_l2cap_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_l2cap_test.c b/net/nimble/host/test/src/ble_l2cap_test.c
index 526436c..021ebb7 100644
--- a/net/nimble/host/test/src/ble_l2cap_test.c
+++ b/net/nimble/host/test/src/ble_l2cap_test.c
@@ -118,10 +118,10 @@ ble_l2cap_test_util_create_conn(uint16_t conn_handle, uint8_t *addr,
chan = ble_l2cap_chan_alloc();
TEST_ASSERT_FATAL(chan != NULL);
- chan->blc_cid = BLE_L2CAP_TEST_CID;
- chan->blc_my_mtu = 240;
- chan->blc_default_mtu = 240;
- chan->blc_rx_fn = ble_l2cap_test_util_dummy_rx;
+ chan->scid = BLE_L2CAP_TEST_CID;
+ chan->my_mtu = 240;
+ chan->default_mtu = 240;
+ chan->rx_fn = ble_l2cap_test_util_dummy_rx;
ble_hs_conn_chan_insert(conn, chan);
@@ -194,7 +194,7 @@ ble_l2cap_test_util_verify_first_frag(uint16_t conn_handle,
conn = ble_hs_conn_find(conn_handle);
TEST_ASSERT_FATAL(conn != NULL);
TEST_ASSERT(conn->bhc_rx_chan != NULL &&
- conn->bhc_rx_chan->blc_cid == BLE_L2CAP_TEST_CID);
+ conn->bhc_rx_chan->scid == BLE_L2CAP_TEST_CID);
ble_hs_unlock();
}
@@ -214,7 +214,7 @@ ble_l2cap_test_util_verify_middle_frag(uint16_t conn_handle,
conn = ble_hs_conn_find(conn_handle);
TEST_ASSERT_FATAL(conn != NULL);
TEST_ASSERT(conn->bhc_rx_chan != NULL &&
- conn->bhc_rx_chan->blc_cid == BLE_L2CAP_TEST_CID);
+ conn->bhc_rx_chan->scid == BLE_L2CAP_TEST_CID);
ble_hs_unlock();
}
@@ -352,7 +352,7 @@ TEST_CASE(ble_l2cap_test_case_frag_channels)
conn = ble_hs_conn_find(2);
TEST_ASSERT_FATAL(conn != NULL);
TEST_ASSERT(conn->bhc_rx_chan != NULL &&
- conn->bhc_rx_chan->blc_cid == BLE_L2CAP_TEST_CID);
+ conn->bhc_rx_chan->scid == BLE_L2CAP_TEST_CID);
ble_hs_unlock();
/* Receive a starting fragment on a different channel. The first fragment
@@ -365,7 +365,7 @@ TEST_CASE(ble_l2cap_test_case_frag_channels)
conn = ble_hs_conn_find(2);
TEST_ASSERT_FATAL(conn != NULL);
TEST_ASSERT(conn->bhc_rx_chan != NULL &&
- conn->bhc_rx_chan->blc_cid == BLE_L2CAP_CID_ATT);
+ conn->bhc_rx_chan->scid == BLE_L2CAP_CID_ATT);
ble_hs_unlock();
}