Lines Matching refs:codec_cfg
80 struct bt_audio_codec_cfg *codec_cfg) in bt_bap_stream_attach() argument
82 LOG_DBG("conn %p stream %p ep %p codec_cfg %p", (void *)conn, stream, ep, codec_cfg); in bt_bap_stream_attach()
91 stream->codec_cfg = codec_cfg; in bt_bap_stream_attach()
210 bool bt_audio_valid_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg) in bt_audio_valid_codec_cfg() argument
212 if (codec_cfg == NULL) { in bt_audio_valid_codec_cfg()
217 if (codec_cfg->id == BT_HCI_CODING_FORMAT_LC3) { in bt_audio_valid_codec_cfg()
218 if (codec_cfg->cid != 0U) { in bt_audio_valid_codec_cfg()
219 LOG_DBG("codec_cfg->cid (%u) is invalid", codec_cfg->cid); in bt_audio_valid_codec_cfg()
223 if (codec_cfg->vid != 0U) { in bt_audio_valid_codec_cfg()
224 LOG_DBG("codec_cfg->vid (%u) is invalid", codec_cfg->vid); in bt_audio_valid_codec_cfg()
233 if (codec_cfg->id == BT_HCI_CODING_FORMAT_TRANSPARENT && codec_cfg->data_len != 0) { in bt_audio_valid_codec_cfg()
234 LOG_DBG("Invalid data_len %zu for codec_id %u", codec_cfg->data_len, codec_cfg->id); in bt_audio_valid_codec_cfg()
238 if (codec_cfg->data_len > CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE) { in bt_audio_valid_codec_cfg()
239 LOG_DBG("codec_cfg->data_len (%zu) is invalid", codec_cfg->data_len); in bt_audio_valid_codec_cfg()
243 if (codec_cfg->id == BT_HCI_CODING_FORMAT_LC3 && in bt_audio_valid_codec_cfg()
244 !bt_audio_valid_ltv(codec_cfg->data, codec_cfg->data_len)) { in bt_audio_valid_codec_cfg()
251 if (codec_cfg->meta_len > CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE) { in bt_audio_valid_codec_cfg()
252 LOG_DBG("codec_cfg->meta_len (%zu) is invalid", codec_cfg->meta_len); in bt_audio_valid_codec_cfg()
256 if (codec_cfg->id == BT_HCI_CODING_FORMAT_LC3 && in bt_audio_valid_codec_cfg()
257 !bt_audio_valid_ltv(codec_cfg->data, codec_cfg->data_len)) { in bt_audio_valid_codec_cfg()
533 stream->codec_cfg = NULL; in bt_bap_stream_detach()
595 struct bt_audio_codec_cfg *codec_cfg) in bt_bap_stream_config() argument
602 codec_cfg, codec_cfg ? codec_cfg->id : 0, codec_cfg ? codec_cfg->cid : 0, in bt_bap_stream_config()
603 codec_cfg ? codec_cfg->vid : 0); in bt_bap_stream_config()
605 CHECKIF(conn == NULL || stream == NULL || codec_cfg == NULL || ep == NULL) { in bt_bap_stream_config()
634 bt_bap_stream_attach(conn, stream, ep, codec_cfg); in bt_bap_stream_config()
636 err = bt_bap_unicast_client_config(stream, codec_cfg); in bt_bap_stream_config()
754 struct bt_audio_codec_cfg *codec_cfg) in bt_bap_stream_reconfig() argument
760 LOG_DBG("stream %p codec_cfg %p", stream, codec_cfg); in bt_bap_stream_reconfig()
767 CHECKIF(codec_cfg == NULL) { in bt_bap_stream_reconfig()
788 err = bt_bap_unicast_client_config(stream, codec_cfg); in bt_bap_stream_reconfig()
790 err = bt_bap_unicast_server_reconfig(stream, codec_cfg); in bt_bap_stream_reconfig()
798 stream->codec_cfg = codec_cfg; in bt_bap_stream_reconfig()