Lines Matching +full:bass +full:- +full:control

2  * Copyright (c) 2022-2023 Nordic Semiconductor ASA
4 * SPDX-License-Identifier: Apache-2.0
50 return -EINVAL; in bt_cap_commander_register_cb()
56 return -EALREADY; in bt_cap_commander_register_cb()
68 return -EINVAL; in bt_cap_commander_unregister_cb()
73 return -EINVAL; in bt_cap_commander_unregister_cb()
86 if (cap_cb && cap_cb->discovery_complete) { in cap_commander_discover_complete()
87 cap_cb->discovery_complete(conn, err, member, csis_inst); in cap_commander_discover_complete()
95 return -EINVAL; in bt_cap_commander_discover()
109 bt_addr_le_copy(&add_src_param->addr, &start_param->addr); in copy_broadcast_reception_start_param()
110 add_src_param->adv_sid = start_param->adv_sid; in copy_broadcast_reception_start_param()
111 add_src_param->broadcast_id = start_param->broadcast_id; in copy_broadcast_reception_start_param()
112 add_src_param->pa_sync = true; in copy_broadcast_reception_start_param()
113 add_src_param->pa_interval = start_param->pa_interval; in copy_broadcast_reception_start_param()
114 add_src_param->num_subgroups = start_param->num_subgroups; in copy_broadcast_reception_start_param()
115 add_src_param->subgroups = start_param->subgroups; in copy_broadcast_reception_start_param()
133 LOG_DBG("Aborting the proc %d %d", active_proc->proc_done_cnt, in cap_commander_broadcast_assistant_add_src_cb()
134 active_proc->proc_initiated_cnt); in cap_commander_broadcast_assistant_add_src_cb()
138 active_proc->proc_done_cnt++; in cap_commander_broadcast_assistant_add_src_cb()
141 active_proc->proc_done_cnt, active_proc->proc_cnt); in cap_commander_broadcast_assistant_add_src_cb()
155 proc_param = &active_proc->proc_param.commander[active_proc->proc_done_cnt]; in cap_commander_broadcast_assistant_add_src_cb()
156 conn = proc_param->conn; in cap_commander_broadcast_assistant_add_src_cb()
158 &proc_param->broadcast_reception_start); in cap_commander_broadcast_assistant_add_src_cb()
160 active_proc->proc_initiated_cnt++; in cap_commander_broadcast_assistant_add_src_cb()
181 return -ENOEXEC; in cap_commander_register_broadcast_assistant_cb()
199 CHECKIF(param->count == 0) { in valid_broadcast_reception_start_param()
200 LOG_DBG("Invalid param->count: %zu", param->count); in valid_broadcast_reception_start_param()
204 CHECKIF(param->count > CONFIG_BT_MAX_CONN) { in valid_broadcast_reception_start_param()
205 LOG_DBG("param->count (%zu) is larger than CONFIG_BT_MAX_CONN (%d)", param->count, in valid_broadcast_reception_start_param()
210 CHECKIF(param->param == NULL) { in valid_broadcast_reception_start_param()
211 LOG_DBG("param->param is NULL"); in valid_broadcast_reception_start_param()
215 for (size_t i = 0; i < param->count; i++) { in valid_broadcast_reception_start_param()
217 &param->param[i]; in valid_broadcast_reception_start_param()
218 const union bt_cap_set_member *member = &param->param[i].member; in valid_broadcast_reception_start_param()
220 bt_cap_common_get_member_conn(param->type, member); in valid_broadcast_reception_start_param()
223 LOG_DBG("param->param[%zu].member is NULL", i); in valid_broadcast_reception_start_param()
228 LOG_DBG("Invalid param->param[%zu].member", i); in valid_broadcast_reception_start_param()
232 CHECKIF(start_param->addr.type > BT_ADDR_LE_RANDOM) { in valid_broadcast_reception_start_param()
233 LOG_DBG("Invalid address type %u", start_param->addr.type); in valid_broadcast_reception_start_param()
237 CHECKIF(start_param->adv_sid > BT_GAP_SID_MAX) { in valid_broadcast_reception_start_param()
238 LOG_DBG("param->param[%zu]->adv_sid is larger than %d", i, BT_GAP_SID_MAX); in valid_broadcast_reception_start_param()
242 CHECKIF(!IN_RANGE(start_param->pa_interval, BT_GAP_PER_ADV_MIN_INTERVAL, in valid_broadcast_reception_start_param()
244 LOG_DBG("param->param[%zu]->pa_interval is out of range", i); in valid_broadcast_reception_start_param()
248 CHECKIF(start_param->broadcast_id > BT_AUDIO_BROADCAST_ID_MAX) { in valid_broadcast_reception_start_param()
249 LOG_DBG("param->param[%zu]->broadcast_id is larger than %u", i, in valid_broadcast_reception_start_param()
254 CHECKIF(start_param->num_subgroups == 0) { in valid_broadcast_reception_start_param()
255 LOG_DBG("param->param[%zu]->num_subgroups is 0", i); in valid_broadcast_reception_start_param()
259 CHECKIF(start_param->num_subgroups > CONFIG_BT_BAP_BASS_MAX_SUBGROUPS) { in valid_broadcast_reception_start_param()
260 LOG_DBG("Too many subgroups %u/%u", start_param->num_subgroups, in valid_broadcast_reception_start_param()
266 CHECKIF(start_param->subgroups == NULL) { in valid_broadcast_reception_start_param()
267 LOG_DBG("param->param[%zu]->subgroup is NULL", i); in valid_broadcast_reception_start_param()
272 for (size_t j = 0U; j < start_param->num_subgroups; j++) { in valid_broadcast_reception_start_param()
274 &start_param->subgroups[j]; in valid_broadcast_reception_start_param()
276 CHECKIF(!valid_bis_syncs(param_subgroups->bis_sync)) { in valid_broadcast_reception_start_param()
277 LOG_DBG("param->param[%zu].subgroup[%zu].bis_sync is invalid %u", i, in valid_broadcast_reception_start_param()
278 j, param_subgroups->bis_sync); in valid_broadcast_reception_start_param()
283 CHECKIF((total_bis_sync & param_subgroups->bis_sync) != 0) { in valid_broadcast_reception_start_param()
284 LOG_DBG("param->param[%zu].subgroup[%zu].bis_sync 0x%08X has " in valid_broadcast_reception_start_param()
286 i, j, param_subgroups->bis_sync, total_bis_sync); in valid_broadcast_reception_start_param()
291 total_bis_sync |= param_subgroups->bis_sync; in valid_broadcast_reception_start_param()
293 CHECKIF(param_subgroups->metadata_len > in valid_broadcast_reception_start_param()
295 LOG_DBG("param->param[%zu].subgroup[%zu].metadata_len too long " in valid_broadcast_reception_start_param()
297 i, j, param_subgroups->metadata_len, in valid_broadcast_reception_start_param()
303 CHECKIF(param_subgroups->metadata_len > 0 && in valid_broadcast_reception_start_param()
304 !bt_audio_valid_ltv(param_subgroups->metadata, in valid_broadcast_reception_start_param()
305 param_subgroups->metadata_len)) { in valid_broadcast_reception_start_param()
306 LOG_DBG("param->param[%zu].subgroup[%zu].metadata not valid LTV", i, in valid_broadcast_reception_start_param()
313 const union bt_cap_set_member *other = &param->param[j].member; in valid_broadcast_reception_start_param()
316 LOG_DBG("param->members[%zu] (%p) is duplicated by " in valid_broadcast_reception_start_param()
317 "param->members[%zu] (%p)", in valid_broadcast_reception_start_param()
339 return -EBUSY; in bt_cap_commander_broadcast_reception_start()
343 return -EINVAL; in bt_cap_commander_broadcast_reception_start()
346 bt_cap_common_start_proc(BT_CAP_COMMON_PROC_TYPE_BROADCAST_RECEPTION_START, param->count); in bt_cap_commander_broadcast_reception_start()
353 return -ENOEXEC; in bt_cap_commander_broadcast_reception_start()
358 for (size_t i = 0U; i < param->count; i++) { in bt_cap_commander_broadcast_reception_start()
360 &param->param[i]; in bt_cap_commander_broadcast_reception_start()
363 bt_cap_common_get_member_conn(param->type, &member_param->member); in bt_cap_commander_broadcast_reception_start()
366 LOG_DBG("Invalid param->members[%zu]", i); in bt_cap_commander_broadcast_reception_start()
368 return -EINVAL; in bt_cap_commander_broadcast_reception_start()
375 stored_param = &active_proc->proc_param.commander[i]; in bt_cap_commander_broadcast_reception_start()
376 stored_param->conn = member_conn; in bt_cap_commander_broadcast_reception_start()
377 bt_addr_le_copy(&stored_param->broadcast_reception_start.addr, &member_param->addr); in bt_cap_commander_broadcast_reception_start()
378 stored_param->broadcast_reception_start.adv_sid = member_param->adv_sid; in bt_cap_commander_broadcast_reception_start()
379 stored_param->broadcast_reception_start.broadcast_id = member_param->broadcast_id; in bt_cap_commander_broadcast_reception_start()
380 stored_param->broadcast_reception_start.pa_interval = member_param->pa_interval; in bt_cap_commander_broadcast_reception_start()
381 stored_param->broadcast_reception_start.num_subgroups = member_param->num_subgroups; in bt_cap_commander_broadcast_reception_start()
382 memcpy(stored_param->broadcast_reception_start.subgroups, member_param->subgroups, in bt_cap_commander_broadcast_reception_start()
383 sizeof(struct bt_bap_bass_subgroup) * member_param->num_subgroups); in bt_cap_commander_broadcast_reception_start()
386 active_proc->proc_initiated_cnt++; in bt_cap_commander_broadcast_reception_start()
388 proc_param = &active_proc->proc_param.commander[0]; in bt_cap_commander_broadcast_reception_start()
390 conn = proc_param->conn; in bt_cap_commander_broadcast_reception_start()
392 &proc_param->broadcast_reception_start); in bt_cap_commander_broadcast_reception_start()
399 return -ENOEXEC; in bt_cap_commander_broadcast_reception_start()
409 mod_src_param->src_id = stop_param->src_id; in copy_broadcast_reception_stop_param()
410 mod_src_param->pa_sync = false; in copy_broadcast_reception_stop_param()
411 mod_src_param->pa_interval = BT_BAP_PA_INTERVAL_UNKNOWN; in copy_broadcast_reception_stop_param()
412 mod_src_param->num_subgroups = stop_param->num_subgroups; in copy_broadcast_reception_stop_param()
414 mod_src_param->subgroups = stop_param->subgroups; in copy_broadcast_reception_stop_param()
429 active_proc->proc_type == BT_CAP_COMMON_PROC_TYPE_BROADCAST_RECEPTION_STOP) { in cap_commander_broadcast_assistant_recv_state_cb()
431 LOG_DBG("BASS recv state: conn %p, src_id %u", (void *)conn, state->src_id); in cap_commander_broadcast_assistant_recv_state_cb()
433 for (uint8_t i = 0; i < state->num_subgroups; i++) { in cap_commander_broadcast_assistant_recv_state_cb()
434 const struct bt_bap_bass_subgroup *subgroup = &state->subgroups[i]; in cap_commander_broadcast_assistant_recv_state_cb()
439 if (subgroup->bis_sync != 0) { in cap_commander_broadcast_assistant_recv_state_cb()
445 err = bt_bap_broadcast_assistant_rem_src(conn, state->src_id); in cap_commander_broadcast_assistant_recv_state_cb()
466 LOG_DBG("Aborting the proc %d %d", active_proc->proc_done_cnt, in cap_commander_broadcast_assistant_rem_src_cb()
467 active_proc->proc_initiated_cnt); in cap_commander_broadcast_assistant_rem_src_cb()
471 active_proc->proc_done_cnt++; in cap_commander_broadcast_assistant_rem_src_cb()
474 active_proc->proc_done_cnt, active_proc->proc_cnt); in cap_commander_broadcast_assistant_rem_src_cb()
488 proc_param = &active_proc->proc_param.commander[active_proc->proc_done_cnt]; in cap_commander_broadcast_assistant_rem_src_cb()
489 conn = proc_param->conn; in cap_commander_broadcast_assistant_rem_src_cb()
491 &proc_param->broadcast_reception_stop); in cap_commander_broadcast_assistant_rem_src_cb()
492 active_proc->proc_initiated_cnt++; in cap_commander_broadcast_assistant_rem_src_cb()
515 LOG_DBG("Aborting the proc %d %d", active_proc->proc_done_cnt, in cap_commander_broadcast_assistant_mod_src_cb()
516 active_proc->proc_initiated_cnt); in cap_commander_broadcast_assistant_mod_src_cb()
521 active_proc->proc_done_cnt, active_proc->proc_cnt); in cap_commander_broadcast_assistant_mod_src_cb()
539 CHECKIF(param->count == 0) { in valid_broadcast_reception_stop_param()
540 LOG_DBG("Invalid param->count: %zu", param->count); in valid_broadcast_reception_stop_param()
544 CHECKIF(param->count > CONFIG_BT_MAX_CONN) { in valid_broadcast_reception_stop_param()
545 LOG_DBG("param->count (%zu) is larger than CONFIG_BT_MAX_CONN (%d)", param->count, in valid_broadcast_reception_stop_param()
550 CHECKIF(param->param == NULL) { in valid_broadcast_reception_stop_param()
551 LOG_DBG("param->param is NULL"); in valid_broadcast_reception_stop_param()
555 for (size_t i = 0; i < param->count; i++) { in valid_broadcast_reception_stop_param()
557 &param->param[i]; in valid_broadcast_reception_stop_param()
558 const union bt_cap_set_member *member = &param->param[i].member; in valid_broadcast_reception_stop_param()
560 bt_cap_common_get_member_conn(param->type, member); in valid_broadcast_reception_stop_param()
563 LOG_DBG("param->param[%zu].member is NULL", i); in valid_broadcast_reception_stop_param()
568 LOG_DBG("Invalid param->param[%zu].member", i); in valid_broadcast_reception_stop_param()
572 CHECKIF(stop_param->num_subgroups == 0) { in valid_broadcast_reception_stop_param()
573 LOG_DBG("param->param[%zu]->num_subgroups is 0", i); in valid_broadcast_reception_stop_param()
577 CHECKIF(stop_param->num_subgroups > CONFIG_BT_BAP_BASS_MAX_SUBGROUPS) { in valid_broadcast_reception_stop_param()
578 LOG_DBG("Too many subgroups %u/%u", stop_param->num_subgroups, in valid_broadcast_reception_stop_param()
584 const union bt_cap_set_member *other = &param->param[j].member; in valid_broadcast_reception_stop_param()
585 uint8_t other_src_id = param->param[j].src_id; in valid_broadcast_reception_stop_param()
587 if (other == member && stop_param->src_id == other_src_id) { in valid_broadcast_reception_stop_param()
588 LOG_DBG("param->members[%zu], src_id %d (%p) is duplicated by " in valid_broadcast_reception_stop_param()
589 "param->members[%zu], src_id %d (%p)", in valid_broadcast_reception_stop_param()
590 j, other_src_id, other, i, stop_param->src_id, member); in valid_broadcast_reception_stop_param()
611 return -EBUSY; in bt_cap_commander_broadcast_reception_stop()
615 return -EINVAL; in bt_cap_commander_broadcast_reception_stop()
618 bt_cap_common_start_proc(BT_CAP_COMMON_PROC_TYPE_BROADCAST_RECEPTION_STOP, param->count); in bt_cap_commander_broadcast_reception_stop()
627 return -ENOEXEC; in bt_cap_commander_broadcast_reception_stop()
632 for (size_t i = 0U; i < param->count; i++) { in bt_cap_commander_broadcast_reception_stop()
634 &param->param[i]; in bt_cap_commander_broadcast_reception_stop()
637 bt_cap_common_get_member_conn(param->type, &member_param->member); in bt_cap_commander_broadcast_reception_stop()
640 LOG_DBG("Invalid param->member[%zu]", i); in bt_cap_commander_broadcast_reception_stop()
642 return -EINVAL; in bt_cap_commander_broadcast_reception_stop()
647 stored_param = &active_proc->proc_param.commander[i]; in bt_cap_commander_broadcast_reception_stop()
648 stored_param->conn = member_conn; in bt_cap_commander_broadcast_reception_stop()
649 stored_param->broadcast_reception_stop.src_id = member_param->src_id; in bt_cap_commander_broadcast_reception_stop()
650 stored_param->broadcast_reception_stop.num_subgroups = member_param->num_subgroups; in bt_cap_commander_broadcast_reception_stop()
652 stored_param->broadcast_reception_stop.subgroups[j].bis_sync = 0; in bt_cap_commander_broadcast_reception_stop()
653 stored_param->broadcast_reception_stop.subgroups[j].metadata_len = 0; in bt_cap_commander_broadcast_reception_stop()
657 proc_param = &active_proc->proc_param.commander[0]; in bt_cap_commander_broadcast_reception_stop()
659 conn = proc_param->conn; in bt_cap_commander_broadcast_reception_stop()
660 copy_broadcast_reception_stop_param(&mod_src_param, &proc_param->broadcast_reception_stop); in bt_cap_commander_broadcast_reception_stop()
662 active_proc->proc_initiated_cnt++; in bt_cap_commander_broadcast_reception_stop()
668 return -ENOEXEC; in bt_cap_commander_broadcast_reception_stop()
690 active_proc->proc_done_cnt++; in cap_commander_broadcast_assistant_set_broadcast_code_cb()
693 active_proc->proc_done_cnt, active_proc->proc_cnt); in cap_commander_broadcast_assistant_set_broadcast_code_cb()
707 proc_param = &active_proc->proc_param.commander[active_proc->proc_done_cnt]; in cap_commander_broadcast_assistant_set_broadcast_code_cb()
708 conn = proc_param->conn; in cap_commander_broadcast_assistant_set_broadcast_code_cb()
710 active_proc->proc_initiated_cnt++; in cap_commander_broadcast_assistant_set_broadcast_code_cb()
712 conn, proc_param->distribute_broadcast_code.src_id, in cap_commander_broadcast_assistant_set_broadcast_code_cb()
713 proc_param->distribute_broadcast_code.broadcast_code); in cap_commander_broadcast_assistant_set_broadcast_code_cb()
733 CHECKIF(param->count == 0) { in valid_distribute_broadcast_code_param()
734 LOG_DBG("Invalid param->count: %zu", param->count); in valid_distribute_broadcast_code_param()
738 CHECKIF(param->count > CONFIG_BT_MAX_CONN) { in valid_distribute_broadcast_code_param()
739 LOG_DBG("param->count (%zu) is larger than CONFIG_BT_MAX_CONN (%d)", param->count, in valid_distribute_broadcast_code_param()
744 CHECKIF(param->param == NULL) { in valid_distribute_broadcast_code_param()
745 LOG_DBG("param->param is NULL"); in valid_distribute_broadcast_code_param()
749 for (size_t i = 0; i < param->count; i++) { in valid_distribute_broadcast_code_param()
750 const union bt_cap_set_member *member = &param->param[i].member; in valid_distribute_broadcast_code_param()
752 bt_cap_common_get_member_conn(param->type, member); in valid_distribute_broadcast_code_param()
755 LOG_DBG("param->param[%zu].member is NULL", i); in valid_distribute_broadcast_code_param()
760 LOG_DBG("Invalid param->param[%zu].member", i); in valid_distribute_broadcast_code_param()
765 const union bt_cap_set_member *other = &param->param[j].member; in valid_distribute_broadcast_code_param()
767 bt_cap_common_get_member_conn(param->type, other); in valid_distribute_broadcast_code_param()
770 LOG_DBG("param->param[%zu].member.member (%p) is duplicated by " in valid_distribute_broadcast_code_param()
771 "param->member[%zu].member.member (%p)", in valid_distribute_broadcast_code_param()
792 return -EBUSY; in bt_cap_commander_distribute_broadcast_code()
796 return -EINVAL; in bt_cap_commander_distribute_broadcast_code()
799 bt_cap_common_start_proc(BT_CAP_COMMON_PROC_TYPE_DISTRIBUTE_BROADCAST_CODE, param->count); in bt_cap_commander_distribute_broadcast_code()
807 return -ENOEXEC; in bt_cap_commander_distribute_broadcast_code()
812 for (size_t i = 0U; i < param->count; i++) { in bt_cap_commander_distribute_broadcast_code()
814 &param->param[i]; in bt_cap_commander_distribute_broadcast_code()
817 bt_cap_common_get_member_conn(param->type, &member_param->member); in bt_cap_commander_distribute_broadcast_code()
820 LOG_DBG("Invalid param->member[%zu]", i); in bt_cap_commander_distribute_broadcast_code()
822 return -EINVAL; in bt_cap_commander_distribute_broadcast_code()
828 stored_param = &active_proc->proc_param.commander[i]; in bt_cap_commander_distribute_broadcast_code()
829 stored_param->conn = member_conn; in bt_cap_commander_distribute_broadcast_code()
830 stored_param->distribute_broadcast_code.src_id = member_param->src_id; in bt_cap_commander_distribute_broadcast_code()
831 memcpy(stored_param->distribute_broadcast_code.broadcast_code, in bt_cap_commander_distribute_broadcast_code()
832 param->broadcast_code, BT_ISO_BROADCAST_CODE_SIZE); in bt_cap_commander_distribute_broadcast_code()
835 active_proc->proc_initiated_cnt++; in bt_cap_commander_distribute_broadcast_code()
837 proc_param = &active_proc->proc_param.commander[0]; in bt_cap_commander_distribute_broadcast_code()
839 conn = proc_param->conn; in bt_cap_commander_distribute_broadcast_code()
842 conn, proc_param->distribute_broadcast_code.src_id, in bt_cap_commander_distribute_broadcast_code()
843 proc_param->distribute_broadcast_code.broadcast_code); in bt_cap_commander_distribute_broadcast_code()
849 return -ENOEXEC; in bt_cap_commander_distribute_broadcast_code()
864 failed_conn = active_proc->failed_conn; in cap_commander_proc_complete()
865 err = active_proc->err; in cap_commander_proc_complete()
866 proc_type = active_proc->proc_type; in cap_commander_proc_complete()
876 if (cap_cb->volume_changed != NULL) { in cap_commander_proc_complete()
877 cap_cb->volume_changed(failed_conn, err); in cap_commander_proc_complete()
881 if (cap_cb->volume_mute_changed != NULL) { in cap_commander_proc_complete()
882 cap_cb->volume_mute_changed(failed_conn, err); in cap_commander_proc_complete()
887 if (cap_cb->volume_offset_changed != NULL) { in cap_commander_proc_complete()
888 cap_cb->volume_offset_changed(failed_conn, err); in cap_commander_proc_complete()
895 if (cap_cb->microphone_mute_changed != NULL) { in cap_commander_proc_complete()
896 cap_cb->microphone_mute_changed(failed_conn, err); in cap_commander_proc_complete()
901 if (cap_cb->microphone_gain_changed != NULL) { in cap_commander_proc_complete()
902 cap_cb->microphone_gain_changed(failed_conn, err); in cap_commander_proc_complete()
909 if (cap_cb->broadcast_reception_start != NULL) { in cap_commander_proc_complete()
910 cap_cb->broadcast_reception_start(failed_conn, err); in cap_commander_proc_complete()
914 if (cap_cb->broadcast_reception_stop != NULL) { in cap_commander_proc_complete()
915 cap_cb->broadcast_reception_stop(failed_conn, err); in cap_commander_proc_complete()
919 if (cap_cb->distribute_broadcast_code != NULL) { in cap_commander_proc_complete()
920 cap_cb->distribute_broadcast_code(failed_conn, err); in cap_commander_proc_complete()
935 return -EALREADY; in bt_cap_commander_cancel()
938 bt_cap_common_abort_proc(NULL, -ECANCELED); in bt_cap_commander_cancel()
956 return -ENOEXEC; in cap_commander_register_vcp_cb()
971 CHECKIF(param->count == 0) { in valid_change_volume_param()
972 LOG_DBG("Invalid param->count: %u", param->count); in valid_change_volume_param()
976 CHECKIF(param->members == NULL) { in valid_change_volume_param()
977 LOG_DBG("param->members is NULL"); in valid_change_volume_param()
981 CHECKIF(param->count > CONFIG_BT_MAX_CONN) { in valid_change_volume_param()
982 LOG_DBG("param->count (%zu) is larger than CONFIG_BT_MAX_CONN (%d)", param->count, in valid_change_volume_param()
987 for (size_t i = 0U; i < param->count; i++) { in valid_change_volume_param()
988 const union bt_cap_set_member *member = &param->members[i]; in valid_change_volume_param()
990 bt_cap_common_get_member_conn(param->type, member); in valid_change_volume_param()
993 LOG_DBG("param->members[%zu] is NULL", i); in valid_change_volume_param()
998 LOG_DBG("Invalid param->members[%zu]", i); in valid_change_volume_param()
1003 LOG_DBG("Volume control not available for param->members[%zu]", i); in valid_change_volume_param()
1008 const union bt_cap_set_member *other = &param->members[j]; in valid_change_volume_param()
1011 LOG_DBG("param->members[%zu] (%p) is duplicated by " in valid_change_volume_param()
1012 "param->members[%zu] (%p)", in valid_change_volume_param()
1046 active_proc->proc_done_cnt++; in cap_commander_vcp_vol_set_cb()
1049 active_proc->proc_done_cnt, active_proc->proc_cnt); in cap_commander_vcp_vol_set_cb()
1065 proc_param = &active_proc->proc_param.commander[active_proc->proc_done_cnt]; in cap_commander_vcp_vol_set_cb()
1066 conn = proc_param->conn; in cap_commander_vcp_vol_set_cb()
1067 active_proc->proc_initiated_cnt++; in cap_commander_vcp_vol_set_cb()
1069 proc_param->change_volume.volume); in cap_commander_vcp_vol_set_cb()
1090 return -EBUSY; in bt_cap_commander_change_volume()
1094 return -EINVAL; in bt_cap_commander_change_volume()
1097 bt_cap_common_start_proc(BT_CAP_COMMON_PROC_TYPE_VOLUME_CHANGE, param->count); in bt_cap_commander_change_volume()
1103 return -ENOEXEC; in bt_cap_commander_change_volume()
1108 for (size_t i = 0U; i < param->count; i++) { in bt_cap_commander_change_volume()
1110 bt_cap_common_get_member_conn(param->type, &param->members[i]); in bt_cap_commander_change_volume()
1113 LOG_DBG("Invalid param->members[%zu]", i); in bt_cap_commander_change_volume()
1114 return -EINVAL; in bt_cap_commander_change_volume()
1120 active_proc->proc_param.commander[i].conn = member_conn; in bt_cap_commander_change_volume()
1121 active_proc->proc_param.commander[i].change_volume.volume = param->volume; in bt_cap_commander_change_volume()
1124 proc_param = &active_proc->proc_param.commander[0]; in bt_cap_commander_change_volume()
1125 conn = proc_param->conn; in bt_cap_commander_change_volume()
1126 active_proc->proc_initiated_cnt++; in bt_cap_commander_change_volume()
1128 proc_param->change_volume.volume); in bt_cap_commander_change_volume()
1131 return -ENOEXEC; in bt_cap_commander_change_volume()
1145 CHECKIF(param->count == 0) { in valid_change_volume_mute_state_param()
1146 LOG_DBG("Invalid param->count: %u", param->count); in valid_change_volume_mute_state_param()
1150 CHECKIF(param->members == NULL) { in valid_change_volume_mute_state_param()
1151 LOG_DBG("param->members is NULL"); in valid_change_volume_mute_state_param()
1155 CHECKIF(param->count > CONFIG_BT_MAX_CONN) { in valid_change_volume_mute_state_param()
1156 LOG_DBG("param->count (%zu) is larger than CONFIG_BT_MAX_CONN (%d)", param->count, in valid_change_volume_mute_state_param()
1161 for (size_t i = 0U; i < param->count; i++) { in valid_change_volume_mute_state_param()
1162 const union bt_cap_set_member *member = &param->members[i]; in valid_change_volume_mute_state_param()
1164 bt_cap_common_get_member_conn(param->type, member); in valid_change_volume_mute_state_param()
1167 LOG_DBG("param->members[%zu] is NULL", i); in valid_change_volume_mute_state_param()
1172 LOG_DBG("Invalid param->members[%zu]", i); in valid_change_volume_mute_state_param()
1177 LOG_DBG("Volume control not available for param->members[%zu]", i); in valid_change_volume_mute_state_param()
1182 const union bt_cap_set_member *other = &param->members[j]; in valid_change_volume_mute_state_param()
1185 LOG_DBG("param->members[%zu] (%p) is duplicated by " in valid_change_volume_mute_state_param()
1186 "param->members[%zu] (%p)", in valid_change_volume_mute_state_param()
1220 active_proc->proc_done_cnt++; in cap_commander_vcp_vol_mute_cb()
1223 active_proc->proc_done_cnt, active_proc->proc_cnt); in cap_commander_vcp_vol_mute_cb()
1239 proc_param = &active_proc->proc_param.commander[active_proc->proc_done_cnt]; in cap_commander_vcp_vol_mute_cb()
1240 conn = proc_param->conn; in cap_commander_vcp_vol_mute_cb()
1241 active_proc->proc_initiated_cnt++; in cap_commander_vcp_vol_mute_cb()
1242 if (proc_param->change_vol_mute.mute) { in cap_commander_vcp_vol_mute_cb()
1269 return -EBUSY; in bt_cap_commander_change_volume_mute_state()
1273 return -EINVAL; in bt_cap_commander_change_volume_mute_state()
1276 bt_cap_common_start_proc(BT_CAP_COMMON_PROC_TYPE_VOLUME_MUTE_CHANGE, param->count); in bt_cap_commander_change_volume_mute_state()
1283 return -ENOEXEC; in bt_cap_commander_change_volume_mute_state()
1288 for (size_t i = 0U; i < param->count; i++) { in bt_cap_commander_change_volume_mute_state()
1290 bt_cap_common_get_member_conn(param->type, &param->members[i]); in bt_cap_commander_change_volume_mute_state()
1293 LOG_DBG("Invalid param->members[%zu]", i); in bt_cap_commander_change_volume_mute_state()
1294 return -EINVAL; in bt_cap_commander_change_volume_mute_state()
1300 active_proc->proc_param.commander[i].conn = member_conn; in bt_cap_commander_change_volume_mute_state()
1301 active_proc->proc_param.commander[i].change_vol_mute.mute = param->mute; in bt_cap_commander_change_volume_mute_state()
1304 proc_param = &active_proc->proc_param.commander[0]; in bt_cap_commander_change_volume_mute_state()
1305 conn = proc_param->conn; in bt_cap_commander_change_volume_mute_state()
1306 active_proc->proc_initiated_cnt++; in bt_cap_commander_change_volume_mute_state()
1308 if (proc_param->change_vol_mute.mute) { in bt_cap_commander_change_volume_mute_state()
1316 return -ENOEXEC; in bt_cap_commander_change_volume_mute_state()
1331 CHECKIF(param->count == 0) { in valid_change_offset_param()
1332 LOG_DBG("Invalid param->count: %u", param->count); in valid_change_offset_param()
1336 CHECKIF(param->param == NULL) { in valid_change_offset_param()
1337 LOG_DBG("param->param is NULL"); in valid_change_offset_param()
1341 CHECKIF(param->count > CONFIG_BT_MAX_CONN) { in valid_change_offset_param()
1342 LOG_DBG("param->count (%zu) is larger than CONFIG_BT_MAX_CONN (%d)", param->count, in valid_change_offset_param()
1347 for (size_t i = 0U; i < param->count; i++) { in valid_change_offset_param()
1349 &param->param[i]; in valid_change_offset_param()
1350 const union bt_cap_set_member *member = &member_param->member; in valid_change_offset_param()
1352 bt_cap_common_get_member_conn(param->type, member); in valid_change_offset_param()
1358 LOG_DBG("param->param[%zu].member is NULL", i); in valid_change_offset_param()
1363 LOG_DBG("Invalid param->param[%zu].member", i); in valid_change_offset_param()
1369 LOG_DBG("Volume control not available for param->param[%zu].member", i); in valid_change_offset_param()
1375 LOG_DBG("Volume offset control not available for param->param[%zu].member", in valid_change_offset_param()
1377 return -ENOEXEC; in valid_change_offset_param()
1380 if (!IN_RANGE(member_param->offset, BT_VOCS_MIN_OFFSET, BT_VOCS_MAX_OFFSET)) { in valid_change_offset_param()
1381 LOG_DBG("Invalid offset %d for param->param[%zu].offset", in valid_change_offset_param()
1382 member_param->offset, i); in valid_change_offset_param()
1387 const union bt_cap_set_member *other = &param->param[j].member; in valid_change_offset_param()
1390 LOG_DBG("param->param[%zu].member (%p) is duplicated by " in valid_change_offset_param()
1391 "param->param[%zu].member (%p)", in valid_change_offset_param()
1425 active_proc->proc_done_cnt++; in cap_commander_vcp_set_offset_cb()
1428 active_proc->proc_done_cnt, active_proc->proc_cnt); in cap_commander_vcp_set_offset_cb()
1444 proc_param = &active_proc->proc_param.commander[active_proc->proc_done_cnt]; in cap_commander_vcp_set_offset_cb()
1445 conn = proc_param->conn; in cap_commander_vcp_set_offset_cb()
1446 active_proc->proc_initiated_cnt++; in cap_commander_vcp_set_offset_cb()
1448 err = bt_vocs_state_set(proc_param->change_offset.vocs, in cap_commander_vcp_set_offset_cb()
1449 proc_param->change_offset.offset); in cap_commander_vcp_set_offset_cb()
1472 return -EBUSY; in bt_cap_commander_change_volume_offset()
1476 return -EINVAL; in bt_cap_commander_change_volume_offset()
1479 bt_cap_common_start_proc(BT_CAP_COMMON_PROC_TYPE_VOLUME_OFFSET_CHANGE, param->count); in bt_cap_commander_change_volume_offset()
1485 return -ENOEXEC; in bt_cap_commander_change_volume_offset()
1490 for (size_t i = 0U; i < param->count; i++) { in bt_cap_commander_change_volume_offset()
1492 &param->param[i]; in bt_cap_commander_change_volume_offset()
1494 bt_cap_common_get_member_conn(param->type, &member_param->member); in bt_cap_commander_change_volume_offset()
1498 LOG_DBG("Invalid param->members[%zu]", i); in bt_cap_commander_change_volume_offset()
1499 return -EINVAL; in bt_cap_commander_change_volume_offset()
1504 LOG_DBG("Invalid param->members[%zu] vol_ctlr", i); in bt_cap_commander_change_volume_offset()
1505 return -EINVAL; in bt_cap_commander_change_volume_offset()
1510 LOG_DBG("Invalid param->members[%zu] vocs", i); in bt_cap_commander_change_volume_offset()
1511 return -EINVAL; in bt_cap_commander_change_volume_offset()
1517 active_proc->proc_param.commander[i].conn = member_conn; in bt_cap_commander_change_volume_offset()
1518 active_proc->proc_param.commander[i].change_offset.offset = member_param->offset; in bt_cap_commander_change_volume_offset()
1520 * - How should we handle multiple? in bt_cap_commander_change_volume_offset()
1522 active_proc->proc_param.commander[i].change_offset.vocs = included.vocs[0]; in bt_cap_commander_change_volume_offset()
1525 proc_param = &active_proc->proc_param.commander[0]; in bt_cap_commander_change_volume_offset()
1526 conn = proc_param->conn; in bt_cap_commander_change_volume_offset()
1527 active_proc->proc_initiated_cnt++; in bt_cap_commander_change_volume_offset()
1529 err = bt_vocs_state_set(proc_param->change_offset.vocs, proc_param->change_offset.offset); in bt_cap_commander_change_volume_offset()
1532 return -ENOEXEC; in bt_cap_commander_change_volume_offset()
1552 return -ENOEXEC; in cap_commander_register_micp_callbacks()
1568 CHECKIF(param->count == 0) { in valid_change_microphone_mute_state_param()
1569 LOG_DBG("Invalid param->count: %u", param->count); in valid_change_microphone_mute_state_param()
1573 CHECKIF(param->members == NULL) { in valid_change_microphone_mute_state_param()
1574 LOG_DBG("param->members is NULL"); in valid_change_microphone_mute_state_param()
1578 CHECKIF(param->count > CONFIG_BT_MAX_CONN) { in valid_change_microphone_mute_state_param()
1579 LOG_DBG("param->count (%zu) is larger than CONFIG_BT_MAX_CONN (%d)", param->count, in valid_change_microphone_mute_state_param()
1584 for (size_t i = 0U; i < param->count; i++) { in valid_change_microphone_mute_state_param()
1585 const union bt_cap_set_member *member = &param->members[i]; in valid_change_microphone_mute_state_param()
1587 bt_cap_common_get_member_conn(param->type, member); in valid_change_microphone_mute_state_param()
1590 LOG_DBG("param->members[%zu] is NULL", i); in valid_change_microphone_mute_state_param()
1595 LOG_DBG("Invalid param->members[%zu]", i); in valid_change_microphone_mute_state_param()
1600 LOG_DBG("Microphone control not available for param->members[%zu]", i); in valid_change_microphone_mute_state_param()
1605 const union bt_cap_set_member *other = &param->members[j]; in valid_change_microphone_mute_state_param()
1608 LOG_DBG("param->members[%zu] (%p) is duplicated by " in valid_change_microphone_mute_state_param()
1609 "param->members[%zu] (%p)", in valid_change_microphone_mute_state_param()
1643 active_proc->proc_done_cnt++; in cap_commander_micp_mic_mute_cb()
1646 active_proc->proc_done_cnt, active_proc->proc_cnt); in cap_commander_micp_mic_mute_cb()
1662 proc_param = &active_proc->proc_param.commander[active_proc->proc_done_cnt]; in cap_commander_micp_mic_mute_cb()
1663 conn = proc_param->conn; in cap_commander_micp_mic_mute_cb()
1664 active_proc->proc_initiated_cnt++; in cap_commander_micp_mic_mute_cb()
1665 if (proc_param->change_mic_mute.mute) { in cap_commander_micp_mic_mute_cb()
1692 return -EBUSY; in bt_cap_commander_change_microphone_mute_state()
1696 return -EINVAL; in bt_cap_commander_change_microphone_mute_state()
1699 bt_cap_common_start_proc(BT_CAP_COMMON_PROC_TYPE_MICROPHONE_MUTE_CHANGE, param->count); in bt_cap_commander_change_microphone_mute_state()
1706 return -ENOEXEC; in bt_cap_commander_change_microphone_mute_state()
1711 for (size_t i = 0U; i < param->count; i++) { in bt_cap_commander_change_microphone_mute_state()
1713 bt_cap_common_get_member_conn(param->type, &param->members[i]); in bt_cap_commander_change_microphone_mute_state()
1716 LOG_DBG("Invalid param->members[%zu]", i); in bt_cap_commander_change_microphone_mute_state()
1717 return -EINVAL; in bt_cap_commander_change_microphone_mute_state()
1723 active_proc->proc_param.commander[i].conn = member_conn; in bt_cap_commander_change_microphone_mute_state()
1724 active_proc->proc_param.commander[i].change_mic_mute.mute = param->mute; in bt_cap_commander_change_microphone_mute_state()
1727 proc_param = &active_proc->proc_param.commander[0]; in bt_cap_commander_change_microphone_mute_state()
1728 conn = proc_param->conn; in bt_cap_commander_change_microphone_mute_state()
1729 active_proc->proc_initiated_cnt++; in bt_cap_commander_change_microphone_mute_state()
1731 if (proc_param->change_mic_mute.mute) { in bt_cap_commander_change_microphone_mute_state()
1739 return -ENOEXEC; in bt_cap_commander_change_microphone_mute_state()
1754 CHECKIF(param->count == 0) { in valid_change_microphone_gain_param()
1755 LOG_DBG("Invalid param->count: %u", param->count); in valid_change_microphone_gain_param()
1759 CHECKIF(param->param == NULL) { in valid_change_microphone_gain_param()
1760 LOG_DBG("param->param is NULL"); in valid_change_microphone_gain_param()
1764 CHECKIF(param->count > CONFIG_BT_MAX_CONN) { in valid_change_microphone_gain_param()
1765 LOG_DBG("param->count (%zu) is larger than CONFIG_BT_MAX_CONN (%d)", param->count, in valid_change_microphone_gain_param()
1770 for (size_t i = 0U; i < param->count; i++) { in valid_change_microphone_gain_param()
1771 const union bt_cap_set_member *member = &param->param[i].member; in valid_change_microphone_gain_param()
1773 bt_cap_common_get_member_conn(param->type, member); in valid_change_microphone_gain_param()
1779 LOG_DBG("param->param[%zu].member is NULL", i); in valid_change_microphone_gain_param()
1784 LOG_DBG("Invalid param->param[%zu].member", i); in valid_change_microphone_gain_param()
1790 LOG_DBG("Microphone control not available for param->param[%zu].member", i); in valid_change_microphone_gain_param()
1796 LOG_DBG("Microphone audio input control not available for " in valid_change_microphone_gain_param()
1797 "param->param[%zu].member", in valid_change_microphone_gain_param()
1799 return -ENOEXEC; in valid_change_microphone_gain_param()
1803 const union bt_cap_set_member *other = &param->param[j].member; in valid_change_microphone_gain_param()
1806 LOG_DBG("param->param[%zu].member (%p) is duplicated by " in valid_change_microphone_gain_param()
1807 "param->param[%zu].member (%p)", in valid_change_microphone_gain_param()
1841 active_proc->proc_done_cnt++; in cap_commander_micp_gain_set_cb()
1844 active_proc->proc_done_cnt, active_proc->proc_cnt); in cap_commander_micp_gain_set_cb()
1860 proc_param = &active_proc->proc_param.commander[active_proc->proc_done_cnt]; in cap_commander_micp_gain_set_cb()
1861 conn = proc_param->conn; in cap_commander_micp_gain_set_cb()
1862 active_proc->proc_initiated_cnt++; in cap_commander_micp_gain_set_cb()
1863 err = bt_aics_gain_set(proc_param->change_gain.aics, proc_param->change_gain.gain); in cap_commander_micp_gain_set_cb()
1885 return -EBUSY; in bt_cap_commander_change_microphone_gain_setting()
1889 return -EINVAL; in bt_cap_commander_change_microphone_gain_setting()
1892 bt_cap_common_start_proc(BT_CAP_COMMON_PROC_TYPE_MICROPHONE_GAIN_CHANGE, param->count); in bt_cap_commander_change_microphone_gain_setting()
1898 return -ENOEXEC; in bt_cap_commander_change_microphone_gain_setting()
1903 for (size_t i = 0U; i < param->count; i++) { in bt_cap_commander_change_microphone_gain_setting()
1904 const union bt_cap_set_member *member = &param->param[i].member; in bt_cap_commander_change_microphone_gain_setting()
1905 struct bt_conn *member_conn = bt_cap_common_get_member_conn(param->type, member); in bt_cap_commander_change_microphone_gain_setting()
1910 LOG_DBG("Invalid param->param[%zu].member", i); in bt_cap_commander_change_microphone_gain_setting()
1911 return -EINVAL; in bt_cap_commander_change_microphone_gain_setting()
1916 LOG_DBG("Invalid param->param[%zu].member mic_ctlr", i); in bt_cap_commander_change_microphone_gain_setting()
1917 return -EINVAL; in bt_cap_commander_change_microphone_gain_setting()
1922 LOG_DBG("Invalid param->param[%zu].member aics", i); in bt_cap_commander_change_microphone_gain_setting()
1923 return -EINVAL; in bt_cap_commander_change_microphone_gain_setting()
1929 active_proc->proc_param.commander[i].conn = member_conn; in bt_cap_commander_change_microphone_gain_setting()
1930 active_proc->proc_param.commander[i].change_gain.gain = param->param[i].gain; in bt_cap_commander_change_microphone_gain_setting()
1932 * - How should we handle multiple? in bt_cap_commander_change_microphone_gain_setting()
1934 active_proc->proc_param.commander[i].change_gain.aics = included.aics[0]; in bt_cap_commander_change_microphone_gain_setting()
1937 proc_param = &active_proc->proc_param.commander[0]; in bt_cap_commander_change_microphone_gain_setting()
1938 conn = proc_param->conn; in bt_cap_commander_change_microphone_gain_setting()
1939 active_proc->proc_initiated_cnt++; in bt_cap_commander_change_microphone_gain_setting()
1941 err = bt_aics_gain_set(proc_param->change_gain.aics, proc_param->change_gain.gain); in bt_cap_commander_change_microphone_gain_setting()
1944 return -ENOEXEC; in bt_cap_commander_change_microphone_gain_setting()