@@ -147,6 +147,22 @@ 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
+ * @param err 0 if success else a negative errno value.
155
+ * @param conn Pointer to the connection where the error
156
+ * occurred or NULL local failure.
157
+ * @param unicast_group NULL if the unicast group was deleted during the procedure, else
158
+ * pointer to the unicast group provided in the parameters.
159
+ * @param broadcast_source Pointer to newly created broadcast source, or NULL in case of an
160
+ * error happening before it was created.
161
+ */
162
+ void (* unicast_to_broadcast_complete )(int err , struct bt_conn * conn ,
163
+ struct bt_cap_unicast_group * unicast_group ,
164
+ struct bt_cap_broadcast_source * broadcast_source );
165
+ #endif /* CONFIG_BT_CAP_HANDOVER_SUPPORTED */
150
166
};
151
167
152
168
/**
@@ -814,50 +830,54 @@ int bt_cap_initiator_broadcast_get_base(struct bt_cap_broadcast_source *broadcas
814
830
815
831
/** Parameters for bt_cap_initiator_unicast_to_broadcast() */
816
832
struct bt_cap_unicast_to_broadcast_param {
833
+ /** The type of the set. */
834
+ enum bt_cap_set_type type ;
835
+
817
836
/** The source unicast group with the streams. */
818
- struct bt_bap_unicast_group * unicast_group ;
837
+ struct bt_cap_unicast_group * unicast_group ;
819
838
820
839
/**
821
- * @brief Whether or not to encrypt the streams.
840
+ * @brief The advertising set to use for the broadcast source
822
841
*
823
- * If set to true, then the broadcast code in @p broadcast_code
824
- * will be used to encrypt the streams.
842
+ * This shall remain valid until the procedure has completed.
843
+ * If the advertising set is not started at the time of calling
844
+ * bt_cap_initiator_unicast_to_broadcast(),
845
+ * the procedure will start the advertising set with @ref BT_LE_EXT_ADV_START_DEFAULT.
825
846
*/
826
- bool encrypt ;
847
+ struct bt_le_ext_adv * ext_adv ;
848
+
849
+ /** The SID of the advertising set. */
850
+ uint8_t sid ;
851
+
852
+ /** The periodic advertising interval configured for the advertising set. */
853
+ uint16_t pa_interval ;
854
+
855
+ /** The broadcast ID the advertising set is, or will be, using. */
856
+ uint32_t broadcast_id ;
827
857
828
858
/**
829
- * @brief 16-octet broadcast code .
859
+ * @brief Broadcast source parameters .
830
860
*
831
- * Only valid if @p encrypt is true.
832
- *
833
- * If the value is a string or a the value is less than 16 octets,
834
- * the remaining octets shall be 0.
835
- *
836
- * Example:
837
- * The string "Broadcast Code" shall be
838
- * [42 72 6F 61 64 63 61 73 74 20 43 6F 64 65 00 00]
861
+ * These parameters shall remain valid until the procedure has completed.
839
862
*/
840
- uint8_t broadcast_code [ BT_ISO_BROADCAST_CODE_SIZE ] ;
863
+ struct bt_cap_initiator_broadcast_create_param * broadcast_create_param ;
841
864
};
842
865
843
866
/**
844
- * @brief Hands over the data streams in a unicast group to a broadcast source.
867
+ * @brief Hands over the sink streams in a unicast group to a broadcast source.
845
868
*
846
- * The streams in the unicast group will be stopped and the unicast group
847
- * will be deleted. This can only be done for source streams.
869
+ * All streams in the provided unicast group will be stopped and released. The sink streams will be
870
+ * tranferred to a broadcast source, and the broadcast source information will be shared with
871
+ * all accepters that are currently receiving audio. Any stream that is not in the streaming state
872
+ * will only be released.
848
873
*
849
- * @note @kconfig{CONFIG_BT_CAP_INITIATOR},
850
- * @kconfig{CONFIG_BT_BAP_UNICAST_CLIENT} and
851
- * @kconfig{CONFIG_BT_BAP_BROADCAST_SOURCE} must be enabled for this function
852
- * to be enabled.
874
+ * @kconfig_dep{CONFIG_BT_CAP_HANDOVER_SUPPORTED}
853
875
*
854
- * @param param The parameters for the handover.
855
- * @param source The resulting broadcast source.
876
+ * @param param The parameters for the handover.
856
877
*
857
878
* @return 0 on success or negative error value on failure.
858
879
*/
859
- int bt_cap_initiator_unicast_to_broadcast (const struct bt_cap_unicast_to_broadcast_param * param ,
860
- struct bt_cap_broadcast_source * * source );
880
+ int bt_cap_initiator_unicast_to_broadcast (const struct bt_cap_unicast_to_broadcast_param * param );
861
881
862
882
/** Parameters for bt_cap_initiator_broadcast_to_unicast() */
863
883
struct bt_cap_broadcast_to_unicast_param {
@@ -890,10 +910,7 @@ struct bt_cap_broadcast_to_unicast_param {
890
910
* The streams in the broadcast source will be stopped and the broadcast source
891
911
* will be deleted.
892
912
*
893
- * @note @kconfig{CONFIG_BT_CAP_INITIATOR},
894
- * @kconfig{CONFIG_BT_BAP_UNICAST_CLIENT} and
895
- * @kconfig{CONFIG_BT_BAP_BROADCAST_SOURCE} must be enabled for this function
896
- * to be enabled.
913
+ * @kconfig_dep{CONFIG_BT_CAP_HANDOVER_SUPPORTED}
897
914
*
898
915
* @param[in] param The parameters for the handover.
899
916
* @param[out] unicast_group The resulting broadcast source.
0 commit comments