Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
csip.h
Go to the documentation of this file.
1
7#ifndef ZEPHYR_SUBSYS_BLUETOOTH_AUDIO_CSIP_H_
8#define ZEPHYR_SUBSYS_BLUETOOTH_AUDIO_CSIP_H_
9
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
29#define BT_CSIP_SET_COORDINATOR_DISCOVER_TIMER_VALUE K_SECONDS(10)
30
31#if defined(CONFIG_BT_CSIP_SET_COORDINATOR)
32#define BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES CONFIG_BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES
33#else
34#define BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES 0
35#endif /* CONFIG_BT_CSIP_SET_COORDINATOR */
36
38#define BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT 0x00
40#define BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT_ENC 0x01
42#define BT_CSIP_READ_SIRK_REQ_RSP_REJECT 0x02
44#define BT_CSIP_READ_SIRK_REQ_RSP_OOB_ONLY 0x03
45
47#define BT_CSIP_SET_SIRK_SIZE 16
48
50#define BT_CSIP_RSI_SIZE 6
51
52/* Coordinate Set Identification Service Error codes */
54#define BT_CSIP_ERROR_LOCK_DENIED 0x80
56#define BT_CSIP_ERROR_LOCK_RELEASE_DENIED 0x81
58#define BT_CSIP_ERROR_LOCK_INVAL_VALUE 0x82
60#define BT_CSIP_ERROR_SIRK_OOB_ONLY 0x83
62#define BT_CSIP_ERROR_LOCK_ALREADY_GRANTED 0x84
63
72#define BT_CSIP_DATA_RSI(_rsi) BT_DATA(BT_DATA_CSIS_RSI, _rsi, BT_CSIP_RSI_SIZE)
73
75struct bt_csip_set_member_svc_inst;
76
90 void (*lock_changed)(struct bt_conn *conn,
91 struct bt_csip_set_member_svc_inst *svc_inst,
92 bool locked);
93
107 uint8_t (*sirk_read_req)(struct bt_conn *conn,
108 struct bt_csip_set_member_svc_inst *svc_inst);
109};
110
119
127
134
143
146
147#if CONFIG_BT_CSIP_SET_MEMBER_MAX_INSTANCE_COUNT > 1
157 const struct bt_gatt_service *parent;
158#endif /* CONFIG_BT_CSIP_SET_MEMBER_MAX_INSTANCE_COUNT > 1 */
159};
160
170void *bt_csip_set_member_svc_decl_get(const struct bt_csip_set_member_svc_inst *svc_inst);
171
188 struct bt_csip_set_member_svc_inst **svc_inst);
189
199int bt_csip_set_member_unregister(struct bt_csip_set_member_svc_inst *svc_inst);
200
207int bt_csip_set_member_set_sirk(struct bt_csip_set_member_svc_inst *svc_inst,
208 const uint8_t sirk[BT_CSIP_SET_SIRK_SIZE]);
209
216int bt_csip_set_member_get_sirk(struct bt_csip_set_member_svc_inst *svc_inst,
218
229int bt_csip_set_member_generate_rsi(const struct bt_csip_set_member_svc_inst *svc_inst,
231
243int bt_csip_set_member_lock(struct bt_csip_set_member_svc_inst *svc_inst,
244 bool lock, bool force);
245
255
262
269
272};
273
282
284 void *svc_inst;
285};
286
291};
292
303 struct bt_conn *conn,
304 const struct bt_csip_set_coordinator_set_member *member,
305 int err, size_t set_count);
306
315int bt_csip_set_coordinator_discover(struct bt_conn *conn);
316
323typedef void (*bt_csip_set_coordinator_lock_set_cb)(int err);
324
336 struct bt_csip_set_coordinator_csis_inst *inst, bool locked);
337
347
363 const struct bt_csip_set_coordinator_set_info *set_info,
364 int err, bool locked,
366
368 /* Set callbacks */
373
374 /* Device specific callbacks */
377
379 sys_snode_t _node;
380};
381
391 struct bt_data *data);
392
401
414 const struct bt_csip_set_coordinator_set_info *set_info,
415 struct bt_csip_set_coordinator_set_member *members[],
416 size_t count);
417
442 const struct bt_csip_set_coordinator_set_member *members[],
443 uint8_t count,
444 const struct bt_csip_set_coordinator_set_info *set_info,
446
462 uint8_t count,
463 const struct bt_csip_set_coordinator_set_info *set_info);
464
478 uint8_t count,
479 const struct bt_csip_set_coordinator_set_info *set_info);
480
481#ifdef __cplusplus
482}
483#endif
484
489#endif /* ZEPHYR_SUBSYS_BLUETOOTH_AUDIO_CSIP_H_ */
Bluetooth connection handling.
int bt_csip_set_coordinator_register_cb(struct bt_csip_set_coordinator_cb *cb)
Registers callbacks for csip_set_coordinator.
int bt_csip_set_member_set_sirk(struct bt_csip_set_member_svc_inst *svc_inst, const uint8_t sirk[16])
Set the SIRK of a service instance.
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:362
void(* bt_csip_set_coordinator_lock_set_cb)(int err)
Callback for locking a set across one or more devices.
Definition: csip.h:323
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.
Definition: csip.h:345
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:413
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
Size of the Set Identification Resolving Key (SIRK)
Definition: csip.h:47
#define BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES
Definition: csip.h:34
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:335
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
Size of the Resolvable Set Identifier (RSI)
Definition: csip.h:50
int bt_csip_set_coordinator_discover(struct bt_conn *conn)
Initialise the csip_set_coordinator instance for a connection.
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_unregister(struct bt_csip_set_member_svc_inst *svc_inst)
Unregister a Coordinated Set Identification Service instance.
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_get_sirk(struct bt_csip_set_member_svc_inst *svc_inst, uint8_t sirk[16])
Get the SIRK of a 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_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:302
struct _snode sys_snode_t
Single-linked list node structure.
Definition: slist.h:39
#define bool
Definition: stdbool.h:13
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
Definition: csip.h:367
bt_csip_set_coordinator_lock_set_cb lock_set
Definition: csip.h:369
bt_csip_set_coordinator_sirk_changed_cb sirk_changed
Definition: csip.h:372
bt_csip_set_coordinator_discover_cb discover
Definition: csip.h:375
bt_csip_set_coordinator_lock_set_cb release_set
Definition: csip.h:370
bt_csip_set_coordinator_lock_changed_cb lock_changed
Definition: csip.h:371
bt_csip_set_coordinator_ordered_access_cb_t ordered_access
Definition: csip.h:376
Struct representing a coordinated set instance on a remote device.
Definition: csip.h:280
struct bt_csip_set_coordinator_set_info info
Definition: csip.h:281
void * svc_inst
Internally used pointer value.
Definition: csip.h:284
Information about a specific set.
Definition: csip.h:247
uint8_t rank
The rank of the set on on the remote device.
Definition: csip.h:268
bool lockable
Whether or not the set can be locked on this device.
Definition: csip.h:271
uint8_t set_sirk[16]
The 16 octet set Set Identity Resolving Key (SIRK)
Definition: csip.h:254
uint8_t set_size
The size of the set.
Definition: csip.h:261
Struct representing a remote device as a set member.
Definition: csip.h:288
struct bt_csip_set_coordinator_csis_inst insts[0]
Array of Coordinated Set Identification Service instances for the remote device.
Definition: csip.h:290
Callback structure for the Coordinated Set Identification Service.
Definition: csip.h:78
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:107
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:90
Register structure for Coordinated Set Identification Service.
Definition: csip.h:112
struct bt_csip_set_member_cb * cb
Pointer to the callback structure.
Definition: csip.h:145
uint8_t set_sirk[16]
The unique Set Identity Resolving Key (SIRK)
Definition: csip.h:126
bool lockable
Boolean to set whether the set is lockable by clients.
Definition: csip.h:133
uint8_t rank
Rank of this device in this set.
Definition: csip.h:142
uint8_t set_size
Size of the set.
Definition: csip.h:118
Bluetooth data.
Definition: bluetooth.h:454
GATT Service structure.
Definition: gatt.h:196