7#ifndef ZEPHYR_SUBSYS_BLUETOOTH_AUDIO_CSIP_H_
8#define ZEPHYR_SUBSYS_BLUETOOTH_AUDIO_CSIP_H_
30#define BT_CSIP_SET_COORDINATOR_DISCOVER_TIMER_VALUE K_SECONDS(10)
32#if defined(CONFIG_BT_CSIP_SET_COORDINATOR)
33#define BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES CONFIG_BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES
35#define BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES 0
39#define BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT 0x00
41#define BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT_ENC 0x01
43#define BT_CSIP_READ_SIRK_REQ_RSP_REJECT 0x02
45#define BT_CSIP_READ_SIRK_REQ_RSP_OOB_ONLY 0x03
48#define BT_CSIP_SET_SIRK_SIZE 16
51#define BT_CSIP_RSI_SIZE 6
55#define BT_CSIP_ERROR_LOCK_DENIED 0x80
57#define BT_CSIP_ERROR_LOCK_RELEASE_DENIED 0x81
59#define BT_CSIP_ERROR_LOCK_INVAL_VALUE 0x82
61#define BT_CSIP_ERROR_SIRK_OOB_ONLY 0x83
63#define BT_CSIP_ERROR_LOCK_ALREADY_GRANTED 0x84
73#define BT_CSIP_DATA_RSI(_rsi) BT_DATA(BT_DATA_CSIS_RSI, _rsi, BT_CSIP_RSI_SIZE)
76struct bt_csip_set_member_svc_inst;
92 struct bt_csip_set_member_svc_inst *svc_inst,
109 struct bt_csip_set_member_svc_inst *svc_inst);
148#if CONFIG_BT_CSIP_SET_MEMBER_MAX_INSTANCE_COUNT > 1
189 struct bt_csip_set_member_svc_inst **svc_inst);
223 bool lock,
bool force);
279 struct bt_conn *conn,
281 int err,
size_t set_count);
330 int err,
bool locked,
ZTEST_BMEM int count
Definition: main.c:33
Bluetooth connection handling.
int bt_csip_set_coordinator_register_cb(struct bt_csip_set_coordinator_cb *cb)
Registers callbacks for csip_set_coordinator.
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()
Definition: csip.h:328
void(* bt_csip_set_coordinator_lock_set_cb)(int err)
Callback for locking a set across one or more devices.
Definition: csip.h:299
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()
Definition: csip.h:378
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.
bool bt_csip_set_coordinator_is_set_member(const uint8_t set_sirk[16], struct bt_data *data)
Check if advertising data indicates a set member.
#define BT_CSIP_SET_SIRK_SIZE
Definition: csip.h:48
#define BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES
Definition: csip.h:35
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.
Definition: csip.h:311
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.
#define BT_CSIP_RSI_SIZE
Definition: csip.h:51
int bt_csip_set_coordinator_discover(struct bt_conn *conn)
Initialise the csip_set_coordinator instance for a connection. This will do a discovery on the device...
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_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.
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_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.
void bt_csip_set_member_print_sirk(const struct bt_csip_set_member_svc_inst *svc_inst)
Print the SIRK to the debug output.
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.
Definition: csip.h:278
struct _snode sys_snode_t
Definition: slist.h:33
static struct k_spinlock lock
Definition: spinlock_error_case.c:13
#define bool
Definition: stdbool.h:13
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
bt_csip_set_coordinator_lock_set_cb lock_set
Definition: csip.h:335
bt_csip_set_coordinator_discover_cb discover
Definition: csip.h:340
bt_csip_set_coordinator_lock_set_cb release_set
Definition: csip.h:336
bt_csip_set_coordinator_lock_changed_cb lock_changed
Definition: csip.h:337
bt_csip_set_coordinator_ordered_access_cb_t ordered_access
Definition: csip.h:341
Struct representing a coordinated set instance on a remote device.
Definition: csip.h:256
struct bt_csip_set_coordinator_set_info info
Definition: csip.h:257
void * svc_inst
Definition: csip.h:260
uint8_t rank
The rank of the set on on the remote device.
Definition: csip.h:247
uint8_t set_sirk[16]
The 16 octet set Set Identity Resolving Key (SIRK)
Definition: csip.h:233
uint8_t set_size
The size of the set.
Definition: csip.h:240
struct bt_csip_set_coordinator_csis_inst insts[0]
Definition: csip.h:266
uint8_t(* sirk_read_req)(struct bt_conn *conn, struct bt_csip_set_member_svc_inst *svc_inst)
Request from a peer device to read the sirk.
Definition: csip.h:108
void(* lock_changed)(struct bt_conn *conn, struct bt_csip_set_member_svc_inst *svc_inst, bool locked)
Callback whenever the lock changes on the server.
Definition: csip.h:91
struct bt_csip_set_member_cb * cb
Definition: csip.h:146
uint8_t set_sirk[16]
The unique Set Identity Resolving Key (SIRK)
Definition: csip.h:127
bool lockable
Boolean to set whether the set is lockable by clients.
Definition: csip.h:134
uint8_t rank
Rank of this device in this set.
Definition: csip.h:143
uint8_t set_size
Size of the set.
Definition: csip.h:119
Bluetooth data.
Definition: bluetooth.h:356
GATT Service structure.
Definition: gatt.h:191
static fdata_t data[2]
Definition: test_fifo_contexts.c:15