@@ -147,6 +147,12 @@ struct bt_cap_initiator_cb {
147
147
*/
148
148
void (* broadcast_stopped )(struct bt_cap_broadcast_source * source , uint8_t reason );
149
149
#endif /* CONFIG_BT_BAP_BROADCAST_SOURCE */
150
+ #if defined(CONFIG_BT_CAP_HANDOVER_SUPPORTED )
151
+ /**
152
+ * @brief The unicast to broadcast handover procedure has finished
153
+ */
154
+ void (* unicast_to_broadcast_complete )(int err , struct bt_conn * conn );
155
+ #endif /* CONFIG_BT_CAP_HANDOVER_SUPPORTED */
150
156
};
151
157
152
158
/**
@@ -398,6 +404,32 @@ int bt_cap_unicast_group_add_streams(struct bt_cap_unicast_group *unicast_group,
398
404
*/
399
405
int bt_cap_unicast_group_delete (struct bt_cap_unicast_group * unicast_group );
400
406
407
+ /** Callback function for bt_bap_unicast_group_foreach_stream()
408
+ *
409
+ * @param stream The audio stream
410
+ * @param user_data User data
411
+ *
412
+ * @retval true Stop iterating.
413
+ * @retval false Continue iterating.
414
+ */
415
+ typedef bool (* bt_cap_unicast_group_foreach_stream_func_t )(struct bt_cap_stream * stream ,
416
+ void * user_data );
417
+
418
+ /**
419
+ * @brief Iterate through all streams in a unicast group
420
+ *
421
+ * @param unicast_group The unicast group
422
+ * @param func The callback function
423
+ * @param user_data User specified data that sent to the callback function
424
+ *
425
+ * @retval 0 Success (even if no streams exists in the group).
426
+ * @retval -ECANCELED Iteration was stopped by the callback function before complete.
427
+ * @retval -EINVAL @p unicast_group or @p func were NULL.
428
+ */
429
+ int bt_cap_unicast_group_foreach_stream (struct bt_cap_unicast_group * unicast_group ,
430
+ bt_cap_unicast_group_foreach_stream_func_t func ,
431
+ void * user_data );
432
+
401
433
/** Stream specific parameters for the bt_cap_initiator_unicast_audio_start() function */
402
434
struct bt_cap_unicast_audio_start_stream_param {
403
435
/** Coordinated or ad-hoc set member. */
@@ -788,30 +820,30 @@ int bt_cap_initiator_broadcast_get_base(struct bt_cap_broadcast_source *broadcas
788
820
789
821
/** Parameters for bt_cap_initiator_unicast_to_broadcast() */
790
822
struct bt_cap_unicast_to_broadcast_param {
823
+ /** The type of the set. */
824
+ enum bt_cap_set_type type ;
825
+
791
826
/** The source unicast group with the streams. */
792
- struct bt_bap_unicast_group * unicast_group ;
827
+ struct bt_cap_unicast_group * unicast_group ;
793
828
794
829
/**
795
- * @brief Whether or not to encrypt the streams.
830
+ * @brief The advertising set to use for the broadcast source
796
831
*
797
- * If set to true, then the broadcast code in @p broadcast_code
798
- * will be used to encrypt the streams.
832
+ * This shall remain valid until the procedure has completed.
799
833
*/
800
- bool encrypt ;
834
+ /* TBD: Is this necessary? Should we, or the app, start the source? */
835
+ struct bt_le_ext_adv * ext_adv ;
836
+
837
+ uint8_t sid ;
838
+ uint16_t pa_interval ;
839
+ uint32_t broadcast_id ;
801
840
802
841
/**
803
- * @brief 16-octet broadcast code.
804
- *
805
- * Only valid if @p encrypt is true.
842
+ * @brief Broadcast source parameters
806
843
*
807
- * If the value is a string or a the value is less than 16 octets,
808
- * the remaining octets shall be 0.
809
- *
810
- * Example:
811
- * The string "Broadcast Code" shall be
812
- * [42 72 6F 61 64 63 61 73 74 20 43 6F 64 65 00 00]
844
+ * These parameters shall remain valid until the procedure has completed.
813
845
*/
814
- uint8_t broadcast_code [ BT_ISO_BROADCAST_CODE_SIZE ] ;
846
+ struct bt_cap_initiator_broadcast_create_param * broadcast_create_param ;
815
847
};
816
848
817
849
/**
@@ -820,10 +852,7 @@ struct bt_cap_unicast_to_broadcast_param {
820
852
* The streams in the unicast group will be stopped and the unicast group
821
853
* will be deleted. This can only be done for source streams.
822
854
*
823
- * @note @kconfig{CONFIG_BT_CAP_INITIATOR},
824
- * @kconfig{CONFIG_BT_BAP_UNICAST_CLIENT} and
825
- * @kconfig{CONFIG_BT_BAP_BROADCAST_SOURCE} must be enabled for this function
826
- * to be enabled.
855
+ * @kconfig_dep{CONFIG_BT_CAP_HANDOVER_SUPPORTED}
827
856
*
828
857
* @param param The parameters for the handover.
829
858
* @param source The resulting broadcast source.
@@ -864,10 +893,7 @@ struct bt_cap_broadcast_to_unicast_param {
864
893
* The streams in the broadcast source will be stopped and the broadcast source
865
894
* will be deleted.
866
895
*
867
- * @note @kconfig{CONFIG_BT_CAP_INITIATOR},
868
- * @kconfig{CONFIG_BT_BAP_UNICAST_CLIENT} and
869
- * @kconfig{CONFIG_BT_BAP_BROADCAST_SOURCE} must be enabled for this function
870
- * to be enabled.
896
+ * @kconfig_dep{CONFIG_BT_CAP_HANDOVER_SUPPORTED}
871
897
*
872
898
* @param[in] param The parameters for the handover.
873
899
* @param[out] unicast_group The resulting broadcast source.
0 commit comments