Zephyr Project API
3.3.0
A Scalable Open Source RTOS
|
Header for Bluetooth BAP. More...
Go to the source code of this file.
Data Structures | |
struct | bt_bap_scan_delegator_subgroup |
struct | bt_bap_scan_delegator_recv_state |
struct | bt_bap_scan_delegator_cb |
struct | bt_bap_broadcast_assistant_cb |
struct | bt_bap_broadcast_assistant_add_src_param |
struct | bt_bap_broadcast_assistant_mod_src_param |
Macros | |
#define | BT_BAP_SCAN_DELEGATOR_MAX_METADATA_LEN 0 |
#define | BT_BAP_SCAN_DELEGATOR_MAX_SUBGROUPS 0 |
#define | BT_BAP_BROADCAST_CODE_SIZE 16 |
#define | BT_BAP_PA_STATE_NOT_SYNCED 0x00 |
#define | BT_BAP_PA_STATE_INFO_REQ 0x01 |
#define | BT_BAP_PA_STATE_SYNCED 0x02 |
#define | BT_BAP_PA_STATE_FAILED 0x03 |
#define | BT_BAP_PA_STATE_NO_PAST 0x04 |
#define | BT_BAP_BIG_ENC_STATE_NO_ENC 0x00 |
#define | BT_BAP_BIG_ENC_STATE_BCODE_REQ 0x01 |
#define | BT_BAP_BIG_ENC_STATE_DEC 0x02 |
#define | BT_BAP_BIG_ENC_STATE_BAD_CODE 0x03 |
#define | BT_BAP_BASS_ERR_OPCODE_NOT_SUPPORTED 0x80 |
#define | BT_BAP_BASS_ERR_INVALID_SRC_ID 0x81 |
#define | BT_BAP_PA_INTERVAL_UNKNOWN 0xFFFF |
#define | BT_BAP_BROADCAST_MAX_ID 0xFFFFFF |
#define | BT_BAP_BIS_SYNC_NO_PREF 0xFFFFFFFF |
Typedefs | |
typedef void(* | bt_bap_broadcast_assistant_discover_cb) (struct bt_conn *conn, int err, uint8_t recv_state_count) |
Callback function for bt_bap_broadcast_assistant_discover. More... | |
typedef void(* | bt_bap_broadcast_assistant_scan_cb) (const struct bt_le_scan_recv_info *info, uint32_t broadcast_id) |
Callback function for Broadcast Audio Scan Service client scan results. More... | |
typedef void(* | bt_bap_broadcast_assistant_recv_state_cb) (struct bt_conn *conn, int err, const struct bt_bap_scan_delegator_recv_state *state) |
Callback function for when a receive state is read or updated. More... | |
typedef void(* | bt_bap_broadcast_assistant_recv_state_rem_cb) (struct bt_conn *conn, int err, uint8_t src_id) |
Callback function for when a receive state is removed. More... | |
typedef void(* | bt_bap_broadcast_assistant_write_cb) (struct bt_conn *conn, int err) |
Callback function for writes. More... | |
Functions | |
void | bt_bap_scan_delegator_register_cb (struct bt_bap_scan_delegator_cb *cb) |
Register the callbacks for the Basic Audio Profile Scan Delegator. More... | |
int | bt_bap_scan_delegator_set_sync_state (uint8_t src_id, uint8_t pa_sync_state, uint32_t bis_synced[0], uint8_t encrypted) |
Set the sync state of a receive state in the server. More... | |
int | bt_bap_broadcast_assistant_discover (struct bt_conn *conn) |
Discover Broadcast Audio Scan Service on the server. More... | |
int | bt_bap_broadcast_assistant_scan_start (struct bt_conn *conn, bool start_scan) |
Scan start for BISes for a remote server. More... | |
int | bt_bap_broadcast_assistant_scan_stop (struct bt_conn *conn) |
Stop remote scanning for BISes for a server. More... | |
void | bt_bap_broadcast_assistant_register_cb (struct bt_bap_broadcast_assistant_cb *cb) |
Registers the callbacks used by Broadcast Audio Scan Service client. More... | |
int | bt_bap_broadcast_assistant_add_src (struct bt_conn *conn, struct bt_bap_broadcast_assistant_add_src_param *param) |
Add a source on the server. More... | |
int | bt_bap_broadcast_assistant_mod_src (struct bt_conn *conn, struct bt_bap_broadcast_assistant_mod_src_param *param) |
Modify a source on the server. More... | |
int | bt_bap_broadcast_assistant_set_broadcast_code (struct bt_conn *conn, uint8_t src_id, uint8_t broadcast_code[16]) |
Set a broadcast code to the specified receive state. More... | |
int | bt_bap_broadcast_assistant_rem_src (struct bt_conn *conn, uint8_t src_id) |
Remove a source from the server. More... | |
int | bt_bap_broadcast_assistant_read_recv_state (struct bt_conn *conn, uint8_t idx) |
Read the specified receive state from the server. More... | |
Header for Bluetooth BAP.
Copyright (c) 2020 Bose Corporation Copyright (c) 2021-2022 Nordic Semiconductor ASA
SPDX-License-Identifier: Apache-2.0
#define BT_BAP_BASS_ERR_INVALID_SRC_ID 0x81 |
#define BT_BAP_BASS_ERR_OPCODE_NOT_SUPPORTED 0x80 |
#define BT_BAP_BIG_ENC_STATE_BAD_CODE 0x03 |
#define BT_BAP_BIG_ENC_STATE_BCODE_REQ 0x01 |
#define BT_BAP_BIG_ENC_STATE_DEC 0x02 |
#define BT_BAP_BIG_ENC_STATE_NO_ENC 0x00 |
#define BT_BAP_BIS_SYNC_NO_PREF 0xFFFFFFFF |
#define BT_BAP_BROADCAST_CODE_SIZE 16 |
#define BT_BAP_BROADCAST_MAX_ID 0xFFFFFF |
#define BT_BAP_PA_INTERVAL_UNKNOWN 0xFFFF |
#define BT_BAP_PA_STATE_FAILED 0x03 |
#define BT_BAP_PA_STATE_INFO_REQ 0x01 |
#define BT_BAP_PA_STATE_NO_PAST 0x04 |
#define BT_BAP_PA_STATE_NOT_SYNCED 0x00 |
#define BT_BAP_PA_STATE_SYNCED 0x02 |
#define BT_BAP_SCAN_DELEGATOR_MAX_METADATA_LEN 0 |
#define BT_BAP_SCAN_DELEGATOR_MAX_SUBGROUPS 0 |
typedef void(* bt_bap_broadcast_assistant_discover_cb) (struct bt_conn *conn, int err, uint8_t recv_state_count) |
Callback function for bt_bap_broadcast_assistant_discover.
conn | The connection that was used to discover Broadcast Audio Scan Service. |
err | Error value. 0 on success, GATT error or ERRNO on fail. |
recv_state_count | Number of receive states on the server. |
typedef void(* bt_bap_broadcast_assistant_recv_state_cb) (struct bt_conn *conn, int err, const struct bt_bap_scan_delegator_recv_state *state) |
Callback function for when a receive state is read or updated.
Called whenever a receive state is read or updated.
conn | The connection to the Broadcast Audio Scan Service server. |
err | Error value. 0 on success, GATT error on fail. |
state | The receive state. |
typedef void(* bt_bap_broadcast_assistant_recv_state_rem_cb) (struct bt_conn *conn, int err, uint8_t src_id) |
Callback function for when a receive state is removed.
conn | The connection to the Broadcast Audio Scan Service server. |
err | Error value. 0 on success, GATT error on fail. |
src_id | The receive state. |
typedef void(* bt_bap_broadcast_assistant_scan_cb) (const struct bt_le_scan_recv_info *info, uint32_t broadcast_id) |
Callback function for Broadcast Audio Scan Service client scan results.
Called when the scanner finds an advertiser that advertises the BT_UUID_BROADCAST_AUDIO UUID.
info | Advertiser information. |
broadcast_id | 24-bit broadcast ID. |
typedef void(* bt_bap_broadcast_assistant_write_cb) (struct bt_conn *conn, int err) |
Callback function for writes.
conn | The connection to the peer device. |
err | Error value. 0 on success, GATT error on fail. |
int bt_bap_broadcast_assistant_add_src | ( | struct bt_conn * | conn, |
struct bt_bap_broadcast_assistant_add_src_param * | param | ||
) |
Add a source on the server.
conn | Connection to the server. |
param | Parameter struct. |
int bt_bap_broadcast_assistant_discover | ( | struct bt_conn * | conn | ) |
Discover Broadcast Audio Scan Service on the server.
Warning: Only one connection can be active at any time; discovering for a new connection, will delete all previous data.
conn | The connection |
int bt_bap_broadcast_assistant_mod_src | ( | struct bt_conn * | conn, |
struct bt_bap_broadcast_assistant_mod_src_param * | param | ||
) |
Modify a source on the server.
conn | Connection to the server. |
param | Parameter struct. |
int bt_bap_broadcast_assistant_read_recv_state | ( | struct bt_conn * | conn, |
uint8_t | idx | ||
) |
Read the specified receive state from the server.
conn | Connection to the server. |
idx | The index of the receive start (0 up to the value from bt_bap_broadcast_assistant_discover_cb) |
void bt_bap_broadcast_assistant_register_cb | ( | struct bt_bap_broadcast_assistant_cb * | cb | ) |
Registers the callbacks used by Broadcast Audio Scan Service client.
int bt_bap_broadcast_assistant_rem_src | ( | struct bt_conn * | conn, |
uint8_t | src_id | ||
) |
Remove a source from the server.
conn | Connection to the server. |
src_id | Source ID of the receive state. |
int bt_bap_broadcast_assistant_scan_start | ( | struct bt_conn * | conn, |
bool | start_scan | ||
) |
Scan start for BISes for a remote server.
This will let the Broadcast Audio Scan Service server know that this device is actively scanning for broadcast sources. The function can optionally also start scanning, if the caller does not want to start scanning itself.
Scan results, if start_scan
is true, is sent to the bt_bap_broadcast_assistant_scan_cb callback.
conn | Connection to the Broadcast Audio Scan Service server. Used to let the server know that we are scanning. |
start_scan | Start scanning if true. If false, the application should enable scan itself. |
int bt_bap_broadcast_assistant_scan_stop | ( | struct bt_conn * | conn | ) |
Stop remote scanning for BISes for a server.
conn | Connection to the server. |
int bt_bap_broadcast_assistant_set_broadcast_code | ( | struct bt_conn * | conn, |
uint8_t | src_id, | ||
uint8_t | broadcast_code[16] | ||
) |
Set a broadcast code to the specified receive state.
conn | Connection to the server. |
src_id | Source ID of the receive state. |
broadcast_code | The broadcast code. |
void bt_bap_scan_delegator_register_cb | ( | struct bt_bap_scan_delegator_cb * | cb | ) |
Register the callbacks for the Basic Audio Profile Scan Delegator.
cb | Pointer to the callback struct |
int bt_bap_scan_delegator_set_sync_state | ( | uint8_t | src_id, |
uint8_t | pa_sync_state, | ||
uint32_t | bis_synced[0], | ||
uint8_t | encrypted | ||
) |
Set the sync state of a receive state in the server.
src_id | The source id used to identify the receive state. |
pa_sync_state | The sync state of the PA. |
bis_synced | Array of bitfields to set the BIS sync state for each subgroup. |
encrypted | The BIG encryption state. |