Bluetooth: Audio: Rename stream_lang to lang
Remove the "stream" part of the value and functions to better fit with the name in the assigned numbers document. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
57af793bb4
commit
f08bc644a1
9 changed files with 78 additions and 75 deletions
|
@ -54,7 +54,7 @@ Commands
|
|||
[pref_ctx <context>]
|
||||
[stream_ctx <context>]
|
||||
[program_info <program info>]
|
||||
[stream_lang <ISO 639-3 lang>]
|
||||
[lang <ISO 639-3 lang>]
|
||||
[ccid_list <ccids>]
|
||||
[parental_rating <rating>]
|
||||
[program_info_uri <URI>]
|
||||
|
@ -336,7 +336,7 @@ any stream previously configured.
|
|||
[pref_ctx <context>]
|
||||
[stream_ctx <context>]
|
||||
[program_info <program info>]
|
||||
[stream_lang <ISO 639-3 lang>]
|
||||
[lang <ISO 639-3 lang>]
|
||||
[ccid_list <ccids>]
|
||||
[parental_rating <rating>]
|
||||
[program_info_uri <URI>]
|
||||
|
@ -415,7 +415,7 @@ assigned numbers values.
|
|||
00000000: 08 00 |.. |
|
||||
QoS: interval 10000 framing 0x00 phy 0x02 sdu 80 rtn 2 latency 10 pd 40000
|
||||
|
||||
uart:~$ bap preset sink 32_2_1 config freq 10 meta stream_lang "eng" stream_ctx 4
|
||||
uart:~$ bap preset sink 32_2_1 config freq 10 meta lang "eng" stream_ctx 4
|
||||
32_2_1
|
||||
codec cfg id 0x06 cid 0x0000 vid 0x0000 count 16
|
||||
data #0: type 0x01 value_len 1
|
||||
|
|
|
@ -504,6 +504,16 @@ Bluetooth Audio
|
|||
the :c:func:`bt_bap_stream_connect` shall now be called before :c:func:`bt_bap_stream_start`.
|
||||
(:github:`73032`)
|
||||
|
||||
* Renamed ``stream_lang`` to just ``lang`` to better fit with the assigned numbers document.
|
||||
This affects the ``BT_AUDIO_METADATA_TYPE_LANG`` macro and the following functions:
|
||||
|
||||
* :c:func:`bt_audio_codec_cap_meta_set_lang`
|
||||
* :c:func:`bt_audio_codec_cap_meta_get_lang`
|
||||
* :c:func:`bt_audio_codec_cfg_meta_set_lang`
|
||||
* :c:func:`bt_audio_codec_cfg_meta_get_lang`
|
||||
|
||||
(:github:`72584`)
|
||||
|
||||
* All occurrences of ``set_sirk`` have been changed to just ``sirk`` as the ``s`` in ``sirk`` stands
|
||||
for set. (:github:`73413`)
|
||||
|
||||
|
|
|
@ -380,11 +380,11 @@ enum bt_audio_metadata_type {
|
|||
/** UTF-8 encoded title or summary of stream content */
|
||||
BT_AUDIO_METADATA_TYPE_PROGRAM_INFO = 0x03,
|
||||
|
||||
/** @brief Stream language
|
||||
/** @brief Language
|
||||
*
|
||||
* 3 octet lower case language code defined by ISO 639-3
|
||||
*/
|
||||
BT_AUDIO_METADATA_TYPE_STREAM_LANG = 0x04,
|
||||
BT_AUDIO_METADATA_TYPE_LANG = 0x04,
|
||||
|
||||
/** Array of 8-bit CCID values */
|
||||
BT_AUDIO_METADATA_TYPE_CCID_LIST = 0x05,
|
||||
|
@ -1250,31 +1250,30 @@ int bt_audio_codec_cfg_meta_get_program_info(const struct bt_audio_codec_cfg *co
|
|||
int bt_audio_codec_cfg_meta_set_program_info(struct bt_audio_codec_cfg *codec_cfg,
|
||||
const uint8_t *program_info, size_t program_info_len);
|
||||
|
||||
/** @brief Extract stream language
|
||||
/** @brief Extract language
|
||||
*
|
||||
* See @ref BT_AUDIO_METADATA_TYPE_STREAM_LANG for more information about this value.
|
||||
* See @ref BT_AUDIO_METADATA_TYPE_LANG for more information about this value.
|
||||
*
|
||||
* @param codec_cfg The codec data to search in.
|
||||
*
|
||||
* @retval The stream language if positive or 0
|
||||
* @retval The language if positive or 0
|
||||
* @retval -EINVAL if arguments are invalid
|
||||
* @retval -ENODATA if not found
|
||||
* @retval -EBADMSG if found value has invalid size
|
||||
*/
|
||||
int bt_audio_codec_cfg_meta_get_stream_lang(const struct bt_audio_codec_cfg *codec_cfg);
|
||||
int bt_audio_codec_cfg_meta_get_lang(const struct bt_audio_codec_cfg *codec_cfg);
|
||||
|
||||
/**
|
||||
* @brief Set the stream language of a codec configuration metadata.
|
||||
* @brief Set the language of a codec configuration metadata.
|
||||
*
|
||||
* @param codec_cfg The codec configuration to set data for.
|
||||
* @param stream_lang The 24-bit stream language to set.
|
||||
* @param lang The 24-bit language to set.
|
||||
*
|
||||
* @retval The data_len of @p codec_cfg on success
|
||||
* @retval -EINVAL if arguments are invalid
|
||||
* @retval -ENOMEM if the new value could not set or added due to memory
|
||||
*/
|
||||
int bt_audio_codec_cfg_meta_set_stream_lang(struct bt_audio_codec_cfg *codec_cfg,
|
||||
uint32_t stream_lang);
|
||||
int bt_audio_codec_cfg_meta_set_lang(struct bt_audio_codec_cfg *codec_cfg, uint32_t lang);
|
||||
|
||||
/** @brief Extract CCID list
|
||||
*
|
||||
|
@ -1773,31 +1772,30 @@ int bt_audio_codec_cap_meta_get_program_info(const struct bt_audio_codec_cap *co
|
|||
int bt_audio_codec_cap_meta_set_program_info(struct bt_audio_codec_cap *codec_cap,
|
||||
const uint8_t *program_info, size_t program_info_len);
|
||||
|
||||
/** @brief Extract stream language
|
||||
/** @brief Extract language
|
||||
*
|
||||
* See @ref BT_AUDIO_METADATA_TYPE_STREAM_LANG for more information about this value.
|
||||
* See @ref BT_AUDIO_METADATA_TYPE_LANG for more information about this value.
|
||||
*
|
||||
* @param codec_cap The codec data to search in.
|
||||
*
|
||||
* @retval The stream language if positive or 0
|
||||
* @retval The language if positive or 0
|
||||
* @retval -EINVAL if arguments are invalid
|
||||
* @retval -ENODATA if not found
|
||||
* @retval -EBADMSG if found value has invalid size
|
||||
*/
|
||||
int bt_audio_codec_cap_meta_get_stream_lang(const struct bt_audio_codec_cap *codec_cap);
|
||||
int bt_audio_codec_cap_meta_get_lang(const struct bt_audio_codec_cap *codec_cap);
|
||||
|
||||
/**
|
||||
* @brief Set the stream language of a codec capability metadata.
|
||||
* @brief Set the language of a codec capability metadata.
|
||||
*
|
||||
* @param codec_cap The codec capability to set data for.
|
||||
* @param stream_lang The 24-bit stream language to set.
|
||||
* @param lang The 24-bit language to set.
|
||||
*
|
||||
* @retval The data_len of @p codec_cap on success
|
||||
* @retval -EINVAL if arguments are invalid
|
||||
* @retval -ENOMEM if the new value could not set or added due to memory
|
||||
*/
|
||||
int bt_audio_codec_cap_meta_set_stream_lang(struct bt_audio_codec_cap *codec_cap,
|
||||
uint32_t stream_lang);
|
||||
int bt_audio_codec_cap_meta_set_lang(struct bt_audio_codec_cap *codec_cap, uint32_t lang);
|
||||
|
||||
/** @brief Extract CCID list
|
||||
*
|
||||
|
|
|
@ -2112,7 +2112,7 @@ static bool ascs_parse_metadata(struct bt_data *data, void *user_data)
|
|||
|
||||
break;
|
||||
}
|
||||
case BT_AUDIO_METADATA_TYPE_STREAM_LANG:
|
||||
case BT_AUDIO_METADATA_TYPE_LANG:
|
||||
if (data_len != 3) {
|
||||
*result->rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_METADATA_INVALID,
|
||||
data_type);
|
||||
|
|
|
@ -804,7 +804,7 @@ static int codec_meta_set_program_info(uint8_t meta[], size_t meta_len, size_t m
|
|||
program_info, program_info_len);
|
||||
}
|
||||
|
||||
static int codec_meta_get_stream_lang(const uint8_t meta[], size_t meta_len)
|
||||
static int codec_meta_get_lang(const uint8_t meta[], size_t meta_len)
|
||||
{
|
||||
const uint8_t *data;
|
||||
int ret;
|
||||
|
@ -814,37 +814,36 @@ static int codec_meta_get_stream_lang(const uint8_t meta[], size_t meta_len)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_STREAM_LANG, &data);
|
||||
ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_LANG, &data);
|
||||
if (data == NULL) {
|
||||
return -ENODATA;
|
||||
}
|
||||
|
||||
if (ret != 3) { /* Stream language is 3 octets */
|
||||
if (ret != 3) { /* Language is 3 octets */
|
||||
return -EBADMSG;
|
||||
}
|
||||
|
||||
return sys_get_le24(data);
|
||||
}
|
||||
|
||||
static int codec_meta_set_stream_lang(uint8_t meta[], size_t meta_len, size_t meta_size,
|
||||
uint32_t stream_lang)
|
||||
static int codec_meta_set_lang(uint8_t meta[], size_t meta_len, size_t meta_size, uint32_t lang)
|
||||
{
|
||||
uint8_t stream_lang_le[3];
|
||||
uint8_t lang_le[3];
|
||||
|
||||
CHECKIF(meta == NULL) {
|
||||
LOG_DBG("meta is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((stream_lang & 0xFFFFFFU) != stream_lang) {
|
||||
LOG_DBG("Invalid stream_lang value: %d", stream_lang);
|
||||
if ((lang & 0xFFFFFFU) != lang) {
|
||||
LOG_DBG("Invalid lang value: %d", lang);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
sys_put_le24(stream_lang, stream_lang_le);
|
||||
sys_put_le24(lang, lang_le);
|
||||
|
||||
return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_STREAM_LANG,
|
||||
stream_lang_le, sizeof(stream_lang_le));
|
||||
return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_LANG, lang_le,
|
||||
sizeof(lang_le));
|
||||
}
|
||||
|
||||
static int codec_meta_get_ccid_list(const uint8_t meta[], size_t meta_len,
|
||||
|
@ -1256,23 +1255,22 @@ int bt_audio_codec_cfg_meta_set_program_info(struct bt_audio_codec_cfg *codec_cf
|
|||
return ret;
|
||||
}
|
||||
|
||||
int bt_audio_codec_cfg_meta_get_stream_lang(const struct bt_audio_codec_cfg *codec_cfg)
|
||||
int bt_audio_codec_cfg_meta_get_lang(const struct bt_audio_codec_cfg *codec_cfg)
|
||||
{
|
||||
CHECKIF(codec_cfg == NULL) {
|
||||
LOG_DBG("codec_cfg is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return codec_meta_get_stream_lang(codec_cfg->meta, codec_cfg->meta_len);
|
||||
return codec_meta_get_lang(codec_cfg->meta, codec_cfg->meta_len);
|
||||
}
|
||||
|
||||
int bt_audio_codec_cfg_meta_set_stream_lang(struct bt_audio_codec_cfg *codec_cfg,
|
||||
uint32_t stream_lang)
|
||||
int bt_audio_codec_cfg_meta_set_lang(struct bt_audio_codec_cfg *codec_cfg, uint32_t lang)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = codec_meta_set_stream_lang(codec_cfg->meta, codec_cfg->meta_len,
|
||||
ARRAY_SIZE(codec_cfg->meta), stream_lang);
|
||||
ret = codec_meta_set_lang(codec_cfg->meta, codec_cfg->meta_len, ARRAY_SIZE(codec_cfg->meta),
|
||||
lang);
|
||||
if (ret >= 0) {
|
||||
codec_cfg->meta_len = ret;
|
||||
}
|
||||
|
@ -1583,23 +1581,22 @@ int bt_audio_codec_cap_meta_set_program_info(struct bt_audio_codec_cap *codec_ca
|
|||
return ret;
|
||||
}
|
||||
|
||||
int bt_audio_codec_cap_meta_get_stream_lang(const struct bt_audio_codec_cap *codec_cap)
|
||||
int bt_audio_codec_cap_meta_get_lang(const struct bt_audio_codec_cap *codec_cap)
|
||||
{
|
||||
CHECKIF(codec_cap == NULL) {
|
||||
LOG_DBG("codec_cap is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return codec_meta_get_stream_lang(codec_cap->meta, codec_cap->meta_len);
|
||||
return codec_meta_get_lang(codec_cap->meta, codec_cap->meta_len);
|
||||
}
|
||||
|
||||
int bt_audio_codec_cap_meta_set_stream_lang(struct bt_audio_codec_cap *codec_cap,
|
||||
uint32_t stream_lang)
|
||||
int bt_audio_codec_cap_meta_set_lang(struct bt_audio_codec_cap *codec_cap, uint32_t lang)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = codec_meta_set_stream_lang(codec_cap->meta, codec_cap->meta_len,
|
||||
ARRAY_SIZE(codec_cap->meta), stream_lang);
|
||||
ret = codec_meta_set_lang(codec_cap->meta, codec_cap->meta_len, ARRAY_SIZE(codec_cap->meta),
|
||||
lang);
|
||||
if (ret >= 0) {
|
||||
codec_cap->meta_len = ret;
|
||||
}
|
||||
|
|
|
@ -373,12 +373,11 @@ static inline void print_codec_meta_program_info(const struct shell *sh, size_t
|
|||
shell_fprintf(sh, SHELL_NORMAL, "\n");
|
||||
}
|
||||
|
||||
static inline void print_codec_meta_language(const struct shell *sh, size_t indent,
|
||||
uint32_t stream_lang)
|
||||
static inline void print_codec_meta_language(const struct shell *sh, size_t indent, uint32_t lang)
|
||||
{
|
||||
uint8_t lang_array[3];
|
||||
|
||||
sys_put_be24(stream_lang, lang_array);
|
||||
sys_put_be24(lang, lang_array);
|
||||
|
||||
shell_print(sh, "%*sLanguage: %c%c%c", indent, "", (char)lang_array[0], (char)lang_array[1],
|
||||
(char)lang_array[2]);
|
||||
|
@ -733,7 +732,7 @@ static inline void print_codec_cap(const struct shell *sh, size_t indent,
|
|||
print_codec_meta_program_info(sh, indent, data, (uint8_t)ret);
|
||||
}
|
||||
|
||||
ret = bt_audio_codec_cap_meta_get_stream_lang(codec_cap);
|
||||
ret = bt_audio_codec_cap_meta_get_lang(codec_cap);
|
||||
if (ret >= 0) {
|
||||
print_codec_meta_language(sh, indent, (uint32_t)ret);
|
||||
}
|
||||
|
@ -969,7 +968,7 @@ static inline void print_codec_cfg(const struct shell *sh, size_t indent,
|
|||
print_codec_meta_program_info(sh, indent, data, (uint8_t)ret);
|
||||
}
|
||||
|
||||
ret = bt_audio_codec_cfg_meta_get_stream_lang(codec_cfg);
|
||||
ret = bt_audio_codec_cfg_meta_get_lang(codec_cfg);
|
||||
if (ret >= 0) {
|
||||
print_codec_meta_language(sh, indent, (uint32_t)ret);
|
||||
}
|
||||
|
|
|
@ -1991,7 +1991,7 @@ static ssize_t parse_config_meta_args(const struct shell *sh, size_t argn, size_
|
|||
|
||||
return -1;
|
||||
}
|
||||
} else if (strcmp(arg, "stream_lang") == 0) {
|
||||
} else if (strcmp(arg, "lang") == 0) {
|
||||
if (++argn == argc) {
|
||||
shell_help(sh);
|
||||
|
||||
|
@ -2001,17 +2001,16 @@ static ssize_t parse_config_meta_args(const struct shell *sh, size_t argn, size_
|
|||
arg = argv[argn];
|
||||
|
||||
if (strlen(arg) != 3) {
|
||||
shell_error(sh, "Failed to parse stream lang from %s", arg);
|
||||
shell_error(sh, "Failed to parse lang from %s", arg);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
val = sys_get_le24(arg);
|
||||
|
||||
err = bt_audio_codec_cfg_meta_set_stream_lang(codec_cfg, (uint32_t)val);
|
||||
err = bt_audio_codec_cfg_meta_set_lang(codec_cfg, (uint32_t)val);
|
||||
if (err < 0) {
|
||||
shell_error(sh, "Failed to set stream lang with value %lu: %d", val,
|
||||
err);
|
||||
shell_error(sh, "Failed to set lang with value %lu: %d", val, err);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -3967,7 +3966,7 @@ static int cmd_print_ase_info(const struct shell *sh, size_t argc, char *argv[])
|
|||
|
||||
#define HELP_CFG_META \
|
||||
"\n[meta" HELP_SEP "[pref_ctx <context>]" HELP_SEP "[stream_ctx <context>]" HELP_SEP \
|
||||
"[program_info <program info>]" HELP_SEP "[stream_lang <ISO 639-3 lang>]" HELP_SEP \
|
||||
"[program_info <program info>]" HELP_SEP "[lang <ISO 639-3 lang>]" HELP_SEP \
|
||||
"[ccid_list <ccids>]" HELP_SEP "[parental_rating <rating>]" HELP_SEP \
|
||||
"[program_info_uri <URI>]" HELP_SEP "[audio_active_state <state>]" HELP_SEP \
|
||||
"[bcast_flag]" HELP_SEP "[extended <meta>]" HELP_SEP "[vendor <meta>]]"
|
||||
|
|
|
@ -515,35 +515,35 @@ ZTEST(audio_codec_test_suite, test_bt_audio_codec_cfg_meta_set_program_info)
|
|||
zassert_mem_equal(new_expected_data, program_data, ARRAY_SIZE(new_expected_data));
|
||||
}
|
||||
|
||||
ZTEST(audio_codec_test_suite, test_bt_audio_codec_cfg_meta_get_stream_lang)
|
||||
ZTEST(audio_codec_test_suite, test_bt_audio_codec_cfg_meta_get_lang)
|
||||
{
|
||||
const uint32_t expected_data = sys_get_le24((uint8_t[]){'e', 'n', 'g'});
|
||||
const struct bt_audio_codec_cfg codec_cfg = BT_AUDIO_CODEC_CFG(
|
||||
BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, {},
|
||||
{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_STREAM_LANG, 'e', 'n', 'g')});
|
||||
{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_LANG, 'e', 'n', 'g')});
|
||||
int ret;
|
||||
|
||||
ret = bt_audio_codec_cfg_meta_get_stream_lang(&codec_cfg);
|
||||
ret = bt_audio_codec_cfg_meta_get_lang(&codec_cfg);
|
||||
zassert_equal(ret, expected_data, "Unexpected return value %d", ret);
|
||||
}
|
||||
|
||||
ZTEST(audio_codec_test_suite, test_bt_audio_codec_cfg_meta_set_stream_lang)
|
||||
ZTEST(audio_codec_test_suite, test_bt_audio_codec_cfg_meta_set_lang)
|
||||
{
|
||||
const uint32_t expected_data = sys_get_le24((uint8_t[]){'e', 'n', 'g'});
|
||||
const uint32_t new_expected_data = sys_get_le24((uint8_t[]){'d', 'e', 'u'});
|
||||
struct bt_audio_codec_cfg codec_cfg = BT_AUDIO_CODEC_CFG(
|
||||
BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, {},
|
||||
{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_STREAM_LANG, 'e', 'n', 'g')});
|
||||
const uint32_t new_stream_lang = sys_le32_to_cpu(new_expected_data);
|
||||
{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_LANG, 'e', 'n', 'g')});
|
||||
const uint32_t new_lang = sys_le32_to_cpu(new_expected_data);
|
||||
int ret;
|
||||
|
||||
ret = bt_audio_codec_cfg_meta_get_stream_lang(&codec_cfg);
|
||||
ret = bt_audio_codec_cfg_meta_get_lang(&codec_cfg);
|
||||
zassert_equal(ret, expected_data, "Unexpected return value %d", ret);
|
||||
|
||||
ret = bt_audio_codec_cfg_meta_set_stream_lang(&codec_cfg, new_stream_lang);
|
||||
ret = bt_audio_codec_cfg_meta_set_lang(&codec_cfg, new_lang);
|
||||
zassert_true(ret > 0, "Unexpected return value %d", ret);
|
||||
|
||||
ret = bt_audio_codec_cfg_meta_get_stream_lang(&codec_cfg);
|
||||
ret = bt_audio_codec_cfg_meta_get_lang(&codec_cfg);
|
||||
zassert_equal(ret, new_expected_data, "Unexpected return value %d", ret);
|
||||
}
|
||||
|
||||
|
@ -1408,35 +1408,35 @@ ZTEST(audio_codec_test_suite, test_bt_audio_codec_cap_meta_set_program_info)
|
|||
zassert_mem_equal(new_expected_data, program_data, ARRAY_SIZE(new_expected_data));
|
||||
}
|
||||
|
||||
ZTEST(audio_codec_test_suite, test_bt_audio_codec_cap_meta_get_stream_lang)
|
||||
ZTEST(audio_codec_test_suite, test_bt_audio_codec_cap_meta_get_lang)
|
||||
{
|
||||
const uint32_t expected_data = sys_get_le24((uint8_t[]){'e', 'n', 'g'});
|
||||
const struct bt_audio_codec_cap codec_cap = BT_AUDIO_CODEC_CAP(
|
||||
BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, {},
|
||||
{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_STREAM_LANG, 'e', 'n', 'g')});
|
||||
{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_LANG, 'e', 'n', 'g')});
|
||||
int ret;
|
||||
|
||||
ret = bt_audio_codec_cap_meta_get_stream_lang(&codec_cap);
|
||||
ret = bt_audio_codec_cap_meta_get_lang(&codec_cap);
|
||||
zassert_equal(ret, expected_data, "Unexpected return value %d", ret);
|
||||
}
|
||||
|
||||
ZTEST(audio_codec_test_suite, test_bt_audio_codec_cap_meta_set_stream_lang)
|
||||
ZTEST(audio_codec_test_suite, test_bt_audio_codec_cap_meta_set_lang)
|
||||
{
|
||||
const uint32_t expected_data = sys_get_le24((uint8_t[]){'e', 'n', 'g'});
|
||||
const uint32_t new_expected_data = sys_get_le24((uint8_t[]){'d', 'e', 'u'});
|
||||
struct bt_audio_codec_cap codec_cap = BT_AUDIO_CODEC_CAP(
|
||||
BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, {},
|
||||
{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_STREAM_LANG, 'e', 'n', 'g')});
|
||||
const uint32_t new_stream_lang = sys_le32_to_cpu(new_expected_data);
|
||||
{BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_LANG, 'e', 'n', 'g')});
|
||||
const uint32_t new_lang = sys_le32_to_cpu(new_expected_data);
|
||||
int ret;
|
||||
|
||||
ret = bt_audio_codec_cap_meta_get_stream_lang(&codec_cap);
|
||||
ret = bt_audio_codec_cap_meta_get_lang(&codec_cap);
|
||||
zassert_equal(ret, expected_data, "Unexpected return value %d", ret);
|
||||
|
||||
ret = bt_audio_codec_cap_meta_set_stream_lang(&codec_cap, new_stream_lang);
|
||||
ret = bt_audio_codec_cap_meta_set_lang(&codec_cap, new_lang);
|
||||
zassert_true(ret > 0, "Unexpected return value %d", ret);
|
||||
|
||||
ret = bt_audio_codec_cap_meta_get_stream_lang(&codec_cap);
|
||||
ret = bt_audio_codec_cap_meta_get_lang(&codec_cap);
|
||||
zassert_equal(ret, new_expected_data, "Unexpected return value %d", ret);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ static inline bool valid_metadata_type(uint8_t type, uint8_t len)
|
|||
}
|
||||
|
||||
return true;
|
||||
case BT_AUDIO_METADATA_TYPE_STREAM_LANG:
|
||||
case BT_AUDIO_METADATA_TYPE_LANG:
|
||||
if (len != 3) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue