File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ /* Copyright (c) 2024 Nordic Semiconductor ASA
2+ * SPDX-License-Identifier: Apache-2.0
3+ */
4+
5+ /** @brief Internal testing interfaces for Bluetooth
6+ * @file
7+ * @internal
8+ *
9+ * The interfaces in this file are internal and not stable.
10+ */
11+
12+ #ifndef ZEPHYR_INCLUDE_BLUETOOTH_TESTING_H_
13+ #define ZEPHYR_INCLUDE_BLUETOOTH_TESTING_H_
14+
15+ #include <zephyr/net_buf.h>
16+
17+ /** @brief Hook for `acl_in_pool.destroy`
18+ *
19+ * Weak-function interface. The user can simply define this
20+ * function, and it will automatically become the event
21+ * listener.
22+ *
23+ * @kconfig_dep{CONFIG_BT_TESTING}
24+ */
25+ void bt_testing_trace_event_acl_pool_destroy (struct net_buf * buf );
26+
27+ #endif /* ZEPHYR_INCLUDE_BLUETOOTH_TESTING_H_ */
Original file line number Diff line number Diff line change 1414#include <zephyr/net_buf.h>
1515#include <zephyr/sys/atomic.h>
1616#include <zephyr/sys/check.h>
17+ #include <zephyr/sys/util_macro.h>
1718#include <zephyr/sys/util.h>
1819#include <zephyr/sys/slist.h>
1920#include <zephyr/sys/byteorder.h>
2829#include <zephyr/bluetooth/l2cap.h>
2930#include <zephyr/bluetooth/hci.h>
3031#include <zephyr/bluetooth/hci_vs.h>
32+ #include <zephyr/bluetooth/testing.h>
3133#if DT_HAS_CHOSEN (zephyr_bt_hci )
3234#include <zephyr/drivers/bluetooth.h>
3335#else
@@ -263,13 +265,23 @@ void bt_send_one_host_num_completed_packets(uint16_t handle)
263265 BT_ASSERT_MSG (err == 0 , "Unable to send Host NCP (err %d)" , err );
264266}
265267
268+ #if defined(CONFIG_BT_TESTING )
269+ __weak void bt_testing_trace_event_acl_pool_destroy (struct net_buf * buf )
270+ {
271+ }
272+ #endif
273+
266274#if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL )
267275void bt_hci_host_num_completed_packets (struct net_buf * buf )
268276{
269277 uint16_t handle = acl (buf )-> handle ;
270278 struct bt_conn * conn ;
271279 uint8_t index = acl (buf )-> index ;
272280
281+ if (IS_ENABLED (CONFIG_BT_TESTING )) {
282+ bt_testing_trace_event_acl_pool_destroy (buf );
283+ }
284+
273285 net_buf_destroy (buf );
274286
275287 if (acl (buf )-> host_ncp_sent ) {
You can’t perform that action at this time.
0 commit comments