@@ -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. */
@@ -783,21 +815,43 @@ int bt_cap_initiator_broadcast_get_base(struct bt_cap_broadcast_source *broadcas
783
815
784
816
/** Parameters for bt_cap_initiator_unicast_to_broadcast() */
785
817
struct bt_cap_unicast_to_broadcast_param {
818
+ /** The type of the set. */
819
+ enum bt_cap_set_type type ;
820
+
786
821
/** The source unicast group with the streams. */
787
- struct bt_bap_unicast_group * unicast_group ;
822
+ struct bt_cap_unicast_group * unicast_group ;
823
+
824
+ /** The advertising set to use for the broadcast source */
825
+ /* TBD: Is this necessary? Should we, or the app, start the source? */
826
+ struct bt_le_ext_adv * adv ;
827
+
828
+ /** Quality of Service configuration for the broadcast streams.
829
+ *
830
+ * Shall be valid for the duration of the broadcast source object.
831
+ */
832
+ struct bt_bap_qos_cfg * qos ;
833
+
834
+ /**
835
+ * @brief Broadcast Source packing mode.
836
+ *
837
+ * @ref BT_ISO_PACKING_SEQUENTIAL or @ref BT_ISO_PACKING_INTERLEAVED.
838
+ *
839
+ * @note This is a recommendation to the controller, which the controller may ignore.
840
+ */
841
+ uint8_t packing ;
788
842
789
843
/**
790
844
* @brief Whether or not to encrypt the streams.
791
845
*
792
- * If set to true, then the broadcast code in @p broadcast_code
793
- * will be used to encrypt the streams.
846
+ * If set to true, then the broadcast code in
847
+ * @p bt_cap_unicast_to_broadcast_param.broadcast_code will be used to encrypt the streams.
794
848
*/
795
849
bool encrypt ;
796
850
797
851
/**
798
852
* @brief 16-octet broadcast code.
799
853
*
800
- * Only valid if @p encrypt is true.
854
+ * Only valid if @p bt_cap_unicast_to_broadcast_param. encrypt is true.
801
855
*
802
856
* If the value is a string or a the value is less than 16 octets,
803
857
* the remaining octets shall be 0.
@@ -807,6 +861,35 @@ struct bt_cap_unicast_to_broadcast_param {
807
861
* [42 72 6F 61 64 63 61 73 74 20 43 6F 64 65 00 00]
808
862
*/
809
863
uint8_t broadcast_code [BT_ISO_BROADCAST_CODE_SIZE ];
864
+
865
+ #if defined(CONFIG_BT_ISO_TEST_PARAMS ) || defined(__DOXYGEN__ )
866
+ /**
867
+ * @brief Immediate Repetition Count
868
+ *
869
+ * The number of times the scheduled payloads are transmitted in a given event.
870
+ *
871
+ * Value range from @ref BT_ISO_IRC_MIN to @ref BT_ISO_IRC_MAX.
872
+ */
873
+ uint8_t irc ;
874
+
875
+ /**
876
+ * @brief Pre-transmission offset
877
+ *
878
+ * Offset used for pre-transmissions.
879
+ *
880
+ * Value range from @ref BT_ISO_PTO_MIN to @ref BT_ISO_PTO_MAX.
881
+ */
882
+ uint8_t pto ;
883
+
884
+ /**
885
+ * @brief ISO interval
886
+ *
887
+ * Time between consecutive BIS anchor points.
888
+ *
889
+ * Value range from @ref BT_ISO_ISO_INTERVAL_MIN to @ref BT_ISO_ISO_INTERVAL_MAX.
890
+ */
891
+ uint16_t iso_interval ;
892
+ #endif /* CONFIG_BT_ISO_TEST_PARAMS */
810
893
};
811
894
812
895
/**
@@ -815,10 +898,7 @@ struct bt_cap_unicast_to_broadcast_param {
815
898
* The streams in the unicast group will be stopped and the unicast group
816
899
* will be deleted. This can only be done for source streams.
817
900
*
818
- * @note @kconfig{CONFIG_BT_CAP_INITIATOR},
819
- * @kconfig{CONFIG_BT_BAP_UNICAST_CLIENT} and
820
- * @kconfig{CONFIG_BT_BAP_BROADCAST_SOURCE} must be enabled for this function
821
- * to be enabled.
901
+ * @kconfig_dep{CONFIG_BT_CAP_HANDOVER_SUPPORTED}
822
902
*
823
903
* @param param The parameters for the handover.
824
904
* @param source The resulting broadcast source.
@@ -859,10 +939,7 @@ struct bt_cap_broadcast_to_unicast_param {
859
939
* The streams in the broadcast source will be stopped and the broadcast source
860
940
* will be deleted.
861
941
*
862
- * @note @kconfig{CONFIG_BT_CAP_INITIATOR},
863
- * @kconfig{CONFIG_BT_BAP_UNICAST_CLIENT} and
864
- * @kconfig{CONFIG_BT_BAP_BROADCAST_SOURCE} must be enabled for this function
865
- * to be enabled.
942
+ * @kconfig_dep{CONFIG_BT_CAP_HANDOVER_SUPPORTED}
866
943
*
867
944
* @param[in] param The parameters for the handover.
868
945
* @param[out] unicast_group The resulting broadcast source.
0 commit comments