10#include <zephyr/bluetooth/bluetooth.h>
11#include <zephyr/bluetooth/conn.h>
12#include <zephyr/bluetooth/audio/audio.h>
14#define LE_AUDIO_EXTENDED_ADV_NAME \
15 BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME, \
16 CONFIG_BLE_ACL_EXT_ADV_INT_MIN, CONFIG_BLE_ACL_EXT_ADV_INT_MAX, NULL)
18#define LE_AUDIO_EXTENDED_ADV_CONN_NAME \
19 BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_CONNECTABLE | \
20 BT_LE_ADV_OPT_USE_NAME, \
21 CONFIG_BLE_ACL_EXT_ADV_INT_MIN, CONFIG_BLE_ACL_EXT_ADV_INT_MAX, NULL)
23#define LE_AUDIO_EXTENDED_ADV_CONN_NAME_FILTER \
24 BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_CONNECTABLE | \
25 BT_LE_ADV_OPT_USE_NAME | BT_LE_ADV_OPT_FILTER_CONN, \
26 CONFIG_BLE_ACL_EXT_ADV_INT_MIN, CONFIG_BLE_ACL_EXT_ADV_INT_MAX, NULL)
28#define LE_AUDIO_PERIODIC_ADV \
29 BT_LE_PER_ADV_PARAM(CONFIG_BLE_ACL_PER_ADV_INT_MIN, CONFIG_BLE_ACL_PER_ADV_INT_MAX, \
30 BT_LE_PER_ADV_OPT_NONE)
32#define BT_LE_ADV_FAST_CONN \
33 BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, BT_GAP_ADV_FAST_INT_MIN_1, \
34 BT_GAP_ADV_FAST_INT_MAX_1, NULL)
39#define BLE_SEARCH_NAME_MAX_LEN 33
41#if (CONFIG_SCAN_MODE_ACTIVE)
42#define NRF5340_AUDIO_GATEWAY_SCAN_TYPE BT_LE_SCAN_TYPE_ACTIVE
43#define NRF5340_AUDIO_GATEWAY_SCAN_PARAMS BT_LE_SCAN_ACTIVE
44#elif (CONFIG_SCAN_MODE_PASSIVE)
45#define NRF5340_AUDIO_GATEWAY_SCAN_TYPE BT_LE_SCAN_TYPE_PASSIVE
46#define NRF5340_AUDIO_GATEWAY_SCAN_PARAMS BT_LE_SCAN_PASSIVE
48#error "Select either CONFIG_SCAN_MODE_ACTIVE or CONFIG_SCAN_MODE_PASSIVE"
56#define BRDCAST_ID_NOT_USED (BT_AUDIO_BROADCAST_ID_MAX + 1)
87 size_t data_len, uint8_t type,
void *data);
113 char const *
const name, uint32_t brdcast_id);
160 const struct bt_data *per_adv,
size_t per_adv_size,
bool connectable);
int bt_mgmt_pa_sync_delete(struct bt_le_per_adv_sync *pa_sync)
Delete a periodic advertisement sync.
int bt_mgmt_conn_disconnect(struct bt_conn *conn, uint8_t reason)
Disconnect from a remote device or cancel the pending connection.
int bt_mgmt_scan_start(uint16_t scan_intvl, uint16_t scan_win, enum bt_mgmt_scan_type type, char const *const name, uint32_t brdcast_id)
Start scanning for advertisements.
void bt_mgmt_broadcast_code_ptr_get(uint8_t **broadcast_code_ptr)
Get the pointer to broadcast code.
void bt_mgmt_set_size_filled_get(uint8_t *num_filled)
Get the numbers of connected members of a given 'Set Identity Resolving Key' (SIRK)....
int bt_mgmt_manufacturer_uuid_populate(struct net_buf_simple *uuid_buf, uint16_t company_id)
Add manufacturer ID UUID to the advertisement packet.
int bt_mgmt_per_adv_stop(uint8_t ext_adv_index)
Stop periodic advertising.
void bt_mgmt_scan_sirk_set(uint8_t const *const sirk)
Set 'Set Identity Resolving Key' (SIRK). Used for searching for other member of the same set.
void bt_mgmt_num_conn_get(uint8_t *num_conn)
Get the number of active connections.
bt_mgmt_scan_type
Definition bt_mgmt.h:51
@ BT_MGMT_SCAN_TYPE_BROADCAST
Definition bt_mgmt.h:53
@ BT_MGMT_SCAN_TYPE_CONN
Definition bt_mgmt.h:52
int bt_mgmt_init(void)
Initialize the Bluetooth management module.
int bt_mgmt_ext_adv_stop(uint8_t ext_adv_index)
Stop extended advertising.
int bt_mgmt_adv_start(uint8_t ext_adv_index, const struct bt_data *ext_adv, size_t ext_adv_size, const struct bt_data *per_adv, size_t per_adv_size, bool connectable)
Create and start advertising for an ACL connection.
void bt_mgmt_scan_delegator_init(void)
Scan delegator feature initialization.
int bt_mgmt_bonding_clear(void)
Clear all bonded devices.
int bt_mgmt_adv_buffer_put(struct bt_data *const adv_buf, uint32_t *index, size_t adv_buf_vacant, size_t data_len, uint8_t type, void *data)
Load advertising data into an advertising buffer.