Lines Matching +full:stream +full:- +full:mode
6 * Copyright (c) 2021-2024 Nordic Semiconductor ASA
8 * SPDX-License-Identifier: Apache-2.0
24 * The Basic Audio Profile (BAP) allows for both unicast and broadcast Audio Stream control.
50 #define BT_BASE_MAX_SIZE (UINT8_MAX - 1 /* type */ - BT_UUID_SIZE_16)
79 * Once service discovery has completed and a stream is setup, it is recommended to switch to
91 * Once service discovery has completed and a stream is setup, it is recommended to switch to
235 * Once a stream has been QoS configured, modifying this field does not modify the value.
237 * the value, assuming that the stream is in the correct state.
347 /** @brief Audio Stream Quality of Service Preference structure. */
472 /** Audio Stream Endpoint Idle state */
475 /** Audio Stream Endpoint Codec Configured state */
478 /** Audio Stream Endpoint QoS Configured state */
481 /** Audio Stream Endpoint Enabling state */
484 /** Audio Stream Endpoint Streaming state */
487 /** Audio Stream Endpoint Disabling state */
490 /** Audio Stream Endpoint Streaming state */
497 * These are sent by the server to the client when a stream operation is
571 * - @ref BT_BAP_ASCS_RSP_CODE_SUCCESS
572 * - @ref BT_BAP_ASCS_RSP_CODE_CAP_UNSUPPORTED
573 * - @ref BT_BAP_ASCS_RSP_CODE_CONF_UNSUPPORTED
574 * - @ref BT_BAP_ASCS_RSP_CODE_CONF_REJECTED
575 * - @ref BT_BAP_ASCS_RSP_CODE_METADATA_UNSUPPORTED
576 * - @ref BT_BAP_ASCS_RSP_CODE_METADATA_REJECTED
577 * - @ref BT_BAP_ASCS_RSP_CODE_NO_MEM
578 * - @ref BT_BAP_ASCS_RSP_CODE_UNSPECIFIED
592 * - @ref BT_BAP_ASCS_RSP_CODE_CONF_UNSUPPORTED
593 * - @ref BT_BAP_ASCS_RSP_CODE_CONF_REJECTED
597 * - @ref BT_BAP_ASCS_RSP_CODE_SUCCESS
598 * - @ref BT_BAP_ASCS_RSP_CODE_CAP_UNSUPPORTED
599 * - @ref BT_BAP_ASCS_RSP_CODE_NO_MEM
600 * - @ref BT_BAP_ASCS_RSP_CODE_UNSPECIFIED
609 * - @ref BT_BAP_ASCS_RSP_CODE_METADATA_UNSUPPORTED
610 * - @ref BT_BAP_ASCS_RSP_CODE_METADATA_REJECTED
621 * @param r Reason field - @ref bt_bap_ascs_reason or @ref bt_audio_metadata_type (see notes in
669 /** The 24-bit broadcast ID */
753 * @param broadcast_code The 16-octet broadcast code
759 * @brief Broadcast Isochronous Stream synchronize request
762 * Isochronous Stream states. The request shall be fulfilled with
794 /** Structure holding information of audio stream endpoint */
808 /** @brief True if the stream associated with the endpoint is able to send data */
811 /** @brief True if the stream associated with the endpoint is able to receive data */
824 * @brief Return structure holding information of audio stream endpoint
826 * @param ep The audio stream endpoint object.
830 * @retval -EINVAL if @p ep or @p info are NULL
835 * @brief Basic Audio Profile stream structure.
837 * Streams represents a stream configuration of a Remote Endpoint and a Local Capability.
840 * connected isochronous stream.
855 /** Audio stream operations */
858 /** Stream user data */
871 /** Unicast or Broadcast group - Used internally */
884 /** @brief Stream operation. */
888 * @brief Stream configured callback
890 * Configured callback is called whenever an Audio Stream has been configured.
892 * @param stream Stream object that has been configured.
895 void (*configured)(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg_pref *pref);
898 * @brief Stream QoS set callback
900 * QoS set callback is called whenever an Audio Stream Quality of Service has been set or
903 * @param stream Stream object that had its QoS updated.
905 void (*qos_set)(struct bt_bap_stream *stream);
908 * @brief Stream enabled callback
910 * Enabled callback is called whenever an Audio Stream has been enabled.
912 * @param stream Stream object that has been enabled.
914 void (*enabled)(struct bt_bap_stream *stream);
917 * @brief Stream metadata updated callback
919 * Metadata Updated callback is called whenever an Audio Stream's metadata has been
922 * @param stream Stream object that had its metadata updated.
924 void (*metadata_updated)(struct bt_bap_stream *stream);
927 * @brief Stream disabled callback
929 * Disabled callback is called whenever an Audio Stream has been disabled.
931 * @param stream Stream object that has been disabled.
933 void (*disabled)(struct bt_bap_stream *stream);
936 * @brief Stream released callback
938 * Released callback is called whenever a Audio Stream has been released and can be
941 * @param stream Stream object that has been released.
943 void (*released)(struct bt_bap_stream *stream);
947 * @brief Stream started callback
949 * Started callback is called whenever an Audio Stream has been started
952 * @param stream Stream object that has been started.
954 void (*started)(struct bt_bap_stream *stream);
957 * @brief Stream stopped callback
959 * Stopped callback is called whenever an Audio Stream has been stopped.
961 * @param stream Stream object that has been stopped.
964 void (*stopped)(struct bt_bap_stream *stream, uint8_t reason);
968 * @brief Stream audio HCI receive callback.
972 * @param stream Stream object.
978 void (*recv)(struct bt_bap_stream *stream, const struct bt_iso_recv_info *info,
984 * @brief Stream audio HCI sent callback
993 * @param stream Stream object.
995 void (*sent)(struct bt_bap_stream *stream);
1002 * stream has been connected. This does not mean that the stream is ready to be used, which
1005 * If the stream shares an isochronous channel with another stream, then this callback may
1006 * still be called, without the stream going into the started state.
1008 * @param stream Stream object.
1010 void (*connected)(struct bt_bap_stream *stream);
1018 * If the stream shares an isochronous channel with another stream, then this callback may
1019 * not be called, even if the stream is leaving the streaming state.
1021 * @param stream Stream object.
1024 void (*disconnected)(struct bt_bap_stream *stream, uint8_t reason);
1044 * @brief Register Audio callbacks for a stream.
1046 * Register Audio callbacks for a stream.
1048 * @param stream Stream object.
1049 * @param ops Stream operations structure.
1051 void bt_bap_stream_cb_register(struct bt_bap_stream *stream, struct bt_bap_stream_ops *ops);
1054 * @brief Configure Audio Stream
1056 * This procedure is used by a client to configure a new stream using the
1060 * @param stream Stream object being configured
1064 * @return Allocated Audio Stream object or NULL in case of error.
1066 int bt_bap_stream_config(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_bap_ep *ep,
1070 * @brief Reconfigure Audio Stream
1073 * a stream to use a different local codec configuration.
1077 * @param stream Stream object being reconfigured
1082 int bt_bap_stream_reconfig(struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg);
1085 * @brief Configure Audio Stream QoS
1099 * @brief Enable Audio Stream
1101 * This procedure is used by a client to enable a stream.
1106 * @param stream Stream object
1112 int bt_bap_stream_enable(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len);
1115 * @brief Change Audio Stream Metadata
1117 * This procedure is used by a unicast client or unicast server to change the metadata of a stream.
1119 * @param stream Stream object
1125 int bt_bap_stream_metadata(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len);
1128 * @brief Disable Audio Stream
1130 * This procedure is used by a unicast client or unicast server to disable a stream.
1135 * @param stream Stream object
1139 int bt_bap_stream_disable(struct bt_bap_stream *stream);
1142 * @brief Connect unicast audio stream
1144 * This procedure is used by a unicast client to connect the connected isochronous stream (CIS)
1145 * associated with the audio stream. If two audio streams share a CIS, then this only needs to be
1154 * @param stream Stream object
1157 * @retval -EINVAL if the stream, endpoint, ISO channel or connection is NULL
1158 * @retval -EBADMSG if the stream or ISO channel is in an invalid state for connection
1159 * @retval -EOPNOTSUPP if the role of the stream is not @ref BT_HCI_ROLE_CENTRAL
1160 * @retval -EALREADY if the ISO channel is already connecting or connected
1161 * @retval -EBUSY if another ISO channel is connecting
1162 * @retval -ENOEXEC if otherwise rejected by the ISO layer
1164 int bt_bap_stream_connect(struct bt_bap_stream *stream);
1167 * @brief Start Audio Stream
1169 * This procedure is used by a unicast client or unicast server to make a stream start streaming.
1176 * for @ref BT_AUDIO_DIR_SINK ASEs. If the CIS is not connected yet, the stream will go into the
1184 * @param stream Stream object
1188 int bt_bap_stream_start(struct bt_bap_stream *stream);
1191 * @brief Stop Audio Stream
1193 * This procedure is used by a client to make a stream stop streaming.
1199 * @param stream Stream object
1202 * @retval -EINVAL The @p stream does not have an endpoint or a connection, of the stream's
1204 * @retval -EBADMSG The state of the @p stream endpoint is not @ref BT_BAP_EP_STATE_DISABLING
1205 * @retval -EALREADY The CIS state of the @p is not in a connected state, and thus is already
1207 * @retval -EBUSY The @p stream is busy with another operation
1208 * @retval -ENOTCONN The @p stream ACL connection is not connected
1209 * @retval -ENOMEM No memory to send request
1210 * @retval -ENOEXEC The request was rejected by GATT
1213 int bt_bap_stream_stop(struct bt_bap_stream *stream);
1216 * @brief Release Audio Stream
1218 * This procedure is used by a unicast client or unicast server to release a unicast stream.
1224 * @param stream Stream object
1228 int bt_bap_stream_release(struct bt_bap_stream *stream);
1231 * @brief Send data to Audio stream without timestamp
1233 * Send data from buffer to the stream.
1237 * @param stream Stream object.
1244 int bt_bap_stream_send(struct bt_bap_stream *stream, struct net_buf *buf, uint16_t seq_num);
1247 * @brief Send data to Audio stream with timestamp
1249 * Send data from buffer to the stream.
1253 * @param stream Stream object.
1262 int bt_bap_stream_send_ts(struct bt_bap_stream *stream, struct net_buf *buf, uint16_t seq_num,
1266 * @brief Get ISO transmission timing info for a Basic Audio Profile stream
1275 * @param[in] stream Stream object.
1279 * @retval -EINVAL if the stream is invalid, if the stream is not configured for sending or if it is
1280 * not connected with a isochronous stream
1283 int bt_bap_stream_get_tx_sync(struct bt_bap_stream *stream, struct bt_iso_tx_info *info);
1303 * @param[out] stream Pointer to stream that will be configured for the endpoint.
1307 * value is non-zero.
1312 const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream,
1316 * @brief Stream reconfig request callback
1318 * Reconfig callback is called whenever an Audio Stream needs to be
1321 * @param[in] stream Stream object being reconfigured.
1327 * value is non-zero.
1331 int (*reconfig)(struct bt_bap_stream *stream, enum bt_audio_dir dir,
1336 * @brief Stream QoS request callback
1338 * QoS callback is called whenever an Audio Stream Quality of
1341 * @param[in] stream Stream object being reconfigured.
1344 * value is non-zero.
1348 int (*qos)(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos,
1352 * @brief Stream Enable request callback
1354 * Enable callback is called whenever an Audio Stream is requested to be enabled to stream.
1356 * @param[in] stream Stream object being enabled.
1360 * value is non-zero.
1364 int (*enable)(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len,
1368 * @brief Stream Start request callback
1370 * Start callback is called whenever an Audio Stream is requested to start streaming.
1372 * @param[in] stream Stream object.
1374 * value is non-zero.
1378 int (*start)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp);
1381 * @brief Stream Metadata update request callback
1383 * Metadata callback is called whenever an Audio Stream is requested to update its metadata.
1385 * @param[in] stream Stream object.
1389 * value is non-zero.
1393 int (*metadata)(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len,
1397 * @brief Stream Disable request callback
1399 * Disable callback is called whenever an Audio Stream is requested to disable the stream.
1401 * @param[in] stream Stream object being disabled.
1403 * value is non-zero.
1407 int (*disable)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp);
1410 * @brief Stream Stop callback
1412 * Stop callback is called whenever an Audio Stream is requested to stop streaming.
1414 * @param[in] stream Stream object.
1416 * value is non-zero.
1420 int (*stop)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp);
1423 * @brief Stream release callback
1425 * Release callback is called whenever a new Audio Stream needs to be released and thus
1428 * @param[in] stream Stream object.
1430 * value is non-zero.
1434 int (*release)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp);
1459 * in a non-idle state.
1486 * in a non-idle state.
1516 * @param stream Configured stream object to be attached to the ASE
1518 * @param qos_pref Audio Stream Quality of Service Preference
1522 int bt_bap_unicast_server_config_ase(struct bt_conn *conn, struct bt_bap_stream *stream,
1534 /** Parameter struct for each stream in the unicast group */
1536 /** Pointer to a stream object. */
1537 struct bt_bap_stream *stream; member
1539 /** The QoS settings for the stream object. */
1550 /** Pointer to a receiving stream parameters. */
1553 /** Pointer to a transmitting stream parameters. */
1562 /** Array of stream parameters */
1566 * @brief Unicast Group packing mode.
1649 * Once a stream has been added to a unicast group, it cannot be removed. To remove a stream from a
1654 * @param params Array of stream parameters with streams being added to the group.
1711 * @param stream Stream the operation was performed on.
1715 void (*config)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1722 * This will be called for each stream in the group that was being QoS
1725 * @param stream Stream the operation was performed on. May be NULL if there is no stream
1730 void (*qos)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1738 * @param stream Stream the operation was performed on. May be NULL if there is no stream
1743 void (*enable)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1750 * only be called if the stream supplied to bt_bap_stream_start() is
1753 * @param stream Stream the operation was performed on. May be NULL if there is no stream
1758 void (*start)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1765 * only be called if the stream supplied to bt_bap_stream_stop() is
1768 * @param stream Stream the operation was performed on. May be NULL if there is no stream
1773 void (*stop)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1781 * @param stream Stream the operation was performed on. May be NULL if there is no stream
1786 void (*disable)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1794 * @param stream Stream the operation was performed on. May be NULL if there is no stream
1799 void (*metadata)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1807 * @param stream Stream the operation was performed on. May be NULL if there is no stream
1812 void (*release)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1833 * @brief Remote Audio Stream Endpoint (ASE) discovered
1874 * @retval -EINVAL @p cb is NULL.
1875 * @retval -EEXIST @p cb is already registered.
1938 * @retval -EINVAL if arguments are invalid
1948 * @retval -EINVAL if arguments are invalid
1949 * @retval The 24-bit presentation delay value
1958 * @retval -EINVAL if arguments are invalid
1959 * @retval The 8-bit subgroup count value
1967 * @param[out] bis_indexes 32-bit BIS index bitfield that will be populated
1969 * @retval -EINVAL if arguments are invalid
1981 * @retval -EINVAL if arguments are invalid
1982 * @retval -ECANCELED if iterating over the subgroups stopped prematurely by @p func
1996 * @retval -EINVAL if arguments are invalid
2008 * @retval -EINVAL if arguments are invalid
2020 * @retval -EINVAL if arguments are invalid
2032 * @retval -EINVAL if arguments are invalid
2033 * @retval -ENOMEM if the @p codec_cfg cannot store the @p subgroup codec data
2044 * @retval -EINVAL if arguments are invalid
2045 * @retval The 8-bit BIS count value
2053 * @param[out] bis_indexes 32-bit BIS index bitfield that will be populated
2055 * @retval -EINVAL if arguments are invalid
2068 * @retval -EINVAL if arguments are invalid
2069 * @retval -ECANCELED if iterating over the subgroups stopped prematurely by @p func
2086 * @retval -EINVAL if arguments are invalid
2087 * @retval -ENOMEM if the @p codec_cfg cannot store the @p subgroup codec data
2135 * @retval -EINVAL if @p cb is NULL
2136 * @retval -EEXIST if @p cb is already registered
2146 * @retval -EINVAL if @p cb is NULL
2147 * @retval -ENOENT if @p cb is not registered
2151 /** Broadcast Source stream parameters */
2153 /** Audio stream */
2154 struct bt_bap_stream *stream; member
2174 /** Array of stream parameters */
2186 /** Array of stream parameters */
2193 * @brief Broadcast Source packing mode.
2227 * @brief Pre-transmission offset
2229 * Offset used for pre-transmissions.
2275 * the Broadcast Source, only the first @p param.params_count subgroups are updated. If a stream
2276 * exist in a subgroup not part of @p param, then that stream is left as is (i.e. it is not removed;
2277 * the only way to remove a stream from a Broadcast Source is to recreate the Broadcast Source).
2341 * @brief Get the Broadcast Audio Stream Endpoint of a broadcast source
2344 * advertisement. The encoded BASE will thus be encoded as little-endian. The BASE shall be put into
2388 * bt_bap_broadcast_sink_sync() to synchronize to the audio stream(s).
2427 * @retval -EINVAL if @p cb is NULL
2428 * @retval -EALREADY if @p cb was already registered
2445 * @param broadcast_id 24-bit broadcast ID.
2459 * @param streams Stream object pointers to be used for the receiver. If multiple BIS
2461 * @param broadcast_code The 16-octet broadcast code. Shall be supplied if the broadcast is
2566 /** The 24-bit broadcast ID */
2599 /** The 24-bit broadcast ID */
2713 * @param broadcast_id 24-bit broadcast ID.
2801 * @retval -EINVAL @p conn is NULL
2802 * @retval -EBUSY Another operation is already in progress for this @p conn
2803 * @retval -ENOTCONN @p conn is not connected
2804 * @retval -ENOMEM Could not allocated memory for the request
2805 * @retval -ENOEXEC Unexpected GATT error
2826 * @retval -EINVAL @p conn is NULL of if @p conn has not done discovery
2827 * @retval -EBUSY Another operation is already in progress for this @p conn
2828 * @retval -EAGAIN Bluetooth has not been enabled.
2829 * @retval -ENOTCONN @p conn is not connected
2830 * @retval -ENOMEM Could not allocated memory for the request
2831 * @retval -ENOEXEC Unexpected scan or GATT error
2842 * @retval -EINVAL @p conn is NULL of if @p conn has not done discovery
2843 * @retval -EBUSY Another operation is already in progress for this @p conn
2844 * @retval -EAGAIN Bluetooth has not been enabled.
2845 * @retval -ENOTCONN @p conn is not connected
2846 * @retval -ENOMEM Could not allocated memory for the request
2847 * @retval -ENOEXEC Unexpected scan or GATT error
2857 * @retval -EINVAL if @p cb is NULL
2858 * @retval -EALREADY if @p cb was already registered
2868 * @retval -EINVAL if @p cb is NULL
2869 * @retval -EALREADY if @p cb was not registered
2885 /** 24-bit broadcast ID */
2913 * @retval -EINVAL @p conn is NULL or %p conn has not done discovery or if @p param is invalid
2914 * @retval -EBUSY Another operation is already in progress for this @p conn
2915 * @retval -ENOTCONN @p conn is not connected
2916 * @retval -ENOMEM Could not allocated memory for the request
2917 * @retval -ENOEXEC Unexpected scan or GATT error
2951 * @retval -EINVAL @p conn is NULL or %p conn has not done discovery or if @p param is invalid
2952 * @retval -EBUSY Another operation is already in progress for this @p conn
2953 * @retval -ENOTCONN @p conn is not connected
2954 * @retval -ENOMEM Could not allocated memory for the request
2955 * @retval -ENOEXEC Unexpected scan or GATT error
2968 * @retval -EINVAL @p conn is NULL or %p conn has not done discovery or @p src_id is invalid
2969 * @retval -EBUSY Another operation is already in progress for this @p conn
2970 * @retval -ENOTCONN @p conn is not connected
2971 * @retval -ENOMEM Could not allocated memory for the request
2972 * @retval -ENOEXEC Unexpected scan or GATT error
2985 * @retval -EINVAL @p conn is NULL or %p conn has not done discovery or @p src_id is invalid
2986 * @retval -EBUSY Another operation is already in progress for this @p conn
2987 * @retval -ENOTCONN @p conn is not connected
2988 * @retval -ENOMEM Could not allocated memory for the request
2989 * @retval -ENOEXEC Unexpected scan or GATT error
3001 * @retval -EINVAL @p conn is NULL or %p conn has not done discovery or @p src_id is invalid
3002 * @retval -EBUSY Another operation is already in progress for this @p conn
3003 * @retval -ENOTCONN @p conn is not connected
3004 * @retval -ENOMEM Could not allocated memory for the request
3005 * @retval -ENOEXEC Unexpected scan or GATT error