Zephyr Project API
3.2.0
A Scalable Open Source RTOS
|
Header for Bluetooth BASS. More...
Go to the source code of this file.
Data Structures | |
struct | bt_bass_subgroup |
struct | bt_bass_recv_state |
struct | bt_bass_cb |
struct | bt_bass_client_cb |
struct | bt_bass_add_src_param |
struct | bt_bass_mod_src_param |
Macros | |
#define | BT_BASS_MAX_METADATA_LEN 0 |
#define | BT_BASS_MAX_SUBGROUPS 0 |
#define | BT_BASS_BROADCAST_CODE_SIZE 16 |
#define | BT_BASS_PA_STATE_NOT_SYNCED 0x00 |
#define | BT_BASS_PA_STATE_INFO_REQ 0x01 |
#define | BT_BASS_PA_STATE_SYNCED 0x02 |
#define | BT_BASS_PA_STATE_FAILED 0x03 |
#define | BT_BASS_PA_STATE_NO_PAST 0x04 |
#define | BT_BASS_BIG_ENC_STATE_NO_ENC 0x00 |
#define | BT_BASS_BIG_ENC_STATE_BCODE_REQ 0x01 |
#define | BT_BASS_BIG_ENC_STATE_DEC 0x02 |
#define | BT_BASS_BIG_ENC_STATE_BAD_CODE 0x03 |
#define | BT_BASS_ERR_OPCODE_NOT_SUPPORTED 0x80 |
#define | BT_BASS_ERR_INVALID_SRC_ID 0x81 |
#define | BT_BASS_PA_INTERVAL_UNKNOWN 0xFFFF |
#define | BT_BASS_BROADCAST_MAX_ID 0xFFFFFF |
#define | BT_BASS_BIS_SYNC_NO_PREF 0xFFFFFFFF |
Typedefs | |
typedef void(* | bt_bass_client_discover_cb) (struct bt_conn *conn, int err, uint8_t recv_state_count) |
Callback function for bt_bass_client_discover. More... | |
typedef void(* | bt_bass_client_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_bass_client_recv_state_cb) (struct bt_conn *conn, int err, const struct bt_bass_recv_state *state) |
Callback function for when a receive state is read or updated. More... | |
typedef void(* | bt_bass_client_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_bass_client_write_cb) (struct bt_conn *conn, int err) |
Callback function for writes. More... | |
Functions | |
void | bt_bass_register_cb (struct bt_bass_cb *cb) |
Registers the callbacks used by BASS. More... | |
int | bt_bass_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_bass_client_discover (struct bt_conn *conn) |
Discover Broadcast Audio Scan Service on the server. More... | |
int | bt_bass_client_scan_start (struct bt_conn *conn, bool start_scan) |
Scan start for BISes for a remote server. More... | |
int | bt_bass_client_scan_stop (struct bt_conn *conn) |
Stop remote scanning for BISes for a server. More... | |
void | bt_bass_client_register_cb (struct bt_bass_client_cb *cb) |
Registers the callbacks used by Broadcast Audio Scan Service client. More... | |
int | bt_bass_client_add_src (struct bt_conn *conn, struct bt_bass_add_src_param *param) |
Add a source on the server. More... | |
int | bt_bass_client_mod_src (struct bt_conn *conn, struct bt_bass_mod_src_param *param) |
Modify a source on the server. More... | |
int | bt_bass_client_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_bass_client_rem_src (struct bt_conn *conn, uint8_t src_id) |
Remove a source from the server. More... | |
int | bt_bass_client_read_recv_state (struct bt_conn *conn, uint8_t idx) |
Read the specified receive state from the server. More... | |
Header for Bluetooth BASS.
Copyright (c) 2020 Bose Corporation Copyright (c) 2021 Nordic Semiconductor ASA
SPDX-License-Identifier: Apache-2.0
#define BT_BASS_BIG_ENC_STATE_BAD_CODE 0x03 |
#define BT_BASS_BIG_ENC_STATE_BCODE_REQ 0x01 |
#define BT_BASS_BIG_ENC_STATE_DEC 0x02 |
#define BT_BASS_BIG_ENC_STATE_NO_ENC 0x00 |
#define BT_BASS_BIS_SYNC_NO_PREF 0xFFFFFFFF |
#define BT_BASS_BROADCAST_CODE_SIZE 16 |
#define BT_BASS_BROADCAST_MAX_ID 0xFFFFFF |
#define BT_BASS_ERR_INVALID_SRC_ID 0x81 |
#define BT_BASS_ERR_OPCODE_NOT_SUPPORTED 0x80 |
#define BT_BASS_MAX_METADATA_LEN 0 |
#define BT_BASS_MAX_SUBGROUPS 0 |
#define BT_BASS_PA_INTERVAL_UNKNOWN 0xFFFF |
#define BT_BASS_PA_STATE_FAILED 0x03 |
#define BT_BASS_PA_STATE_INFO_REQ 0x01 |
#define BT_BASS_PA_STATE_NO_PAST 0x04 |
#define BT_BASS_PA_STATE_NOT_SYNCED 0x00 |
#define BT_BASS_PA_STATE_SYNCED 0x02 |
typedef void(* bt_bass_client_discover_cb) (struct bt_conn *conn, int err, uint8_t recv_state_count) |
Callback function for bt_bass_client_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_bass_client_recv_state_cb) (struct bt_conn *conn, int err, const struct bt_bass_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_bass_client_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_bass_client_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_bass_client_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_bass_client_add_src | ( | struct bt_conn * | conn, |
struct bt_bass_add_src_param * | param | ||
) |
Add a source on the server.
conn | Connection to the server. |
param | Parameter struct. |
int bt_bass_client_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_bass_client_mod_src | ( | struct bt_conn * | conn, |
struct bt_bass_mod_src_param * | param | ||
) |
Modify a source on the server.
conn | Connection to the server. |
param | Parameter struct. |
int bt_bass_client_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_bass_client_discover_cb) |
void bt_bass_client_register_cb | ( | struct bt_bass_client_cb * | cb | ) |
Registers the callbacks used by Broadcast Audio Scan Service client.
int bt_bass_client_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_bass_client_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_bass_client_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_bass_client_scan_stop | ( | struct bt_conn * | conn | ) |
Stop remote scanning for BISes for a server.
conn | Connection to the server. |
int bt_bass_client_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_bass_register_cb | ( | struct bt_bass_cb * | cb | ) |
Registers the callbacks used by BASS.
int bt_bass_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. |