Zephyr API 3.6.99
|
Coordinated Set Identification Profile (CSIP) More...
Data Structures | |
struct | bt_csip_set_member_cb |
Callback structure for the Coordinated Set Identification Service. More... | |
struct | bt_csip_set_member_register_param |
Register structure for Coordinated Set Identification Service. More... | |
struct | bt_csip_set_coordinator_set_info |
Information about a specific set. More... | |
struct | bt_csip_set_coordinator_csis_inst |
Struct representing a coordinated set instance on a remote device. More... | |
struct | bt_csip_set_coordinator_set_member |
Struct representing a remote device as a set member. More... | |
struct | bt_csip_set_coordinator_cb |
Struct to hold the Coordinated Set Identification Profile Set Coordinator callbacks. More... | |
struct | bt_pacs_cap |
Published Audio Capability structure. More... | |
Macros | |
#define | BT_CSIP_SET_COORDINATOR_DISCOVER_TIMER_VALUE K_SECONDS(10) |
Recommended timer for member discovery. | |
#define | BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES 0 |
Defines the maximum number of Coordinated Set Identification service instances for the Coordinated Set Identification Set Coordinator. | |
#define | BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT 0x00 |
Accept the request to read the SIRK as plaintext. | |
#define | BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT_ENC 0x01 |
Accept the request to read the SIRK, but return encrypted SIRK. | |
#define | BT_CSIP_READ_SIRK_REQ_RSP_REJECT 0x02 |
Reject the request to read the SIRK. | |
#define | BT_CSIP_READ_SIRK_REQ_RSP_OOB_ONLY 0x03 |
SIRK is available only via an OOB procedure. | |
#define | BT_CSIP_SIRK_SIZE 16 |
Size of the Set Identification Resolving Key (SIRK) | |
#define | BT_CSIP_RSI_SIZE 6 |
Size of the Resolvable Set Identifier (RSI) | |
#define | BT_CSIP_ERROR_LOCK_DENIED 0x80 |
Service is already locked. | |
#define | BT_CSIP_ERROR_LOCK_RELEASE_DENIED 0x81 |
Service is not locked. | |
#define | BT_CSIP_ERROR_LOCK_INVAL_VALUE 0x82 |
Invalid lock value. | |
#define | BT_CSIP_ERROR_SIRK_OOB_ONLY 0x83 |
SIRK only available out-of-band. | |
#define | BT_CSIP_ERROR_LOCK_ALREADY_GRANTED 0x84 |
Client is already owner of the lock. | |
#define | BT_CSIP_DATA_RSI(_rsi) |
Helper to declare bt_data array including RSI. | |
Typedefs | |
typedef void(* | bt_csip_set_coordinator_discover_cb) (struct bt_conn *conn, const struct bt_csip_set_coordinator_set_member *member, int err, size_t set_count) |
Callback for discovering Coordinated Set Identification Services. | |
typedef void(* | bt_csip_set_coordinator_lock_set_cb) (int err) |
Callback for locking a set across one or more devices. | |
typedef void(* | bt_csip_set_coordinator_lock_changed_cb) (struct bt_csip_set_coordinator_csis_inst *inst, bool locked) |
Callback when the lock value on a set of a connected device changes. | |
typedef void(* | bt_csip_set_coordinator_sirk_changed_cb) (struct bt_csip_set_coordinator_csis_inst *inst) |
Callback when the SIRK value of a set of a connected device changes. | |
typedef void(* | bt_csip_set_coordinator_ordered_access_cb_t) (const struct bt_csip_set_coordinator_set_info *set_info, int err, bool locked, struct bt_csip_set_coordinator_set_member *member) |
Callback for bt_csip_set_coordinator_ordered_access() | |
typedef bool(* | bt_csip_set_coordinator_ordered_access_t) (const struct bt_csip_set_coordinator_set_info *set_info, struct bt_csip_set_coordinator_set_member *members[], size_t count) |
Callback function definition for bt_csip_set_coordinator_ordered_access() | |
typedef bool(* | bt_pacs_cap_foreach_func_t) (const struct bt_pacs_cap *cap, void *user_data) |
Published Audio Capability iterator callback. | |
Functions | |
void * | bt_csip_set_member_svc_decl_get (const struct bt_csip_set_member_svc_inst *svc_inst) |
Get the service declaration attribute. | |
int | bt_csip_set_member_register (const struct bt_csip_set_member_register_param *param, struct bt_csip_set_member_svc_inst **svc_inst) |
Register a Coordinated Set Identification Service instance. | |
int | bt_csip_set_member_unregister (struct bt_csip_set_member_svc_inst *svc_inst) |
Unregister a Coordinated Set Identification Service instance. | |
int | bt_csip_set_member_sirk (struct bt_csip_set_member_svc_inst *svc_inst, const uint8_t sirk[16]) |
Set the SIRK of a service instance. | |
int | bt_csip_set_member_get_sirk (struct bt_csip_set_member_svc_inst *svc_inst, uint8_t sirk[16]) |
Get the SIRK of a service instance. | |
int | bt_csip_set_member_generate_rsi (const struct bt_csip_set_member_svc_inst *svc_inst, uint8_t rsi[6]) |
Generate the Resolvable Set Identifier (RSI) value. | |
int | bt_csip_set_member_lock (struct bt_csip_set_member_svc_inst *svc_inst, bool lock, bool force) |
Locks a specific Coordinated Set Identification Service instance on the server. | |
int | bt_csip_set_coordinator_discover (struct bt_conn *conn) |
Initialise the csip_set_coordinator instance for a connection. | |
struct bt_csip_set_coordinator_set_member * | bt_csip_set_coordinator_set_member_by_conn (const struct bt_conn *conn) |
Get the set member from a connection pointer. | |
bool | bt_csip_set_coordinator_is_set_member (const uint8_t sirk[16], struct bt_data *data) |
Check if advertising data indicates a set member. | |
int | bt_csip_set_coordinator_register_cb (struct bt_csip_set_coordinator_cb *cb) |
Registers callbacks for csip_set_coordinator. | |
int | bt_csip_set_coordinator_ordered_access (const struct bt_csip_set_coordinator_set_member *members[], uint8_t count, const struct bt_csip_set_coordinator_set_info *set_info, bt_csip_set_coordinator_ordered_access_t cb) |
Access Coordinated Set devices in an ordered manner as a client. | |
int | bt_csip_set_coordinator_lock (const struct bt_csip_set_coordinator_set_member **members, uint8_t count, const struct bt_csip_set_coordinator_set_info *set_info) |
Lock an array of set members. | |
int | bt_csip_set_coordinator_release (const struct bt_csip_set_coordinator_set_member **members, uint8_t count, const struct bt_csip_set_coordinator_set_info *set_info) |
Release an array of set members. | |
void | bt_pacs_cap_foreach (enum bt_audio_dir dir, bt_pacs_cap_foreach_func_t func, void *user_data) |
Published Audio Capability iterator. | |
int | bt_pacs_cap_register (enum bt_audio_dir dir, struct bt_pacs_cap *cap) |
Register Published Audio Capability. | |
int | bt_pacs_cap_unregister (enum bt_audio_dir dir, struct bt_pacs_cap *cap) |
Unregister Published Audio Capability. | |
int | bt_pacs_set_location (enum bt_audio_dir dir, enum bt_audio_location location) |
Set the location for an endpoint type. | |
int | bt_pacs_set_available_contexts (enum bt_audio_dir dir, enum bt_audio_context contexts) |
Set the available contexts for an endpoint type. | |
enum bt_audio_context | bt_pacs_get_available_contexts (enum bt_audio_dir dir) |
Get the available contexts for an endpoint type. | |
int | bt_pacs_conn_set_available_contexts_for_conn (struct bt_conn *conn, enum bt_audio_dir dir, enum bt_audio_context *contexts) |
Set the available contexts for a given connection. | |
enum bt_audio_context | bt_pacs_get_available_contexts_for_conn (struct bt_conn *conn, enum bt_audio_dir dir) |
Get the available contexts for a given connection. | |
int | bt_pacs_set_supported_contexts (enum bt_audio_dir dir, enum bt_audio_context contexts) |
Set the supported contexts for an endpoint type. | |
Coordinated Set Identification Profile (CSIP)
Published Audio Capabilities Service (PACS)
The Coordinated Set Identification Profile (CSIP) provides procedures to discover and coordinate sets of devices.
The Published Audio Capabilities Service (PACS) is used to expose capabilities to remote devices.
#define BT_CSIP_DATA_RSI | ( | _rsi | ) |
#include <zephyr/bluetooth/audio/csip.h>
Helper to declare bt_data array including RSI.
This macro is mainly for creating an array of struct bt_data elements which is then passed to e.g. bt_le_ext_adv_start().
_rsi | Pointer to the RSI value |
#define BT_CSIP_ERROR_LOCK_ALREADY_GRANTED 0x84 |
#include <zephyr/bluetooth/audio/csip.h>
Client is already owner of the lock.
#define BT_CSIP_ERROR_LOCK_DENIED 0x80 |
#include <zephyr/bluetooth/audio/csip.h>
Service is already locked.
#define BT_CSIP_ERROR_LOCK_INVAL_VALUE 0x82 |
#include <zephyr/bluetooth/audio/csip.h>
Invalid lock value.
#define BT_CSIP_ERROR_LOCK_RELEASE_DENIED 0x81 |
#include <zephyr/bluetooth/audio/csip.h>
Service is not locked.
#define BT_CSIP_ERROR_SIRK_OOB_ONLY 0x83 |
#include <zephyr/bluetooth/audio/csip.h>
SIRK only available out-of-band.
#define BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT 0x00 |
#include <zephyr/bluetooth/audio/csip.h>
Accept the request to read the SIRK as plaintext.
#define BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT_ENC 0x01 |
#include <zephyr/bluetooth/audio/csip.h>
Accept the request to read the SIRK, but return encrypted SIRK.
#define BT_CSIP_READ_SIRK_REQ_RSP_OOB_ONLY 0x03 |
#include <zephyr/bluetooth/audio/csip.h>
SIRK is available only via an OOB procedure.
#define BT_CSIP_READ_SIRK_REQ_RSP_REJECT 0x02 |
#include <zephyr/bluetooth/audio/csip.h>
Reject the request to read the SIRK.
#define BT_CSIP_RSI_SIZE 6 |
#include <zephyr/bluetooth/audio/csip.h>
Size of the Resolvable Set Identifier (RSI)
#define BT_CSIP_SET_COORDINATOR_DISCOVER_TIMER_VALUE K_SECONDS(10) |
#include <zephyr/bluetooth/audio/csip.h>
Recommended timer for member discovery.
#define BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES 0 |
#include <zephyr/bluetooth/audio/csip.h>
Defines the maximum number of Coordinated Set Identification service instances for the Coordinated Set Identification Set Coordinator.
#define BT_CSIP_SIRK_SIZE 16 |
#include <zephyr/bluetooth/audio/csip.h>
Size of the Set Identification Resolving Key (SIRK)
typedef void(* bt_csip_set_coordinator_discover_cb) (struct bt_conn *conn, const struct bt_csip_set_coordinator_set_member *member, int err, size_t set_count) |
#include <zephyr/bluetooth/audio/csip.h>
Callback for discovering Coordinated Set Identification Services.
conn | Pointer to the remote device. |
member | Pointer to the set member. |
err | 0 on success, or an errno value on error. |
set_count | Number of sets on the member. |
typedef void(* bt_csip_set_coordinator_lock_changed_cb) (struct bt_csip_set_coordinator_csis_inst *inst, bool locked) |
#include <zephyr/bluetooth/audio/csip.h>
Callback when the lock value on a set of a connected device changes.
inst | The Coordinated Set Identification Service instance that was changed. |
locked | Whether the lock is locked or release. |
typedef void(* bt_csip_set_coordinator_lock_set_cb) (int err) |
#include <zephyr/bluetooth/audio/csip.h>
Callback for locking a set across one or more devices.
err | 0 on success, or an errno value on error. |
typedef void(* bt_csip_set_coordinator_ordered_access_cb_t) (const struct bt_csip_set_coordinator_set_info *set_info, int err, bool locked, struct bt_csip_set_coordinator_set_member *member) |
#include <zephyr/bluetooth/audio/csip.h>
Callback for bt_csip_set_coordinator_ordered_access()
If any of the set members supplied to bt_csip_set_coordinator_ordered_access() is in the locked state, this will be called with locked
true and member
will be the locked member, and the ordered access procedure is cancelled. Likewise, if any error occurs, the procedure will also be aborted.
set_info | Pointer to the a specific set_info struct. |
err | Error value. 0 on success, GATT error or errno on fail. |
locked | Whether the lock is locked or release. |
member | The locked member if locked is true, otherwise NULL. |
typedef bool(* bt_csip_set_coordinator_ordered_access_t) (const struct bt_csip_set_coordinator_set_info *set_info, struct bt_csip_set_coordinator_set_member *members[], size_t count) |
#include <zephyr/bluetooth/audio/csip.h>
Callback function definition for bt_csip_set_coordinator_ordered_access()
set_info | Pointer to the a specific set_info struct. |
members | Array of members ordered by rank. The procedure shall be done on the members in ascending order. |
count | Number of members in members . |
typedef void(* bt_csip_set_coordinator_sirk_changed_cb) (struct bt_csip_set_coordinator_csis_inst *inst) |
#include <zephyr/bluetooth/audio/csip.h>
Callback when the SIRK value of a set of a connected device changes.
inst | The Coordinated Set Identification Service instance that was changed. The new SIRK can be accessed via the inst.info . |
typedef bool(* bt_pacs_cap_foreach_func_t) (const struct bt_pacs_cap *cap, void *user_data) |
#include <zephyr/bluetooth/audio/pacs.h>
Published Audio Capability iterator callback.
cap | Capability found. |
user_data | Data given. |
int bt_csip_set_coordinator_discover | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/csip.h>
Initialise the csip_set_coordinator instance for a connection.
This will do a discovery on the device and prepare the instance for following commands.
conn | Pointer to remote device to perform discovery on. |
#include <zephyr/bluetooth/audio/csip.h>
Check if advertising data indicates a set member.
sirk | The SIRK of the set to check against |
data | The advertising data |
int bt_csip_set_coordinator_lock | ( | const struct bt_csip_set_coordinator_set_member ** | members, |
uint8_t | count, | ||
const struct bt_csip_set_coordinator_set_info * | set_info ) |
#include <zephyr/bluetooth/audio/csip.h>
Lock an array of set members.
The members will be locked starting from lowest rank going up.
TODO: If locking fails, the already locked members will not be unlocked.
members | Array of set members to lock. |
count | Number of set members in members . |
set_info | Pointer to the a specific set_info struct, as a member may be part of multiple sets. |
int bt_csip_set_coordinator_ordered_access | ( | const struct bt_csip_set_coordinator_set_member * | members[], |
uint8_t | count, | ||
const struct bt_csip_set_coordinator_set_info * | set_info, | ||
bt_csip_set_coordinator_ordered_access_t | cb ) |
#include <zephyr/bluetooth/audio/csip.h>
Access Coordinated Set devices in an ordered manner as a client.
This function will read the lock state of all devices and if all devices are in the unlocked state, then cb
will be called with the same members as provided by members
, but where the members are ordered by rank (if present). Once this procedure is finished or an error occurs, bt_csip_set_coordinator_cb::ordered_access will be called.
This procedure only works if all the members have the lock characteristic, and all either has rank = 0 or unique ranks.
If any of the members are in the locked state, the procedure will be cancelled.
This can only be done on members that are bonded.
members | Array of set members to access. |
count | Number of set members in members . |
set_info | Pointer to the a specific set_info struct, as a member may be part of multiple sets. |
cb | The callback function to be called for each member. |
int bt_csip_set_coordinator_register_cb | ( | struct bt_csip_set_coordinator_cb * | cb | ) |
#include <zephyr/bluetooth/audio/csip.h>
Registers callbacks for csip_set_coordinator.
cb | Pointer to the callback structure. |
int bt_csip_set_coordinator_release | ( | const struct bt_csip_set_coordinator_set_member ** | members, |
uint8_t | count, | ||
const struct bt_csip_set_coordinator_set_info * | set_info ) |
#include <zephyr/bluetooth/audio/csip.h>
Release an array of set members.
The members will be released starting from highest rank going down.
members | Array of set members to lock. |
count | Number of set members in members . |
set_info | Pointer to the a specific set_info struct, as a member may be part of multiple sets. |
struct bt_csip_set_coordinator_set_member * bt_csip_set_coordinator_set_member_by_conn | ( | const struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/csip.h>
Get the set member from a connection pointer.
Get the Coordinated Set Identification Profile Set Coordinator pointer from a connection pointer. Only Set Coordinators that have been initiated via bt_csip_set_coordinator_discover() can be retrieved.
conn | Connection pointer. |
Pointer | to a Coordinated Set Identification Profile Set Coordinator instance |
NULL | if conn is NULL or if the connection has not done discovery yet |
int bt_csip_set_member_generate_rsi | ( | const struct bt_csip_set_member_svc_inst * | svc_inst, |
uint8_t | rsi[6] ) |
#include <zephyr/bluetooth/audio/csip.h>
Generate the Resolvable Set Identifier (RSI) value.
This will generate RSI for given svc_inst
instance.
svc_inst | Pointer to the Coordinated Set Identification Service. |
rsi | Pointer to the 6-octet newly generated RSI data in little-endian. |
int bt_csip_set_member_get_sirk | ( | struct bt_csip_set_member_svc_inst * | svc_inst, |
uint8_t | sirk[16] ) |
#include <zephyr/bluetooth/audio/csip.h>
Get the SIRK of a service instance.
[in] | svc_inst | Pointer to the registered Coordinated Set Identification Service. |
[out] | sirk | Array to store the SIRK in. |
int bt_csip_set_member_lock | ( | struct bt_csip_set_member_svc_inst * | svc_inst, |
bool | lock, | ||
bool | force ) |
#include <zephyr/bluetooth/audio/csip.h>
Locks a specific Coordinated Set Identification Service instance on the server.
svc_inst | Pointer to the Coordinated Set Identification Service. |
lock | If true lock the set, if false release the set. |
force | This argument only have meaning when lock is false (release) and will force release the lock, regardless of who took the lock. |
int bt_csip_set_member_register | ( | const struct bt_csip_set_member_register_param * | param, |
struct bt_csip_set_member_svc_inst ** | svc_inst ) |
#include <zephyr/bluetooth/audio/csip.h>
Register a Coordinated Set Identification Service instance.
This will register and enable the service and make it discoverable by clients.
This shall only be done as a server.
param | Coordinated Set Identification Service register parameters. | |
[out] | svc_inst | Pointer to the registered Coordinated Set Identification Service. |
int bt_csip_set_member_sirk | ( | struct bt_csip_set_member_svc_inst * | svc_inst, |
const uint8_t | sirk[16] ) |
#include <zephyr/bluetooth/audio/csip.h>
Set the SIRK of a service instance.
svc_inst | Pointer to the registered Coordinated Set Identification Service. |
sirk | The new SIRK. |
void * bt_csip_set_member_svc_decl_get | ( | const struct bt_csip_set_member_svc_inst * | svc_inst | ) |
#include <zephyr/bluetooth/audio/csip.h>
Get the service declaration attribute.
The first service attribute can be included in any other GATT service.
svc_inst | Pointer to the Coordinated Set Identification Service. |
int bt_csip_set_member_unregister | ( | struct bt_csip_set_member_svc_inst * | svc_inst | ) |
#include <zephyr/bluetooth/audio/csip.h>
Unregister a Coordinated Set Identification Service instance.
This will unregister and disable the service instance.
svc_inst | Pointer to the registered Coordinated Set Identification Service. |
void bt_pacs_cap_foreach | ( | enum bt_audio_dir | dir, |
bt_pacs_cap_foreach_func_t | func, | ||
void * | user_data ) |
#include <zephyr/bluetooth/audio/pacs.h>
Published Audio Capability iterator.
Iterate capabilities with endpoint direction specified.
dir | Direction of the endpoint to look capability for. |
func | Callback function. |
user_data | Data to pass to the callback. |
int bt_pacs_cap_register | ( | enum bt_audio_dir | dir, |
struct bt_pacs_cap * | cap ) |
#include <zephyr/bluetooth/audio/pacs.h>
Register Published Audio Capability.
Register Audio Local Capability.
dir | Direction of the endpoint to register capability for. |
cap | Capability structure. |
int bt_pacs_cap_unregister | ( | enum bt_audio_dir | dir, |
struct bt_pacs_cap * | cap ) |
#include <zephyr/bluetooth/audio/pacs.h>
Unregister Published Audio Capability.
Unregister Audio Local Capability.
dir | Direction of the endpoint to unregister capability for. |
cap | Capability structure. |
int bt_pacs_conn_set_available_contexts_for_conn | ( | struct bt_conn * | conn, |
enum bt_audio_dir | dir, | ||
enum bt_audio_context * | contexts ) |
#include <zephyr/bluetooth/audio/pacs.h>
Set the available contexts for a given connection.
This function sets the available contexts value for a given conn
connection object. If the contexts
parameter is NULL the available contexts value is reset to default. The default value of the available contexts is set using bt_pacs_set_available_contexts function. The Available Context Value is reset to default on ACL disconnection.
conn | Connection object. |
dir | Direction of the endpoints to change available contexts for. |
contexts | The contexts to be set or NULL to reset to default. |
enum bt_audio_context bt_pacs_get_available_contexts | ( | enum bt_audio_dir | dir | ) |
#include <zephyr/bluetooth/audio/pacs.h>
Get the available contexts for an endpoint type.
dir | Direction of the endpoints to get contexts for. |
enum bt_audio_context bt_pacs_get_available_contexts_for_conn | ( | struct bt_conn * | conn, |
enum bt_audio_dir | dir ) |
#include <zephyr/bluetooth/audio/pacs.h>
Get the available contexts for a given connection.
This server function returns the available contexts value for a given conn
connection object. The value returned is the one set with bt_pacs_conn_set_available_contexts_for_conn function or the default value set with bt_pacs_set_available_contexts function.
conn | Connection object. |
dir | Direction of the endpoints to get contexts for. |
BT_AUDIO_CONTEXT_TYPE_PROHIBITED | if conn or dir are invalid |
int bt_pacs_set_available_contexts | ( | enum bt_audio_dir | dir, |
enum bt_audio_context | contexts ) |
#include <zephyr/bluetooth/audio/pacs.h>
Set the available contexts for an endpoint type.
dir | Direction of the endpoints to change available contexts for. |
contexts | The contexts to be set. |
int bt_pacs_set_location | ( | enum bt_audio_dir | dir, |
enum bt_audio_location | location ) |
#include <zephyr/bluetooth/audio/pacs.h>
Set the location for an endpoint type.
dir | Direction of the endpoints to change location for. |
location | The location to be set. |
int bt_pacs_set_supported_contexts | ( | enum bt_audio_dir | dir, |
enum bt_audio_context | contexts ) |
#include <zephyr/bluetooth/audio/pacs.h>
Set the supported contexts for an endpoint type.
dir | Direction of the endpoints to change available contexts for. |
contexts | The contexts to be set. |