Message ID | 20250122113103.1106793-2-hadess@hadess.net (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | device: Better "Connect" debug | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/BuildEll | success | Build ELL PASS |
tedd_an/BluezMake | success | Bluez Make PASS |
tedd_an/MakeCheck | success | Bluez Make Check PASS |
tedd_an/MakeDistcheck | success | Make Distcheck PASS |
tedd_an/CheckValgrind | success | Check Valgrind PASS |
tedd_an/CheckSmatch | success | CheckSparse PASS |
tedd_an/bluezmakeextell | success | Make External ELL PASS |
tedd_an/ScanBuild | success | Scan Build PASS |
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=927510 ---Test result--- Test Summary: CheckPatch PENDING 0.21 seconds GitLint PENDING 0.18 seconds BuildEll PASS 20.58 seconds BluezMake PASS 1499.01 seconds MakeCheck PASS 13.54 seconds MakeDistcheck PASS 159.69 seconds CheckValgrind PASS 214.64 seconds CheckSmatch PASS 269.96 seconds bluezmakeextell PASS 101.52 seconds IncrementalBuild PENDING 0.32 seconds ScanBuild PASS 857.18 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
diff --git a/Makefile.tools b/Makefile.tools index 0dca43327fdd..41b4b4f0545f 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -10,6 +10,8 @@ client_bluetoothctl_SOURCES = client/main.c \ client/advertising.c \ client/adv_monitor.h \ client/adv_monitor.c \ + client/error.h \ + client/error.c \ client/gatt.h client/gatt.c \ client/admin.h client/admin.c \ client/player.h client/player.c \ diff --git a/client/error.c b/client/error.c new file mode 100644 index 000000000000..975e4030dfc0 --- /dev/null +++ b/client/error.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2025 Bastien Nocera <hadess@hadess.net> + * + * + */ + +#include <stddef.h> +#include <glib.h> +#include "error.h" + +struct { + const char *error_code; + const char *str; +} error_codes[] = { + { "br-connection-profile-unavailable", "Exhausted the list of BR/EDR profiles to connect to" }, + { "br-connection-busy", "Cannot connect, connection busy" }, + { "br-connection-adapter-not-powered", "Cannot connect, adapter is not powered" }, +}; + +const char *error_code_to_str(const char *error_code) +{ + unsigned int i; + + if (error_code == NULL) + return NULL; + + for (i = 0; i < G_N_ELEMENTS(error_codes); i++) { + if (g_str_equal(error_codes[i].error_code, error_code)) + return error_codes[i].str; + } + return error_code; +} diff --git a/client/error.h b/client/error.h new file mode 100644 index 000000000000..402117f3305b --- /dev/null +++ b/client/error.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2025 Bastien Nocera <hadess@hadess.net> + * + * + */ + +const char *error_code_to_str(const char *error_code);