1 /** @file
2  *  @brief Bluetooth MICP shell.
3  *
4  * Copyright (c) 2020 Bose Corporation
5  * Copyright (c) 2020-2022 Nordic Semiconductor ASA
6  *
7  * SPDX-License-Identifier: Apache-2.0
8  */
9 
10 #include <errno.h>
11 #include <stdbool.h>
12 #include <stddef.h>
13 #include <stdint.h>
14 #include <stdio.h>
15 #include <string.h>
16 
17 #include <zephyr/autoconf.h>
18 #include <zephyr/bluetooth/audio/aics.h>
19 #include <zephyr/bluetooth/audio/micp.h>
20 #include <zephyr/bluetooth/conn.h>
21 #include <zephyr/shell/shell.h>
22 #include <zephyr/shell/shell_string_conv.h>
23 #include <zephyr/sys/util.h>
24 #include <zephyr/types.h>
25 
26 #include "host/shell/bt.h"
27 
micp_mic_dev_mute_cb(uint8_t mute)28 static void micp_mic_dev_mute_cb(uint8_t mute)
29 {
30 	shell_print(ctx_shell, "Mute value %u", mute);
31 }
32 
33 static struct bt_micp_mic_dev_cb micp_mic_dev_cbs = {
34 	.mute = micp_mic_dev_mute_cb,
35 };
36 
37 #if defined(CONFIG_BT_MICP_MIC_DEV_AICS)
38 static struct bt_micp_included micp_included;
39 
micp_mic_dev_aics_state_cb(struct bt_aics * inst,int err,int8_t gain,uint8_t mute,uint8_t mode)40 static void micp_mic_dev_aics_state_cb(struct bt_aics *inst, int err,
41 				       int8_t gain, uint8_t mute, uint8_t mode)
42 {
43 	if (err != 0) {
44 		shell_error(ctx_shell, "AICS state get failed (%d) for "
45 			    "inst %p", err, inst);
46 	} else {
47 		shell_print(ctx_shell, "AICS inst %p state gain %d, mute %u, "
48 			    "mode %u", inst, gain, mute, mode);
49 	}
50 
51 }
micp_mic_dev_aics_gain_setting_cb(struct bt_aics * inst,int err,uint8_t units,int8_t minimum,int8_t maximum)52 static void micp_mic_dev_aics_gain_setting_cb(struct bt_aics *inst, int err,
53 					      uint8_t units, int8_t minimum,
54 					      int8_t maximum)
55 {
56 	if (err != 0) {
57 		shell_error(ctx_shell, "AICS gain settings get failed (%d) for "
58 			    "inst %p", err, inst);
59 	} else {
60 		shell_print(ctx_shell, "AICS inst %p gain settings units %u, "
61 			    "min %d, max %d", inst, units, minimum,
62 			    maximum);
63 	}
64 
65 }
micp_mic_dev_aics_input_type_cb(struct bt_aics * inst,int err,uint8_t input_type)66 static void micp_mic_dev_aics_input_type_cb(struct bt_aics *inst, int err,
67 					    uint8_t input_type)
68 {
69 	if (err != 0) {
70 		shell_error(ctx_shell, "AICS input type get failed (%d) for "
71 			    "inst %p", err, inst);
72 	} else {
73 		shell_print(ctx_shell, "AICS inst %p input type %u",
74 			    inst, input_type);
75 	}
76 
77 }
micp_mic_dev_aics_status_cb(struct bt_aics * inst,int err,bool active)78 static void micp_mic_dev_aics_status_cb(struct bt_aics *inst, int err,
79 					bool active)
80 {
81 	if (err != 0) {
82 		shell_error(ctx_shell, "AICS status get failed (%d) for "
83 			    "inst %p", err, inst);
84 	} else {
85 		shell_print(ctx_shell, "AICS inst %p status %s",
86 			    inst, active ? "active" : "inactive");
87 	}
88 
89 }
micp_mic_dev_aics_description_cb(struct bt_aics * inst,int err,char * description)90 static void micp_mic_dev_aics_description_cb(struct bt_aics *inst, int err,
91 					     char *description)
92 {
93 	if (err != 0) {
94 		shell_error(ctx_shell, "AICS description get failed (%d) for "
95 			    "inst %p", err, inst);
96 	} else {
97 		shell_print(ctx_shell, "AICS inst %p description %s",
98 			    inst, description);
99 	}
100 }
101 
102 static struct bt_aics_cb aics_cb = {
103 	.state = micp_mic_dev_aics_state_cb,
104 	.gain_setting = micp_mic_dev_aics_gain_setting_cb,
105 	.type = micp_mic_dev_aics_input_type_cb,
106 	.status = micp_mic_dev_aics_status_cb,
107 	.description = micp_mic_dev_aics_description_cb,
108 };
109 #endif /* CONFIG_BT_MICP_MIC_DEV_AICS */
110 
cmd_micp_mic_dev_param(const struct shell * sh,size_t argc,char ** argv)111 static int cmd_micp_mic_dev_param(const struct shell *sh, size_t argc,
112 				  char **argv)
113 {
114 	int result;
115 	struct bt_micp_mic_dev_register_param micp_param;
116 
117 	if (ctx_shell == NULL) {
118 		ctx_shell = sh;
119 	}
120 
121 	(void)memset(&micp_param, 0, sizeof(micp_param));
122 
123 #if defined(CONFIG_BT_MICP_MIC_DEV_AICS)
124 	char input_desc[CONFIG_BT_MICP_MIC_DEV_AICS_INSTANCE_COUNT][16];
125 
126 	for (int i = 0; i < ARRAY_SIZE(micp_param.aics_param); i++) {
127 		micp_param.aics_param[i].desc_writable = true;
128 		snprintf(input_desc[i], sizeof(input_desc[i]),
129 			 "Input %d", i + 1);
130 		micp_param.aics_param[i].description = input_desc[i];
131 		micp_param.aics_param[i].type = BT_AICS_INPUT_TYPE_UNSPECIFIED;
132 		micp_param.aics_param[i].status = true;
133 		micp_param.aics_param[i].gain_mode = BT_AICS_MODE_MANUAL;
134 		micp_param.aics_param[i].units = 1;
135 		micp_param.aics_param[i].min_gain = -100;
136 		micp_param.aics_param[i].max_gain = 100;
137 		micp_param.aics_param[i].cb = &aics_cb;
138 	}
139 #endif /* CONFIG_BT_MICP_MIC_DEV_AICS */
140 
141 	micp_param.cb = &micp_mic_dev_cbs;
142 
143 	result = bt_micp_mic_dev_register(&micp_param);
144 	if (result != 0) {
145 		shell_error(sh, "MICP register failed: %d", result);
146 		return result;
147 	}
148 
149 	shell_print(sh, "MICP initialized: %d", result);
150 
151 #if defined(CONFIG_BT_MICP_MIC_DEV_AICS)
152 	result = bt_micp_mic_dev_included_get(&micp_included);
153 	if (result != 0) {
154 		shell_error(sh, "MICP get failed: %d", result);
155 	}
156 #endif /* CONFIG_BT_MICP_MIC_DEV_AICS */
157 
158 	return result;
159 }
160 
cmd_micp_mic_dev_mute_get(const struct shell * sh,size_t argc,char ** argv)161 static int cmd_micp_mic_dev_mute_get(const struct shell *sh, size_t argc,
162 				     char **argv)
163 {
164 	int result = bt_micp_mic_dev_mute_get();
165 
166 	if (result != 0) {
167 		shell_error(sh, "Fail: %d", result);
168 	}
169 
170 	return result;
171 }
172 
cmd_micp_mic_dev_mute(const struct shell * sh,size_t argc,char ** argv)173 static int cmd_micp_mic_dev_mute(const struct shell *sh, size_t argc,
174 				 char **argv)
175 {
176 	int result = bt_micp_mic_dev_mute();
177 
178 	if (result != 0) {
179 		shell_error(sh, "Fail: %d", result);
180 	}
181 
182 	return result;
183 }
184 
cmd_micp_mic_dev_unmute(const struct shell * sh,size_t argc,char ** argv)185 static int cmd_micp_mic_dev_unmute(const struct shell *sh, size_t argc,
186 				   char **argv)
187 {
188 	int result = bt_micp_mic_dev_unmute();
189 
190 	if (result != 0) {
191 		shell_error(sh, "Fail: %d", result);
192 	}
193 
194 	return result;
195 }
196 
cmd_micp_mic_dev_mute_disable(const struct shell * sh,size_t argc,char ** argv)197 static int cmd_micp_mic_dev_mute_disable(const struct shell *sh, size_t argc,
198 					 char **argv)
199 {
200 	int result = bt_micp_mic_dev_mute_disable();
201 
202 	if (result != 0) {
203 		shell_error(sh, "Fail: %d", result);
204 	}
205 
206 	return result;
207 }
208 
209 #if defined(CONFIG_BT_MICP_MIC_DEV_AICS)
cmd_micp_mic_dev_aics_deactivate(const struct shell * sh,size_t argc,char ** argv)210 static int cmd_micp_mic_dev_aics_deactivate(const struct shell *sh, size_t argc,
211 					    char **argv)
212 {
213 	unsigned long index;
214 	int result = 0;
215 
216 	index = shell_strtoul(argv[1], 0, &result);
217 	if (result != 0) {
218 		shell_error(sh, "Could not parse index: %d", result);
219 
220 		return -ENOEXEC;
221 	}
222 
223 	if (index >= micp_included.aics_cnt) {
224 		shell_error(sh, "Index shall be less than %u, was %lu",
225 			    micp_included.aics_cnt, index);
226 
227 		return -ENOEXEC;
228 	}
229 
230 	result = bt_aics_deactivate(micp_included.aics[index]);
231 	if (result != 0) {
232 		shell_error(sh, "Fail: %d", result);
233 	}
234 
235 	return result;
236 }
237 
cmd_micp_mic_dev_aics_activate(const struct shell * sh,size_t argc,char ** argv)238 static int cmd_micp_mic_dev_aics_activate(const struct shell *sh, size_t argc,
239 					  char **argv)
240 {
241 	unsigned long index;
242 	int result = 0;
243 
244 	index = shell_strtoul(argv[1], 0, &result);
245 	if (result != 0) {
246 		shell_error(sh, "Could not parse index: %d", result);
247 
248 		return -ENOEXEC;
249 	}
250 
251 	if (index >= micp_included.aics_cnt) {
252 		shell_error(sh, "Index shall be less than %u, was %lu",
253 			    micp_included.aics_cnt, index);
254 
255 		return -ENOEXEC;
256 	}
257 
258 	result = bt_aics_activate(micp_included.aics[index]);
259 	if (result != 0) {
260 		shell_error(sh, "Fail: %d", result);
261 	}
262 
263 	return result;
264 }
265 
cmd_micp_mic_dev_aics_input_state_get(const struct shell * sh,size_t argc,char ** argv)266 static int cmd_micp_mic_dev_aics_input_state_get(const struct shell *sh,
267 						 size_t argc, char **argv)
268 {
269 	unsigned long index;
270 	int result = 0;
271 
272 	index = shell_strtoul(argv[1], 0, &result);
273 	if (result != 0) {
274 		shell_error(sh, "Could not parse index: %d", result);
275 
276 		return -ENOEXEC;
277 	}
278 
279 	if (index >= micp_included.aics_cnt) {
280 		shell_error(sh, "Index shall be less than %u, was %lu",
281 			    micp_included.aics_cnt, index);
282 
283 		return -ENOEXEC;
284 	}
285 
286 	result = bt_aics_state_get(micp_included.aics[index]);
287 	if (result != 0) {
288 		shell_error(sh, "Fail: %d", result);
289 	}
290 
291 	return result;
292 }
293 
cmd_micp_mic_dev_aics_gain_setting_get(const struct shell * sh,size_t argc,char ** argv)294 static int cmd_micp_mic_dev_aics_gain_setting_get(const struct shell *sh,
295 						  size_t argc, char **argv)
296 {
297 	unsigned long index;
298 	int result = 0;
299 
300 	index = shell_strtoul(argv[1], 0, &result);
301 	if (result != 0) {
302 		shell_error(sh, "Could not parse index: %d", result);
303 
304 		return -ENOEXEC;
305 	}
306 
307 	if (index >= micp_included.aics_cnt) {
308 		shell_error(sh, "Index shall be less than %u, was %lu",
309 			    micp_included.aics_cnt, index);
310 
311 		return -ENOEXEC;
312 	}
313 
314 	result = bt_aics_gain_setting_get(micp_included.aics[index]);
315 	if (result != 0) {
316 		shell_error(sh, "Fail: %d", result);
317 	}
318 
319 	return result;
320 }
321 
cmd_micp_mic_dev_aics_input_type_get(const struct shell * sh,size_t argc,char ** argv)322 static int cmd_micp_mic_dev_aics_input_type_get(const struct shell *sh,
323 						size_t argc, char **argv)
324 {
325 	unsigned long index;
326 	int result = 0;
327 
328 	index = shell_strtoul(argv[1], 0, &result);
329 	if (result != 0) {
330 		shell_error(sh, "Could not parse index: %d", result);
331 
332 		return -ENOEXEC;
333 	}
334 
335 	if (index >= micp_included.aics_cnt) {
336 		shell_error(sh, "Index shall be less than %u, was %lu",
337 			    micp_included.aics_cnt, index);
338 
339 		return -ENOEXEC;
340 	}
341 
342 	result = bt_aics_type_get(micp_included.aics[index]);
343 	if (result != 0) {
344 		shell_error(sh, "Fail: %d", result);
345 	}
346 
347 	return result;
348 }
349 
cmd_micp_mic_dev_aics_input_status_get(const struct shell * sh,size_t argc,char ** argv)350 static int cmd_micp_mic_dev_aics_input_status_get(const struct shell *sh,
351 						  size_t argc, char **argv)
352 {
353 	unsigned long index;
354 	int result = 0;
355 
356 	index = shell_strtoul(argv[1], 0, &result);
357 	if (result != 0) {
358 		shell_error(sh, "Could not parse index: %d", result);
359 
360 		return -ENOEXEC;
361 	}
362 
363 	if (index >= micp_included.aics_cnt) {
364 		shell_error(sh, "Index shall be less than %u, was %lu",
365 			    micp_included.aics_cnt, index);
366 
367 		return -ENOEXEC;
368 	}
369 
370 	result = bt_aics_status_get(micp_included.aics[index]);
371 	if (result != 0) {
372 		shell_error(sh, "Fail: %d", result);
373 	}
374 
375 	return result;
376 }
377 
cmd_micp_mic_dev_aics_input_unmute(const struct shell * sh,size_t argc,char ** argv)378 static int cmd_micp_mic_dev_aics_input_unmute(const struct shell *sh,
379 					      size_t argc, char **argv)
380 {
381 	unsigned long index;
382 	int result = 0;
383 
384 	index = shell_strtoul(argv[1], 0, &result);
385 	if (result != 0) {
386 		shell_error(sh, "Could not parse index: %d", result);
387 
388 		return -ENOEXEC;
389 	}
390 
391 	if (index >= micp_included.aics_cnt) {
392 		shell_error(sh, "Index shall be less than %u, was %lu",
393 			    micp_included.aics_cnt, index);
394 
395 		return -ENOEXEC;
396 	}
397 
398 	result = bt_aics_unmute(micp_included.aics[index]);
399 	if (result != 0) {
400 		shell_error(sh, "Fail: %d", result);
401 	}
402 
403 	return result;
404 }
405 
cmd_micp_mic_dev_aics_input_mute(const struct shell * sh,size_t argc,char ** argv)406 static int cmd_micp_mic_dev_aics_input_mute(const struct shell *sh, size_t argc,
407 					    char **argv)
408 {
409 	unsigned long index;
410 	int result = 0;
411 
412 	index = shell_strtoul(argv[1], 0, &result);
413 	if (result != 0) {
414 		shell_error(sh, "Could not parse index: %d", result);
415 
416 		return -ENOEXEC;
417 	}
418 
419 	if (index >= micp_included.aics_cnt) {
420 		shell_error(sh, "Index shall be less than %u, was %lu",
421 			    micp_included.aics_cnt, index);
422 
423 		return -ENOEXEC;
424 	}
425 
426 	result = bt_aics_mute(micp_included.aics[index]);
427 	if (result != 0) {
428 		shell_error(sh, "Fail: %d", result);
429 	}
430 
431 	return result;
432 }
433 
cmd_micp_mic_dev_aics_manual_input_gain_set(const struct shell * sh,size_t argc,char ** argv)434 static int cmd_micp_mic_dev_aics_manual_input_gain_set(const struct shell *sh,
435 						       size_t argc, char **argv)
436 {
437 	unsigned long index;
438 	int result = 0;
439 
440 	index = shell_strtoul(argv[1], 0, &result);
441 	if (result != 0) {
442 		shell_error(sh, "Could not parse index: %d", result);
443 
444 		return -ENOEXEC;
445 	}
446 
447 	if (index >= micp_included.aics_cnt) {
448 		shell_error(sh, "Index shall be less than %u, was %lu",
449 			    micp_included.aics_cnt, index);
450 
451 		return -ENOEXEC;
452 	}
453 
454 	result = bt_aics_manual_gain_set(micp_included.aics[index]);
455 	if (result != 0) {
456 		shell_error(sh, "Fail: %d", result);
457 	}
458 
459 	return result;
460 }
461 
cmd_micp_mic_dev_aics_automatic_input_gain_set(const struct shell * sh,size_t argc,char ** argv)462 static int cmd_micp_mic_dev_aics_automatic_input_gain_set(const struct shell *sh,
463 							  size_t argc,
464 							  char **argv)
465 {
466 	unsigned long index;
467 	int result = 0;
468 
469 	index = shell_strtoul(argv[1], 0, &result);
470 	if (result != 0) {
471 		shell_error(sh, "Could not parse index: %d", result);
472 
473 		return -ENOEXEC;
474 	}
475 
476 	if (index >= micp_included.aics_cnt) {
477 		shell_error(sh, "Index shall be less than %u, was %lu",
478 			    micp_included.aics_cnt, index);
479 
480 		return -ENOEXEC;
481 	}
482 
483 	result = bt_aics_automatic_gain_set(micp_included.aics[index]);
484 	if (result != 0) {
485 		shell_error(sh, "Fail: %d", result);
486 	}
487 
488 	return result;
489 }
490 
cmd_micp_mic_dev_aics_gain_set(const struct shell * sh,size_t argc,char ** argv)491 static int cmd_micp_mic_dev_aics_gain_set(const struct shell *sh, size_t argc,
492 					  char **argv)
493 {
494 	unsigned long index;
495 	int result = 0;
496 	long gain;
497 
498 	index = shell_strtoul(argv[1], 0, &result);
499 	if (result != 0) {
500 		shell_error(sh, "Could not parse index: %d", result);
501 
502 		return -ENOEXEC;
503 	}
504 
505 	if (index >= micp_included.aics_cnt) {
506 		shell_error(sh, "Index shall be less than %u, was %lu",
507 			    micp_included.aics_cnt, index);
508 
509 		return -ENOEXEC;
510 	}
511 
512 	if (index >= micp_included.aics_cnt) {
513 		shell_error(sh, "Index shall be less than %u, was %lu",
514 			    micp_included.aics_cnt, index);
515 
516 		return -ENOEXEC;
517 	}
518 
519 	gain = shell_strtol(argv[2], 0, &result);
520 	if (result != 0) {
521 		shell_error(sh, "Could not parse gain: %d", result);
522 
523 		return -ENOEXEC;
524 	}
525 
526 	if (!IN_RANGE(gain, INT8_MIN, INT8_MAX)) {
527 		shell_error(sh, "Gain shall be %d-%d, was %ld",
528 			    INT8_MIN, INT8_MAX, gain);
529 
530 		return -ENOEXEC;
531 	}
532 
533 	result = bt_aics_gain_set(micp_included.aics[index], gain);
534 	if (result != 0) {
535 		shell_error(sh, "Fail: %d", result);
536 	}
537 
538 	return result;
539 }
540 
cmd_micp_mic_dev_aics_input_description_get(const struct shell * sh,size_t argc,char ** argv)541 static int cmd_micp_mic_dev_aics_input_description_get(const struct shell *sh,
542 						       size_t argc, char **argv)
543 {
544 	unsigned long index;
545 	int result = 0;
546 
547 	index = shell_strtoul(argv[1], 0, &result);
548 	if (result != 0) {
549 		shell_error(sh, "Could not parse index: %d", result);
550 
551 		return -ENOEXEC;
552 	}
553 
554 	if (index >= micp_included.aics_cnt) {
555 		shell_error(sh, "Index shall be less than %u, was %lu",
556 			    micp_included.aics_cnt, index);
557 
558 		return -ENOEXEC;
559 	}
560 
561 	result = bt_aics_description_get(micp_included.aics[index]);
562 	if (result != 0) {
563 		shell_error(sh, "Fail: %d", result);
564 	}
565 
566 	return result;
567 }
568 
cmd_micp_mic_dev_aics_input_description_set(const struct shell * sh,size_t argc,char ** argv)569 static int cmd_micp_mic_dev_aics_input_description_set(const struct shell *sh,
570 						       size_t argc, char **argv)
571 {
572 	unsigned long index;
573 	int result = 0;
574 
575 	index = shell_strtoul(argv[1], 0, &result);
576 	if (result != 0) {
577 		shell_error(sh, "Could not parse index: %d", result);
578 
579 		return -ENOEXEC;
580 	}
581 
582 	if (index >= micp_included.aics_cnt) {
583 		shell_error(sh, "Index shall be less than %u, was %lu",
584 			    micp_included.aics_cnt, index);
585 
586 		return -ENOEXEC;
587 	}
588 
589 	result = bt_aics_description_set(micp_included.aics[index], argv[2]);
590 	if (result != 0) {
591 		shell_error(sh, "Fail: %d", result);
592 	}
593 
594 	return result;
595 }
596 #endif /* CONFIG_BT_MICP_MIC_DEV_AICS */
597 
cmd_micp_mic_dev(const struct shell * sh,size_t argc,char ** argv)598 static int cmd_micp_mic_dev(const struct shell *sh, size_t argc, char **argv)
599 {
600 	if (argc > 1) {
601 		shell_error(sh, "%s unknown parameter: %s",
602 			    argv[0], argv[1]);
603 	} else {
604 		shell_error(sh, "%s Missing subcommand", argv[0]);
605 	}
606 
607 	return -ENOEXEC;
608 }
609 
610 SHELL_STATIC_SUBCMD_SET_CREATE(micp_mic_dev_cmds,
611 	SHELL_CMD_ARG(init, NULL,
612 		      "Initialize the service and register callbacks",
613 		      cmd_micp_mic_dev_param, 1, 0),
614 	SHELL_CMD_ARG(mute_get, NULL,
615 		      "Get the mute state",
616 		      cmd_micp_mic_dev_mute_get, 1, 0),
617 	SHELL_CMD_ARG(mute, NULL,
618 		      "Mute the MICP server",
619 		      cmd_micp_mic_dev_mute, 1, 0),
620 	SHELL_CMD_ARG(unmute, NULL,
621 		      "Unmute the MICP server",
622 		      cmd_micp_mic_dev_unmute, 1, 0),
623 	SHELL_CMD_ARG(mute_disable, NULL,
624 		      "Disable the MICP mute",
625 		      cmd_micp_mic_dev_mute_disable, 1, 0),
626 #if defined(CONFIG_BT_MICP_MIC_DEV_AICS)
627 	SHELL_CMD_ARG(aics_deactivate, NULL,
628 		      "Deactivates a AICS instance <inst_index>",
629 		      cmd_micp_mic_dev_aics_deactivate, 2, 0),
630 	SHELL_CMD_ARG(aics_activate, NULL,
631 		      "Activates a AICS instance <inst_index>",
632 		      cmd_micp_mic_dev_aics_activate, 2, 0),
633 	SHELL_CMD_ARG(aics_input_state_get, NULL,
634 		      "Get the input state of a AICS instance <inst_index>",
635 		      cmd_micp_mic_dev_aics_input_state_get, 2, 0),
636 	SHELL_CMD_ARG(aics_gain_setting_get, NULL,
637 		      "Get the gain settings of a AICS instance <inst_index>",
638 		      cmd_micp_mic_dev_aics_gain_setting_get, 2, 0),
639 	SHELL_CMD_ARG(aics_input_type_get, NULL,
640 		      "Get the input type of a AICS instance <inst_index>",
641 		      cmd_micp_mic_dev_aics_input_type_get, 2, 0),
642 	SHELL_CMD_ARG(aics_input_status_get, NULL,
643 		      "Get the input status of a AICS instance <inst_index>",
644 		      cmd_micp_mic_dev_aics_input_status_get, 2, 0),
645 	SHELL_CMD_ARG(aics_input_unmute, NULL,
646 		      "Unmute the input of a AICS instance <inst_index>",
647 		      cmd_micp_mic_dev_aics_input_unmute, 2, 0),
648 	SHELL_CMD_ARG(aics_input_mute, NULL,
649 		      "Mute the input of a AICS instance <inst_index>",
650 		      cmd_micp_mic_dev_aics_input_mute, 2, 0),
651 	SHELL_CMD_ARG(aics_manual_input_gain_set, NULL,
652 		      "Set the gain mode of a AICS instance to manual "
653 		      "<inst_index>",
654 		      cmd_micp_mic_dev_aics_manual_input_gain_set, 2, 0),
655 	SHELL_CMD_ARG(aics_automatic_input_gain_set, NULL,
656 		      "Set the gain mode of a AICS instance to automatic "
657 		      "<inst_index>",
658 		      cmd_micp_mic_dev_aics_automatic_input_gain_set, 2, 0),
659 	SHELL_CMD_ARG(aics_gain_set, NULL,
660 		      "Set the gain in dB of a AICS instance <inst_index> "
661 		      "<gain (-128 to 127)>",
662 		      cmd_micp_mic_dev_aics_gain_set, 3, 0),
663 	SHELL_CMD_ARG(aics_input_description_get, NULL,
664 		      "Get the input description of a AICS instance "
665 		      "<inst_index>",
666 		      cmd_micp_mic_dev_aics_input_description_get, 2, 0),
667 	SHELL_CMD_ARG(aics_input_description_set, NULL,
668 		      "Set the input description of a AICS instance "
669 		      "<inst_index> <description>",
670 		      cmd_micp_mic_dev_aics_input_description_set, 3, 0),
671 #endif /* CONFIG_BT_MICP_MIC_DEV_AICS */
672 	SHELL_SUBCMD_SET_END
673 );
674 
675 SHELL_CMD_ARG_REGISTER(micp_mic_dev, &micp_mic_dev_cmds,
676 		       "Bluetooth MICP Microphone Device shell commands", cmd_micp_mic_dev, 1, 1);
677