summaryrefslogtreecommitdiff
path: root/apps/bletest/src/bletest_hci.c
diff options
context:
space:
mode:
authorChristopher Collins <ccollins@apache.org>2016-08-23 17:35:28 -0700
committerChristopher Collins <ccollins@apache.org>2016-08-23 17:35:28 -0700
commit70987f7d2e3c791132509f08566fe77de34142ac (patch)
tree269ca9b857f65c22b8f2b93560466984f96091e5 /apps/bletest/src/bletest_hci.c
parent0d9c8f30efbe2dba00b21d9185e9db8e36cd579e (diff)
parent665e22f5722d6348c1b260192e27f69d855b58fd (diff)
Merge branch 'develop' - in preparation for
backwards-compatibility-breaking changes to develop. * develop: (290 commits) sim compiler - replace objsize with size Fix warnings reported by clang. MYNEWT-329 MYNEWT-354 STM32f407 discovery board BSP mbedtls; use smaller version of SHA256. boot; boot loader does not need to call os_init() anymore, as bsp_init() has been exported. boot; app does not need the dependency to mbedtls slinky; time-based waits must use OS_TICKS_PER_SEC. bootutil; adjust unit tests to work with status upkeep outside sys/config. bootutil; was returning wrong image header in response when swithing images. Add boot_set_req() routine for unit test use. boot/bootutil; remove debug console use from bootloader. bootutil/imgmgr; output of boot now shows the fallback image. imgmgr; automatically confirm image as good for now. bootutil; add 'confirm' step, telling that image was confirmed as good. Otherwise next restart we'll go back to old image. bootutil; make status element size depend on flash alignment restrictions. boot, imgmgr; return the slot number for test image. bootutil; move routines reading boot-copy-status from loader.c to bootutil_misc.c. boot; return full flash location of status bytes, instead of just offset. boot; don't use NFFS or FCB for keeping status. Interim commit. ...
Diffstat (limited to 'apps/bletest/src/bletest_hci.c')
-rwxr-xr-xapps/bletest/src/bletest_hci.c133
1 files changed, 66 insertions, 67 deletions
diff --git a/apps/bletest/src/bletest_hci.c b/apps/bletest/src/bletest_hci.c
index 9a692bd7..354b5685 100755
--- a/apps/bletest/src/bletest_hci.c
+++ b/apps/bletest/src/bletest_hci.c
@@ -24,9 +24,8 @@
/* BLE */
#include "nimble/ble.h"
-#include "nimble/hci_transport.h"
+#include "nimble/ble_hci_trans.h"
#include "nimble/hci_common.h"
-#include "host/host_hci.h"
#include "host/ble_hs.h"
#include "controller/ble_ll.h"
#include "controller/ble_ll_hci.h"
@@ -37,7 +36,6 @@
/* XXX: An app should not include private headers from a library. The bletest
* app uses some of nimble's internal details for logging.
*/
-#include "../src/ble_hci_util_priv.h"
#include "../src/ble_hs_priv.h"
#include "bletest_priv.h"
@@ -57,7 +55,7 @@ bletest_send_conn_update(uint16_t handle)
hcu.min_ce_len = 4;
hcu.max_ce_len = 4;
- rc = host_hci_cmd_le_conn_update(&hcu);
+ rc = ble_hs_hci_cmd_le_conn_update(&hcu);
assert(rc == 0);
}
@@ -65,7 +63,7 @@ bletest_send_conn_update(uint16_t handle)
void
bletest_ltk_req_reply(uint16_t handle)
{
- g_bletest_ltk_reply_handle = handle;
+ g_bletest_ltk_reply_handle |= (1 << (handle-1));
}
int
@@ -78,12 +76,12 @@ bletest_send_ltk_req_neg_reply(uint16_t handle)
uint8_t rsplen;
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_LT_KEY_REQ_NEG_REPLY,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_LT_KEY_REQ_NEG_REPLY,
sizeof(uint16_t), dst);
dst += BLE_HCI_CMD_HDR_LEN;
htole16(dst, handle);
- rc = ble_hci_cmd_tx(buf, &ack_conn_handle, 2, &rsplen);
+ rc = ble_hs_hci_cmd_tx(buf, &ack_conn_handle, 2, &rsplen);
if (rc == 0) {
if (rsplen != 2) {
rc = -1;
@@ -105,8 +103,8 @@ bletest_send_ltk_req_reply(uint16_t handle)
hkr.conn_handle = handle;
swap_buf(hkr.long_term_key, (uint8_t *)g_bletest_LTK, 16);
- host_hci_cmd_build_le_lt_key_req_reply(&hkr, buf, sizeof buf);
- rc = ble_hci_cmd_tx(buf, &ack_conn_handle, sizeof ack_conn_handle,
+ ble_hs_hci_cmd_build_le_lt_key_req_reply(&hkr, buf, sizeof buf);
+ rc = ble_hs_hci_cmd_tx(buf, &ack_conn_handle, sizeof ack_conn_handle,
&ack_params_len);
if (rc != 0) {
return rc;
@@ -128,8 +126,9 @@ bletest_hci_reset_ctlr(void)
{
uint8_t buf[BLE_HCI_CMD_HDR_LEN];
- host_hci_write_hdr(BLE_HCI_OGF_CTLR_BASEBAND, BLE_HCI_OCF_CB_RESET, 0, buf);
- return ble_hci_cmd_tx(buf, NULL, 0, NULL);
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_CTLR_BASEBAND, BLE_HCI_OCF_CB_RESET,
+ 0, buf);
+ return ble_hs_hci_cmd_tx(buf, NULL, 0, NULL);
}
int
@@ -140,9 +139,9 @@ bletest_hci_rd_bd_addr(void)
uint8_t rspbuf[BLE_DEV_ADDR_LEN];
uint8_t rsplen;
- host_hci_write_hdr(BLE_HCI_OGF_INFO_PARAMS, BLE_HCI_OCF_IP_RD_BD_ADDR, 0,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_INFO_PARAMS, BLE_HCI_OCF_IP_RD_BD_ADDR, 0,
buf);
- rc = ble_hci_cmd_tx(buf, rspbuf, BLE_DEV_ADDR_LEN, &rsplen);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, BLE_DEV_ADDR_LEN, &rsplen);
if (rc != 0) {
return rc;
}
@@ -165,13 +164,13 @@ bletest_hci_le_encrypt(uint8_t *key, uint8_t *pt)
uint8_t rsplen;
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_ENCRYPT,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_ENCRYPT,
BLE_HCI_LE_ENCRYPT_LEN, dst);
dst += BLE_HCI_CMD_HDR_LEN;
swap_buf(dst, key, BLE_ENC_BLOCK_SIZE);
swap_buf(dst + BLE_ENC_BLOCK_SIZE, pt, BLE_ENC_BLOCK_SIZE);
- rc = ble_hci_cmd_tx(buf, rspbuf, 16, &rsplen);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, 16, &rsplen);
if (rc != 0) {
return rc;
}
@@ -193,14 +192,14 @@ bletest_hci_le_set_datalen(uint16_t handle, uint16_t txoctets, uint16_t txtime)
uint8_t rsplen;
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_DATA_LEN,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_DATA_LEN,
BLE_HCI_SET_DATALEN_LEN, dst);
dst += BLE_HCI_CMD_HDR_LEN;
htole16(dst, handle);
htole16(dst + 2, txoctets);
htole16(dst + 4, txtime);
- rc = ble_hci_cmd_tx(buf, rspbuf, 2, &rsplen);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, 2, &rsplen);
if (rc != 0) {
return rc;
}
@@ -219,13 +218,13 @@ bletest_hci_le_write_sugg_datalen(uint16_t txoctets, uint16_t txtime)
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_WR_SUGG_DATALEN_LEN];
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_WR_SUGG_DEF_DATA_LEN,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_WR_SUGG_DEF_DATA_LEN,
BLE_HCI_WR_SUGG_DATALEN_LEN, dst);
dst += BLE_HCI_CMD_HDR_LEN;
htole16(dst, txoctets);
htole16(dst + 2, txtime);
- return ble_hci_cmd_tx(buf, NULL, 0, NULL);
+ return ble_hs_hci_cmd_tx(buf, NULL, 0, NULL);
}
int
@@ -236,10 +235,10 @@ bletest_hci_le_rd_sugg_datalen(void)
uint8_t rspbuf[BLE_HCI_RD_SUGG_DATALEN_RSPLEN];
uint8_t rsplen;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_SUGG_DEF_DATA_LEN, 0,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_SUGG_DEF_DATA_LEN, 0,
buf);
- rc = ble_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_SUGG_DATALEN_RSPLEN, &rsplen);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_SUGG_DATALEN_RSPLEN, &rsplen);
if (rc != 0) {
return rc;
}
@@ -259,9 +258,9 @@ bletest_hci_rd_local_version(void)
uint8_t rspbuf[BLE_HCI_RD_LOC_VER_INFO_RSPLEN];
uint8_t rsplen;
- host_hci_write_hdr(BLE_HCI_OGF_INFO_PARAMS, BLE_HCI_OCF_IP_RD_LOCAL_VER, 0,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_INFO_PARAMS, BLE_HCI_OCF_IP_RD_LOCAL_VER, 0,
buf);
- rc = ble_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_LOC_VER_INFO_RSPLEN, &rsplen);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_LOC_VER_INFO_RSPLEN, &rsplen);
if (rc != 0) {
return rc;
}
@@ -280,9 +279,9 @@ bletest_hci_rd_local_feat(void)
uint8_t rspbuf[BLE_HCI_RD_LOC_SUPP_FEAT_RSPLEN];
uint8_t rsplen;
- host_hci_write_hdr(BLE_HCI_OGF_INFO_PARAMS, BLE_HCI_OCF_IP_RD_LOC_SUPP_FEAT,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_INFO_PARAMS, BLE_HCI_OCF_IP_RD_LOC_SUPP_FEAT,
0, buf);
- rc = ble_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_LOC_SUPP_FEAT_RSPLEN, &rsplen);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_LOC_SUPP_FEAT_RSPLEN, &rsplen);
if (rc != 0) {
return rc;
}
@@ -301,9 +300,9 @@ bletest_hci_rd_local_supp_cmd(void)
uint8_t rspbuf[BLE_HCI_RD_LOC_SUPP_CMD_RSPLEN];
uint8_t rsplen;
- host_hci_write_hdr(BLE_HCI_OGF_INFO_PARAMS, BLE_HCI_OCF_IP_RD_LOC_SUPP_CMD,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_INFO_PARAMS, BLE_HCI_OCF_IP_RD_LOC_SUPP_CMD,
0, buf);
- rc = ble_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_LOC_SUPP_CMD_RSPLEN, &rsplen);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_LOC_SUPP_CMD_RSPLEN, &rsplen);
if (rc != 0) {
return rc;
}
@@ -330,8 +329,8 @@ bletest_hci_le_read_supp_states(void)
uint8_t rspbuf[BLE_HCI_RD_SUPP_STATES_RSPLEN];
uint8_t rsplen;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_SUPP_STATES, 0, buf);
- rc = ble_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_SUPP_STATES_RSPLEN, &rsplen);
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_SUPP_STATES, 0, buf);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_SUPP_STATES_RSPLEN, &rsplen);
if (rc != 0) {
return rc;
}
@@ -350,8 +349,8 @@ bletest_hci_le_rd_max_datalen(void)
uint8_t rspbuf[BLE_HCI_RD_MAX_DATALEN_RSPLEN];
uint8_t rsplen;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_MAX_DATA_LEN, 0, buf);
- rc = ble_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_MAX_DATALEN_RSPLEN, &rsplen);
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_MAX_DATA_LEN, 0, buf);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_MAX_DATALEN_RSPLEN, &rsplen);
if (rc != 0) {
return rc;
}
@@ -368,9 +367,9 @@ bletest_hci_le_set_adv_data(uint8_t *data, uint8_t len)
int rc;
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_ADV_DATA_LEN];
- rc = host_hci_cmd_build_le_set_adv_data(data, len, buf, sizeof buf);
+ rc = ble_hs_hci_cmd_build_le_set_adv_data(data, len, buf, sizeof buf);
assert(rc == 0);
- return ble_hci_cmd_tx_empty_ack(buf);
+ return ble_hs_hci_cmd_tx_empty_ack(buf);
}
#if (BLE_LL_CFG_FEAT_LE_ENCRYPTION == 1)
@@ -379,8 +378,8 @@ bletest_hci_le_start_encrypt(struct hci_start_encrypt *cmd)
{
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_LE_START_ENCRYPT_LEN];
- host_hci_cmd_build_le_start_encrypt(cmd, buf, sizeof buf);
- return ble_hci_cmd_tx_empty_ack(buf);
+ ble_hs_hci_cmd_build_le_start_encrypt(cmd, buf, sizeof buf);
+ return ble_hs_hci_cmd_tx_empty_ack(buf);
}
#endif
@@ -391,12 +390,12 @@ bletest_hci_le_read_rem_used_feat(uint16_t handle)
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_CONN_RD_REM_FEAT_LEN];
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_REM_FEAT,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_REM_FEAT,
BLE_HCI_CONN_RD_REM_FEAT_LEN, dst);
dst += BLE_HCI_CMD_HDR_LEN;
htole16(dst, handle);
- return ble_hci_cmd_tx(buf, NULL, 0, NULL);
+ return ble_hs_hci_cmd_tx(buf, NULL, 0, NULL);
}
int
@@ -405,9 +404,9 @@ bletest_hci_le_set_adv_params(struct hci_adv_params *adv)
int rc;
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_ADV_PARAM_LEN];
- rc = host_hci_cmd_build_le_set_adv_params(adv, buf, sizeof buf);
+ rc = ble_hs_hci_cmd_build_le_set_adv_params(adv, buf, sizeof buf);
if (!rc) {
- rc = ble_hci_cmd_tx_empty_ack(buf);
+ rc = ble_hs_hci_cmd_tx_empty_ack(buf);
}
return rc;
}
@@ -419,12 +418,12 @@ bletest_hci_le_set_rand_addr(uint8_t *addr)
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_DATALEN_LEN];
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_RAND_ADDR,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_RAND_ADDR,
BLE_DEV_ADDR_LEN, dst);
dst += BLE_HCI_CMD_HDR_LEN;
memcpy(dst, addr, BLE_DEV_ADDR_LEN);
- return ble_hci_cmd_tx(buf, NULL, 0, NULL);
+ return ble_hs_hci_cmd_tx(buf, NULL, 0, NULL);
}
int
@@ -434,12 +433,12 @@ bletest_hci_rd_rem_version(uint16_t handle)
uint8_t buf[BLE_HCI_CMD_HDR_LEN + sizeof(uint16_t)];
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LINK_CTRL, BLE_HCI_OCF_RD_REM_VER_INFO,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LINK_CTRL, BLE_HCI_OCF_RD_REM_VER_INFO,
sizeof(uint16_t), dst);
dst += BLE_HCI_CMD_HDR_LEN;
htole16(dst, handle);
- return ble_hci_cmd_tx(buf, NULL, 0, NULL);
+ return ble_hs_hci_cmd_tx(buf, NULL, 0, NULL);
}
int
@@ -449,12 +448,12 @@ bletest_hci_le_set_host_chan_class(uint8_t *chanmap)
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_HOST_CHAN_CLASS_LEN];
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_HOST_CHAN_CLASS,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_HOST_CHAN_CLASS,
BLE_HCI_SET_HOST_CHAN_CLASS_LEN, dst);
dst += BLE_HCI_CMD_HDR_LEN;
memcpy(dst, chanmap, BLE_HCI_SET_HOST_CHAN_CLASS_LEN);
- return ble_hci_cmd_tx(buf, NULL, 0, NULL);
+ return ble_hs_hci_cmd_tx(buf, NULL, 0, NULL);
}
int
@@ -467,12 +466,12 @@ bletest_hci_le_rd_chanmap(uint16_t handle)
uint8_t rsplen;
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_CHAN_MAP,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_CHAN_MAP,
BLE_HCI_RD_CHANMAP_LEN, dst);
dst += BLE_HCI_CMD_HDR_LEN;
htole16(dst, handle);
- rc = ble_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_CHANMAP_RSP_LEN, &rsplen);
+ rc = ble_hs_hci_cmd_tx(buf, rspbuf, BLE_HCI_RD_CHANMAP_RSP_LEN, &rsplen);
if (rc != 0) {
return rc;
}
@@ -491,12 +490,12 @@ bletest_hci_le_set_adv_enable(uint8_t enable)
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_ADV_ENABLE_LEN];
dst = buf;
- host_hci_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_ADV_ENABLE,
+ ble_hs_hci_cmd_write_hdr(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_SET_ADV_ENABLE,
BLE_HCI_SET_ADV_ENABLE_LEN, dst);
dst += BLE_HCI_CMD_HDR_LEN;
dst[0] = enable;
- return ble_hci_cmd_tx(buf, NULL, 0, NULL);
+ return ble_hs_hci_cmd_tx(buf, NULL, 0, NULL);
}
int
@@ -504,8 +503,8 @@ bletest_hci_le_set_event_mask(uint64_t event_mask)
{
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_LE_EVENT_MASK_LEN];
- host_hci_cmd_build_le_set_event_mask(event_mask, buf, sizeof buf);
- return ble_hci_cmd_tx_empty_ack(buf);
+ ble_hs_hci_cmd_build_le_set_event_mask(event_mask, buf, sizeof buf);
+ return ble_hs_hci_cmd_tx_empty_ack(buf);
}
int
@@ -513,8 +512,8 @@ bletest_hci_set_event_mask(uint64_t event_mask)
{
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_EVENT_MASK_LEN];
- host_hci_cmd_build_set_event_mask(event_mask, buf, sizeof buf);
- return ble_hci_cmd_tx_empty_ack(buf);
+ ble_hs_hci_cmd_build_set_event_mask(event_mask, buf, sizeof buf);
+ return ble_hs_hci_cmd_tx_empty_ack(buf);
}
int
@@ -523,9 +522,9 @@ bletest_hci_le_set_scan_rsp_data(uint8_t *data, uint8_t len)
int rc;
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_SCAN_RSP_DATA_LEN];
- rc = host_hci_cmd_build_le_set_scan_rsp_data(data, len, buf, sizeof buf);
+ rc = ble_hs_hci_cmd_build_le_set_scan_rsp_data(data, len, buf, sizeof buf);
assert(rc == 0);
- return ble_hci_cmd_tx_empty_ack(buf);
+ return ble_hs_hci_cmd_tx_empty_ack(buf);
}
int
@@ -535,11 +534,11 @@ bletest_hci_cmd_le_set_scan_params(uint8_t scan_type, uint16_t scan_itvl,
int rc;
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_SCAN_PARAM_LEN];
- rc = host_hci_cmd_build_le_set_scan_params(scan_type, scan_itvl,
+ rc = ble_hs_hci_cmd_build_le_set_scan_params(scan_type, scan_itvl,
scan_window, own_addr_type,
filter_policy, buf, sizeof buf);
if (!rc) {
- rc = ble_hci_cmd_tx_empty_ack(buf);
+ rc = ble_hs_hci_cmd_tx_empty_ack(buf);
}
return rc;
}
@@ -550,10 +549,10 @@ bletest_hci_le_add_to_whitelist(uint8_t *addr, uint8_t addr_type)
int rc;
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_SCAN_PARAM_LEN];
- rc = host_hci_cmd_build_le_add_to_whitelist(addr, addr_type, buf,
+ rc = ble_hs_hci_cmd_build_le_add_to_whitelist(addr, addr_type, buf,
sizeof buf);
if (!rc) {
- rc = ble_hci_cmd_tx_empty_ack(buf);
+ rc = ble_hs_hci_cmd_tx_empty_ack(buf);
}
return rc;
}
@@ -563,8 +562,8 @@ bletest_hci_le_set_scan_enable(uint8_t enable, uint8_t filter_dups)
{
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_SCAN_ENABLE_LEN];
- host_hci_cmd_build_le_set_scan_enable(enable, filter_dups, buf, sizeof buf);
- return ble_hci_cmd_tx_empty_ack(buf);
+ ble_hs_hci_cmd_build_le_set_scan_enable(enable, filter_dups, buf, sizeof buf);
+ return ble_hs_hci_cmd_tx_empty_ack(buf);
}
int
@@ -573,9 +572,9 @@ bletest_hci_le_create_connection(struct hci_create_conn *hcc)
int rc;
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_CREATE_CONN_LEN];
- rc = host_hci_cmd_build_le_create_connection(hcc, buf, sizeof buf);
+ rc = ble_hs_hci_cmd_build_le_create_connection(hcc, buf, sizeof buf);
if (!rc) {
- rc = ble_hci_cmd_tx_empty_ack(buf);
+ rc = ble_hs_hci_cmd_tx_empty_ack(buf);
}
return rc;
}
@@ -592,9 +591,9 @@ bletest_hci_le_add_resolv_list(uint8_t *local_irk, uint8_t *peer_irk,
memcpy(padd.addr, peer_ident_addr, BLE_DEV_ADDR_LEN);
swap_buf(padd.local_irk, local_irk, 16);
swap_buf(padd.peer_irk, peer_irk, 16);
- rc = host_hci_cmd_build_add_to_resolv_list(&padd, buf, sizeof buf);
+ rc = ble_hs_hci_cmd_build_add_to_resolv_list(&padd, buf, sizeof buf);
if (!rc) {
- rc = ble_hci_cmd_tx_empty_ack(buf);
+ rc = ble_hs_hci_cmd_tx_empty_ack(buf);
}
return rc;
}
@@ -606,9 +605,9 @@ bletest_hci_le_enable_resolv_list(uint8_t enable)
uint8_t buf[BLE_HCI_CMD_HDR_LEN + BLE_HCI_SET_ADDR_RESOL_ENA_LEN];
- rc = host_hci_cmd_build_set_addr_res_en(enable, buf, sizeof buf);
+ rc = ble_hs_hci_cmd_build_set_addr_res_en(enable, buf, sizeof buf);
if (!rc) {
- rc = ble_hci_cmd_tx_empty_ack(buf);
+ rc = ble_hs_hci_cmd_tx_empty_ack(buf);
}
return rc;
}