client: Add prompt to enter metadata for custom presets
Luiz Augusto von Dentz
maintainerPATCH 1/1 client: Add prompt to enter metadata for custom presets
From: Luiz Augusto von Dentz <[email protected]>
When adding a custom preset prompt the user to enter metadata for it e.g.:
[bluetoothctl]> endpoint.presets 00002bcb-0000-1000-8000-00805f9b34fb 0x06 custom [Codec] Enter frequency (Khz): **
[Codec] Enter frame duration (ms): *
[Codec] Enter channel allocation: *
[Codec] Enter frame length: **
[Metadata] Enter Metadata (value/no): <len> <type> <value...>
--- client/player.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
client/player.c +20 -1
@@ -3900,6 +3900,24 @@ fail:return bt_shell_noninteractive_quit (EXIT_FAILURE ); } +static void custom_metadata (const char *input,void *user_data) +{ +struct codec_preset *p = user_data; +struct iovec *meta = (void *)&p->meta; + +if (!strcasecmp (input,"n" ) || !strcasecmp (input,"no" )) + goto done; + + meta->iov_base =str2bytearray ((void *)input, &meta->iov_len); +if (!meta->iov_base) { +bt_shell_printf ("Invalid metadata %s\n" , input); +return bt_shell_noninteractive_quit (EXIT_FAILURE ); + } + +done: +return bt_shell_noninteractive_quit (EXIT_SUCCESS ); +} +static void custom_delay (const char *input,void *user_data) {struct codec_preset *p = user_data;
@@ -3916,7 +3934,8 @@ static void custom_delay(const char *input, void *user_data)return bt_shell_noninteractive_quit (EXIT_FAILURE ); } -return bt_shell_noninteractive_quit (EXIT_SUCCESS ); +bt_shell_prompt_input ("Metadata" ,"Enter Metadata (value/no):" , + custom_metadata, user_data); }static void custom_latency (const char *input,void *user_data)
Signature · 1 line
2.49.0
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=971929
---Test result---
Test Summary:
CheckPatch PENDING 0.44 seconds GitLint PENDING 0.37 seconds BuildEll PASS 20.08 seconds BluezMake PASS 2768.24 seconds MakeCheck PASS 20.72 seconds MakeDistcheck PASS 200.48 seconds CheckValgrind PASS 276.56 seconds CheckSmatch PASS 304.65 seconds bluezmakeextell PASS 128.88 seconds IncrementalBuild PENDING 0.35 seconds ScanBuild PASS 915.79 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:
---
Regards,
Linux Bluetooth