Lines Matching refs:meta
557 static void init_net_buf_simple_from_meta(struct net_buf_simple *buf, uint8_t meta[], in init_net_buf_simple_from_meta() argument
560 buf->__buf = meta; in init_net_buf_simple_from_meta()
561 buf->data = meta; in init_net_buf_simple_from_meta()
566 static int codec_meta_get_val(const uint8_t meta[], size_t meta_len, in codec_meta_get_val() argument
569 CHECKIF(meta == NULL) { in codec_meta_get_val()
579 return bt_audio_data_get_val(meta, meta_len, (uint8_t)type, data); in codec_meta_get_val()
582 static int codec_meta_set_val(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_val() argument
588 CHECKIF(meta == NULL) { in codec_meta_set_val()
603 init_net_buf_simple_from_meta(&buf, meta, meta_len, meta_size); in codec_meta_set_val()
608 static int codec_meta_unset_val(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_unset_val() argument
613 CHECKIF(meta == NULL) { in codec_meta_unset_val()
618 init_net_buf_simple_from_meta(&buf, meta, meta_len, meta_size); in codec_meta_unset_val()
623 static int codec_meta_get_pref_context(const uint8_t meta[], size_t meta_len) in codec_meta_get_pref_context() argument
628 CHECKIF(meta == NULL) { in codec_meta_get_pref_context()
633 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_PREF_CONTEXT, &data); in codec_meta_get_pref_context()
645 static int codec_meta_set_pref_context(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_pref_context() argument
650 CHECKIF(meta == NULL) { in codec_meta_set_pref_context()
662 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_PREF_CONTEXT, in codec_meta_set_pref_context()
666 static int codec_meta_get_stream_context(const uint8_t meta[], size_t meta_len) in codec_meta_get_stream_context() argument
671 CHECKIF(meta == NULL) { in codec_meta_get_stream_context()
676 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT, &data); in codec_meta_get_stream_context()
688 static int codec_meta_set_stream_context(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_stream_context() argument
693 CHECKIF(meta == NULL) { in codec_meta_set_stream_context()
705 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT, in codec_meta_set_stream_context()
709 static int codec_meta_get_program_info(const uint8_t meta[], size_t meta_len, in codec_meta_get_program_info() argument
715 CHECKIF(meta == NULL) { in codec_meta_get_program_info()
725 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_PROGRAM_INFO, &data); in codec_meta_get_program_info()
735 static int codec_meta_set_program_info(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_program_info() argument
738 CHECKIF(meta == NULL) { in codec_meta_set_program_info()
748 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_PROGRAM_INFO, in codec_meta_set_program_info()
752 static int codec_meta_get_lang(const uint8_t meta[], size_t meta_len, const uint8_t **lang) in codec_meta_get_lang() argument
757 CHECKIF(meta == NULL) { in codec_meta_get_lang()
767 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_LANG, &data); in codec_meta_get_lang()
781 static int codec_meta_set_lang(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_lang() argument
784 CHECKIF(meta == NULL) { in codec_meta_set_lang()
794 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_LANG, lang, in codec_meta_set_lang()
798 static int codec_meta_get_ccid_list(const uint8_t meta[], size_t meta_len, in codec_meta_get_ccid_list() argument
804 CHECKIF(meta == NULL) { in codec_meta_get_ccid_list()
814 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_CCID_LIST, &data); in codec_meta_get_ccid_list()
824 static int codec_meta_set_ccid_list(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_ccid_list() argument
827 CHECKIF(meta == NULL) { in codec_meta_set_ccid_list()
837 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_CCID_LIST, in codec_meta_set_ccid_list()
841 static int codec_meta_get_parental_rating(const uint8_t meta[], size_t meta_len) in codec_meta_get_parental_rating() argument
846 CHECKIF(meta == NULL) { in codec_meta_get_parental_rating()
851 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_PARENTAL_RATING, &data); in codec_meta_get_parental_rating()
863 static int codec_meta_set_parental_rating(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_parental_rating() argument
868 CHECKIF(meta == NULL) { in codec_meta_set_parental_rating()
880 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_PARENTAL_RATING, in codec_meta_set_parental_rating()
884 static int codec_meta_get_program_info_uri(const uint8_t meta[], size_t meta_len, in codec_meta_get_program_info_uri() argument
890 CHECKIF(meta == NULL) { in codec_meta_get_program_info_uri()
900 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI, &data); in codec_meta_get_program_info_uri()
910 static int codec_meta_set_program_info_uri(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_program_info_uri() argument
914 CHECKIF(meta == NULL) { in codec_meta_set_program_info_uri()
924 return codec_meta_set_val(meta, meta_len, meta_size, in codec_meta_set_program_info_uri()
929 static int codec_meta_get_audio_active_state(const uint8_t meta[], size_t meta_len) in codec_meta_get_audio_active_state() argument
934 CHECKIF(meta == NULL) { in codec_meta_get_audio_active_state()
939 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_AUDIO_STATE, &data); in codec_meta_get_audio_active_state()
951 static int codec_meta_set_audio_active_state(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_audio_active_state() argument
956 CHECKIF(meta == NULL) { in codec_meta_set_audio_active_state()
968 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_AUDIO_STATE, in codec_meta_set_audio_active_state()
972 static int codec_meta_get_bcast_audio_immediate_rend_flag(const uint8_t meta[], size_t meta_len) in codec_meta_get_bcast_audio_immediate_rend_flag() argument
976 CHECKIF(meta == NULL) { in codec_meta_get_bcast_audio_immediate_rend_flag()
981 return codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE, in codec_meta_get_bcast_audio_immediate_rend_flag()
985 static int codec_meta_set_bcast_audio_immediate_rend_flag(uint8_t meta[], size_t meta_len, in codec_meta_set_bcast_audio_immediate_rend_flag() argument
988 CHECKIF(meta == NULL) { in codec_meta_set_bcast_audio_immediate_rend_flag()
993 return codec_meta_set_val(meta, meta_len, meta_size, in codec_meta_set_bcast_audio_immediate_rend_flag()
997 static int codec_meta_get_assisted_listening_stream(const uint8_t meta[], size_t meta_len) in codec_meta_get_assisted_listening_stream() argument
1002 CHECKIF(meta == NULL) { in codec_meta_get_assisted_listening_stream()
1007 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_ASSISTED_LISTENING_STREAM, in codec_meta_get_assisted_listening_stream()
1020 static int codec_meta_set_assisted_listening_stream(uint8_t meta[], size_t meta_len, in codec_meta_set_assisted_listening_stream() argument
1026 CHECKIF(meta == NULL) { in codec_meta_set_assisted_listening_stream()
1038 return codec_meta_set_val(meta, meta_len, meta_size, in codec_meta_set_assisted_listening_stream()
1043 static int codec_meta_get_broadcast_name(const uint8_t meta[], size_t meta_len, in codec_meta_get_broadcast_name() argument
1049 CHECKIF(meta == NULL) { in codec_meta_get_broadcast_name()
1059 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_BROADCAST_NAME, &data); in codec_meta_get_broadcast_name()
1069 static int codec_meta_set_broadcast_name(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_broadcast_name() argument
1072 CHECKIF(meta == NULL) { in codec_meta_set_broadcast_name()
1082 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_BROADCAST_NAME, in codec_meta_set_broadcast_name()
1086 static int codec_meta_get_extended(const uint8_t meta[], size_t meta_len, in codec_meta_get_extended() argument
1092 CHECKIF(meta == NULL) { in codec_meta_get_extended()
1102 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_EXTENDED, &data); in codec_meta_get_extended()
1112 static int codec_meta_set_extended(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_extended() argument
1115 CHECKIF(meta == NULL) { in codec_meta_set_extended()
1125 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_EXTENDED, in codec_meta_set_extended()
1129 static int codec_meta_get_vendor(const uint8_t meta[], size_t meta_len, const uint8_t **vendor_meta) in codec_meta_get_vendor() argument
1134 CHECKIF(meta == NULL) { in codec_meta_get_vendor()
1144 ret = codec_meta_get_val(meta, meta_len, BT_AUDIO_METADATA_TYPE_VENDOR, &data); in codec_meta_get_vendor()
1154 static int codec_meta_set_vendor(uint8_t meta[], size_t meta_len, size_t meta_size, in codec_meta_set_vendor() argument
1157 CHECKIF(meta == NULL) { in codec_meta_set_vendor()
1167 return codec_meta_set_val(meta, meta_len, meta_size, BT_AUDIO_METADATA_TYPE_VENDOR, vendor, in codec_meta_set_vendor()
1180 return codec_meta_get_val(codec_cfg->meta, codec_cfg->meta_len, type, data); in bt_audio_codec_cfg_meta_get_val()
1194 ret = codec_meta_set_val(codec_cfg->meta, codec_cfg->meta_len, ARRAY_SIZE(codec_cfg->meta), in bt_audio_codec_cfg_meta_set_val()
1213 ret = codec_meta_unset_val(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_unset_val()
1214 ARRAY_SIZE(codec_cfg->meta), type); in bt_audio_codec_cfg_meta_unset_val()
1232 ret = codec_meta_get_pref_context(codec_cfg->meta, codec_cfg->meta_len); in bt_audio_codec_cfg_meta_get_pref_context()
1246 ret = codec_meta_set_pref_context(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_pref_context()
1247 ARRAY_SIZE(codec_cfg->meta), ctx); in bt_audio_codec_cfg_meta_set_pref_context()
1262 return codec_meta_get_stream_context(codec_cfg->meta, codec_cfg->meta_len); in bt_audio_codec_cfg_meta_get_stream_context()
1270 ret = codec_meta_set_stream_context(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_stream_context()
1271 ARRAY_SIZE(codec_cfg->meta), ctx); in bt_audio_codec_cfg_meta_set_stream_context()
1287 return codec_meta_get_program_info(codec_cfg->meta, codec_cfg->meta_len, program_info); in bt_audio_codec_cfg_meta_get_program_info()
1295 ret = codec_meta_set_program_info(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_program_info()
1296 ARRAY_SIZE(codec_cfg->meta), program_info, in bt_audio_codec_cfg_meta_set_program_info()
1313 return codec_meta_get_lang(codec_cfg->meta, codec_cfg->meta_len, lang); in bt_audio_codec_cfg_meta_get_lang()
1321 ret = codec_meta_set_lang(codec_cfg->meta, codec_cfg->meta_len, ARRAY_SIZE(codec_cfg->meta), in bt_audio_codec_cfg_meta_set_lang()
1338 return codec_meta_get_ccid_list(codec_cfg->meta, codec_cfg->meta_len, ccid_list); in bt_audio_codec_cfg_meta_get_ccid_list()
1346 ret = codec_meta_set_ccid_list(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_ccid_list()
1347 ARRAY_SIZE(codec_cfg->meta), ccid_list, ccid_list_len); in bt_audio_codec_cfg_meta_set_ccid_list()
1362 return codec_meta_get_parental_rating(codec_cfg->meta, codec_cfg->meta_len); in bt_audio_codec_cfg_meta_get_parental_rating()
1370 ret = codec_meta_set_parental_rating(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_parental_rating()
1371 ARRAY_SIZE(codec_cfg->meta), parental_rating); in bt_audio_codec_cfg_meta_set_parental_rating()
1387 return codec_meta_get_program_info_uri(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_get_program_info_uri()
1397 ret = codec_meta_set_program_info_uri(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_program_info_uri()
1398 ARRAY_SIZE(codec_cfg->meta), program_info_uri, in bt_audio_codec_cfg_meta_set_program_info_uri()
1414 return codec_meta_get_audio_active_state(codec_cfg->meta, codec_cfg->meta_len); in bt_audio_codec_cfg_meta_get_audio_active_state()
1422 ret = codec_meta_set_audio_active_state(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_audio_active_state()
1423 ARRAY_SIZE(codec_cfg->meta), state); in bt_audio_codec_cfg_meta_set_audio_active_state()
1439 return codec_meta_get_bcast_audio_immediate_rend_flag(codec_cfg->meta, codec_cfg->meta_len); in bt_audio_codec_cfg_meta_get_bcast_audio_immediate_rend_flag()
1447 ret = codec_meta_set_bcast_audio_immediate_rend_flag(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_bcast_audio_immediate_rend_flag()
1448 ARRAY_SIZE(codec_cfg->meta)); in bt_audio_codec_cfg_meta_set_bcast_audio_immediate_rend_flag()
1464 return codec_meta_get_assisted_listening_stream(codec_cfg->meta, codec_cfg->meta_len); in bt_audio_codec_cfg_meta_get_assisted_listening_stream()
1472 ret = codec_meta_set_assisted_listening_stream(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_assisted_listening_stream()
1473 ARRAY_SIZE(codec_cfg->meta), val); in bt_audio_codec_cfg_meta_set_assisted_listening_stream()
1489 return codec_meta_get_extended(codec_cfg->meta, codec_cfg->meta_len, extended_meta); in bt_audio_codec_cfg_meta_get_extended()
1497 ret = codec_meta_set_extended(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_extended()
1498 ARRAY_SIZE(codec_cfg->meta), extended_meta, in bt_audio_codec_cfg_meta_set_extended()
1515 return codec_meta_get_vendor(codec_cfg->meta, codec_cfg->meta_len, vendor_meta); in bt_audio_codec_cfg_meta_get_vendor()
1523 ret = codec_meta_set_vendor(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_vendor()
1524 ARRAY_SIZE(codec_cfg->meta), vendor_meta, vendor_meta_len); in bt_audio_codec_cfg_meta_set_vendor()
1540 return codec_meta_get_broadcast_name(codec_cfg->meta, codec_cfg->meta_len, broadcast_name); in bt_audio_codec_cfg_meta_get_broadcast_name()
1549 ret = codec_meta_set_broadcast_name(codec_cfg->meta, codec_cfg->meta_len, in bt_audio_codec_cfg_meta_set_broadcast_name()
1550 ARRAY_SIZE(codec_cfg->meta), broadcast_name, in bt_audio_codec_cfg_meta_set_broadcast_name()
1569 return codec_meta_get_val(codec_cap->meta, codec_cap->meta_len, type, data); in bt_audio_codec_cap_meta_get_val()
1583 ret = codec_meta_set_val(codec_cap->meta, codec_cap->meta_len, ARRAY_SIZE(codec_cap->meta), in bt_audio_codec_cap_meta_set_val()
1602 ret = codec_meta_unset_val(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_unset_val()
1603 ARRAY_SIZE(codec_cap->meta), type); in bt_audio_codec_cap_meta_unset_val()
1618 return codec_meta_get_pref_context(codec_cap->meta, codec_cap->meta_len); in bt_audio_codec_cap_meta_get_pref_context()
1626 ret = codec_meta_set_pref_context(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_pref_context()
1627 ARRAY_SIZE(codec_cap->meta), ctx); in bt_audio_codec_cap_meta_set_pref_context()
1642 return codec_meta_get_stream_context(codec_cap->meta, codec_cap->meta_len); in bt_audio_codec_cap_meta_get_stream_context()
1650 ret = codec_meta_set_stream_context(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_stream_context()
1651 ARRAY_SIZE(codec_cap->meta), ctx); in bt_audio_codec_cap_meta_set_stream_context()
1667 return codec_meta_get_program_info(codec_cap->meta, codec_cap->meta_len, program_info); in bt_audio_codec_cap_meta_get_program_info()
1675 ret = codec_meta_set_program_info(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_program_info()
1676 ARRAY_SIZE(codec_cap->meta), program_info, in bt_audio_codec_cap_meta_set_program_info()
1693 return codec_meta_get_lang(codec_cap->meta, codec_cap->meta_len, lang); in bt_audio_codec_cap_meta_get_lang()
1701 ret = codec_meta_set_lang(codec_cap->meta, codec_cap->meta_len, ARRAY_SIZE(codec_cap->meta), in bt_audio_codec_cap_meta_set_lang()
1718 return codec_meta_get_ccid_list(codec_cap->meta, codec_cap->meta_len, ccid_list); in bt_audio_codec_cap_meta_get_ccid_list()
1726 ret = codec_meta_set_ccid_list(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_ccid_list()
1727 ARRAY_SIZE(codec_cap->meta), ccid_list, ccid_list_len); in bt_audio_codec_cap_meta_set_ccid_list()
1742 return codec_meta_get_parental_rating(codec_cap->meta, codec_cap->meta_len); in bt_audio_codec_cap_meta_get_parental_rating()
1750 ret = codec_meta_set_parental_rating(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_parental_rating()
1751 ARRAY_SIZE(codec_cap->meta), parental_rating); in bt_audio_codec_cap_meta_set_parental_rating()
1767 return codec_meta_get_program_info_uri(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_get_program_info_uri()
1777 ret = codec_meta_set_program_info_uri(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_program_info_uri()
1778 ARRAY_SIZE(codec_cap->meta), program_info_uri, in bt_audio_codec_cap_meta_set_program_info_uri()
1794 return codec_meta_get_audio_active_state(codec_cap->meta, codec_cap->meta_len); in bt_audio_codec_cap_meta_get_audio_active_state()
1802 ret = codec_meta_set_audio_active_state(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_audio_active_state()
1803 ARRAY_SIZE(codec_cap->meta), state); in bt_audio_codec_cap_meta_set_audio_active_state()
1819 return codec_meta_get_bcast_audio_immediate_rend_flag(codec_cap->meta, codec_cap->meta_len); in bt_audio_codec_cap_meta_get_bcast_audio_immediate_rend_flag()
1827 ret = codec_meta_set_bcast_audio_immediate_rend_flag(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_bcast_audio_immediate_rend_flag()
1828 ARRAY_SIZE(codec_cap->meta)); in bt_audio_codec_cap_meta_set_bcast_audio_immediate_rend_flag()
1844 return codec_meta_get_assisted_listening_stream(codec_cap->meta, codec_cap->meta_len); in bt_audio_codec_cap_meta_get_assisted_listening_stream()
1852 ret = codec_meta_set_assisted_listening_stream(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_assisted_listening_stream()
1853 ARRAY_SIZE(codec_cap->meta), val); in bt_audio_codec_cap_meta_set_assisted_listening_stream()
1869 return codec_meta_get_extended(codec_cap->meta, codec_cap->meta_len, extended_meta); in bt_audio_codec_cap_meta_get_extended()
1877 ret = codec_meta_set_extended(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_extended()
1878 ARRAY_SIZE(codec_cap->meta), extended_meta, in bt_audio_codec_cap_meta_set_extended()
1895 return codec_meta_get_vendor(codec_cap->meta, codec_cap->meta_len, vendor_meta); in bt_audio_codec_cap_meta_get_vendor()
1903 ret = codec_meta_set_vendor(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_vendor()
1904 ARRAY_SIZE(codec_cap->meta), vendor_meta, vendor_meta_len); in bt_audio_codec_cap_meta_set_vendor()
1920 return codec_meta_get_broadcast_name(codec_cap->meta, codec_cap->meta_len, broadcast_name); in bt_audio_codec_cap_meta_get_broadcast_name()
1929 ret = codec_meta_set_broadcast_name(codec_cap->meta, codec_cap->meta_len, in bt_audio_codec_cap_meta_set_broadcast_name()
1930 ARRAY_SIZE(codec_cap->meta), broadcast_name, in bt_audio_codec_cap_meta_set_broadcast_name()