mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-27 20:30:03 +00:00
nimble/test: Update for new transport
This commit is contained in:
@@ -23,4 +23,3 @@ syscfg.vals:
|
||||
MCU_TIMER_POLLER_PRIO: 1
|
||||
MCU_UART_POLLER_PRIO: 2
|
||||
NATIVE_SOCKETS_PRIO: 3
|
||||
BLE_HCI_TRANSPORT: ram
|
||||
|
||||
@@ -32,3 +32,6 @@ pkg.deps.SELFTEST:
|
||||
- "@apache-mynewt-core/sys/log/full"
|
||||
- "@apache-mynewt-core/sys/stats/stub"
|
||||
- nimble/transport
|
||||
|
||||
pkg.apis:
|
||||
- ble_driver
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include "nimble/hci_common.h"
|
||||
#include "nimble/ble_hci_trans.h"
|
||||
#include "nimble/transport.h"
|
||||
#include "ble_hs_test.h"
|
||||
#include "testutil/testutil.h"
|
||||
#include "ble_hs_test_util.h"
|
||||
@@ -34,7 +34,7 @@ TEST_CASE_SELF(ble_hs_hci_test_event_bad)
|
||||
int rc;
|
||||
|
||||
/*** Invalid event code. */
|
||||
buf = ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_EVT_HI);
|
||||
buf = ble_transport_alloc_evt(0);
|
||||
TEST_ASSERT_FATAL(buf != NULL);
|
||||
|
||||
buf[0] = 0xff;
|
||||
|
||||
@@ -24,11 +24,9 @@
|
||||
#include "testutil/testutil.h"
|
||||
#include "nimble/ble.h"
|
||||
#include "nimble/hci_common.h"
|
||||
#include "nimble/ble_hci_trans.h"
|
||||
#include "host/ble_hs_adv.h"
|
||||
#include "host/ble_hs_id.h"
|
||||
#include "store/config/ble_store_config.h"
|
||||
#include "transport/ram/ble_hci_ram.h"
|
||||
#include "ble_hs_test_util.h"
|
||||
|
||||
/* Our global device address. */
|
||||
@@ -1850,18 +1848,18 @@ ble_hs_test_util_assert_mbufs_freed(
|
||||
TEST_ASSERT(count == ble_hs_test_util_num_mbufs());
|
||||
}
|
||||
|
||||
static int
|
||||
ble_hs_test_util_pkt_txed(struct os_mbuf *om, void *arg)
|
||||
int
|
||||
ble_transport_to_ll_acl(struct os_mbuf *om)
|
||||
{
|
||||
ble_hs_test_util_prev_tx_enqueue(om);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ble_hs_test_util_hci_txed(uint8_t *cmdbuf, void *arg)
|
||||
int
|
||||
ble_transport_to_ll_cmd(void *buf)
|
||||
{
|
||||
ble_hs_test_util_hci_out_enqueue(cmdbuf);
|
||||
ble_hci_trans_buf_free(cmdbuf);
|
||||
ble_hs_test_util_hci_out_enqueue(buf);
|
||||
ble_transport_free(buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2003,9 +2001,6 @@ ble_hs_test_util_init_no_sysinit_no_start(void)
|
||||
|
||||
ble_hs_hci_set_phony_ack_cb(NULL);
|
||||
|
||||
ble_hci_trans_cfg_ll(ble_hs_test_util_hci_txed, NULL,
|
||||
ble_hs_test_util_pkt_txed, NULL);
|
||||
|
||||
ble_hs_test_util_hci_ack_set_startup();
|
||||
|
||||
ble_hs_enabled_state = BLE_HS_ENABLED_STATE_OFF;
|
||||
@@ -2046,3 +2041,9 @@ ble_hs_test_util_init(void)
|
||||
/* Clear random address. */
|
||||
ble_hs_id_rnd_reset();
|
||||
}
|
||||
|
||||
void
|
||||
ble_transport_ll_init(void)
|
||||
{
|
||||
/* nothing here */
|
||||
}
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "testutil/testutil.h"
|
||||
#include "nimble/ble.h"
|
||||
#include "nimble/hci_common.h"
|
||||
#include "transport/ram/ble_hci_ram.h"
|
||||
#include "ble_hs_test_util.h"
|
||||
|
||||
#define BLE_HCI_EVENT_CMD_COMPLETE_HDR_LEN (5)
|
||||
@@ -522,14 +521,13 @@ ble_hs_test_util_hci_rx_evt(uint8_t *evt)
|
||||
totlen = BLE_HCI_EVENT_HDR_LEN + evt[1];
|
||||
TEST_ASSERT_FATAL(totlen <= UINT8_MAX + BLE_HCI_EVENT_HDR_LEN);
|
||||
|
||||
evbuf = ble_hci_trans_buf_alloc(
|
||||
BLE_HCI_TRANS_BUF_EVT_LO);
|
||||
evbuf = ble_transport_alloc_evt(1);
|
||||
TEST_ASSERT_FATAL(evbuf != NULL);
|
||||
|
||||
memcpy(evbuf, evt, totlen);
|
||||
|
||||
if (os_started()) {
|
||||
rc = ble_hci_trans_ll_evt_tx(evbuf);
|
||||
rc = ble_transport_to_hs_evt(evbuf);
|
||||
} else {
|
||||
rc = ble_hs_hci_evt_process((void *)evbuf);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "os/os.h"
|
||||
#include "testutil/testutil.h"
|
||||
#include "nimble/hci_common.h"
|
||||
#include "nimble/ble_hci_trans.h"
|
||||
#include "ble_hs_test.h"
|
||||
#include "host/ble_gap.h"
|
||||
#include "ble_hs_test_util.h"
|
||||
|
||||
@@ -29,4 +29,4 @@ syscfg.vals:
|
||||
CONFIG_FCB: 1
|
||||
BLE_VERSION: 52
|
||||
BLE_L2CAP_ENHANCED_COC: 1
|
||||
BLE_HCI_TRANSPORT: ram
|
||||
BLE_TRANSPORT_LL: custom
|
||||
|
||||
Reference in New Issue
Block a user