Bluetooth: ISO: Add iso accept info struct

Add a new struct that provides information to the upper
layer when accepting an connected isochronous stream.

The CIG ID and CIS ID makes it possible for the upper layer
to determine which ISO channels are "together" in a group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2021-09-21 14:44:04 +02:00 committed by Christopher Friedt
commit 8d20e8d5bc
5 changed files with 36 additions and 9 deletions

View file

@ -453,6 +453,23 @@ struct bt_iso_chan_ops {
void (*sent)(struct bt_iso_chan *chan);
};
struct bt_iso_accept_info {
/** The ACL connection that is requesting authorization */
struct bt_conn *acl;
/** @brief The ID of the connected isochronous group (CIG) on the central
*
* The ID is unique per ACL
*/
uint8_t cig_id;
/** @brief The ID of the connected isochronous stream (CIS) on the central
*
* This ID is unique within a CIG
*/
uint8_t cis_id;
};
/** @brief ISO Server structure. */
struct bt_iso_server {
/** Required minimim security level */
@ -463,12 +480,13 @@ struct bt_iso_server {
* This callback is called whenever a new incoming connection requires
* authorization.
*
* @param acl The ACL connection that is requesting authorization
* @param info The ISO accept information structure
* @param chan Pointer to receive the allocated channel
*
* @return 0 in case of success or negative value in case of error.
*/
int (*accept)(struct bt_conn *acl, struct bt_iso_chan **chan);
int (*accept)(const struct bt_iso_accept_info *info,
struct bt_iso_chan **chan);
};
/** @brief Register ISO server.