* [PATCH BlueZ] client: Add support for scan <le/bredr>
@ 2022-03-03 0:31 Luiz Augusto von Dentz
2022-03-03 3:17 ` [BlueZ] " bluez.test.bot
0 siblings, 1 reply; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2022-03-03 0:31 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds support for entering the transport directly as an scan
argument rather than having to first set it scan.transport.
---
client/main.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/client/main.c b/client/main.c
index 719cbefe0..6bb11b1ad 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1294,6 +1294,7 @@ static struct set_discovery_filter_args {
dbus_bool_t discoverable;
bool set;
bool active;
+ unsigned int timeout;
} filter = {
.rssi = DISTANCE_VAL_INVALID,
.pathloss = DISTANCE_VAL_INVALID,
@@ -1415,18 +1416,33 @@ static void set_discovery_filter(bool cleared)
filter.set = true;
}
+static const char *scan_arguments[] = {
+ "on",
+ "off",
+ "bredr",
+ "le",
+ NULL
+};
+
static void cmd_scan(int argc, char *argv[])
{
dbus_bool_t enable;
const char *method;
+ const char *mode;
- if (!parse_argument(argc, argv, NULL, NULL, &enable, NULL))
+ if (!parse_argument(argc, argv, scan_arguments, "Mode", &enable,
+ &mode))
return bt_shell_noninteractive_quit(EXIT_FAILURE);
if (check_default_ctrl() == FALSE)
return bt_shell_noninteractive_quit(EXIT_FAILURE);
if (enable == TRUE) {
+ if (strcmp(mode, "")) {
+ g_free(filter.transport);
+ filter.transport = g_strdup(mode);
+ }
+
set_discovery_filter(false);
method = "StartDiscovery";
} else
@@ -2514,6 +2530,11 @@ static char *capability_generator(const char *text, int state)
return argument_generator(text, state, agent_arguments);
}
+static char *scan_generator(const char *text, int state)
+{
+ return argument_generator(text, state, scan_arguments);
+}
+
static void cmd_advertise(int argc, char *argv[])
{
dbus_bool_t enable;
@@ -3117,7 +3138,8 @@ static const struct bt_shell_menu main_menu = {
"Enable/disable advertising with given type",
ad_generator},
{ "set-alias", "<alias>", cmd_set_alias, "Set device alias" },
- { "scan", "<on/off>", cmd_scan, "Scan for devices", NULL },
+ { "scan", "<on/off/bredr/le>", cmd_scan,
+ "Scan for devices", scan_generator },
{ "info", "[dev]", cmd_info, "Device information",
dev_generator },
{ "pair", "[dev]", cmd_pair, "Pair with device",
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [BlueZ] client: Add support for scan <le/bredr>
2022-03-03 0:31 [PATCH BlueZ] client: Add support for scan <le/bredr> Luiz Augusto von Dentz
@ 2022-03-03 3:17 ` bluez.test.bot
2022-03-08 0:53 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 3+ messages in thread
From: bluez.test.bot @ 2022-03-03 3:17 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1950 bytes --]
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=619734
---Test result---
Test Summary:
CheckPatch FAIL 1.60 seconds
GitLint PASS 1.09 seconds
Prep - Setup ELL PASS 50.66 seconds
Build - Prep PASS 0.92 seconds
Build - Configure PASS 10.27 seconds
Build - Make PASS 1761.16 seconds
Make Check PASS 13.30 seconds
Make Check w/Valgrind PASS 532.70 seconds
Make Distcheck PASS 280.62 seconds
Build w/ext ELL - Configure PASS 10.33 seconds
Build w/ext ELL - Make PASS 1735.38 seconds
Incremental Build with patchesPASS 0.00 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
Output:
[BlueZ] client: Add support for scan <le/bredr>
WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const
#102: FILE: client/main.c:1419:
+static const char *scan_arguments[] = {
/github/workspace/src/12766921.patch total: 0 errors, 1 warnings, 61 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/12766921.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BlueZ] client: Add support for scan <le/bredr>
2022-03-03 3:17 ` [BlueZ] " bluez.test.bot
@ 2022-03-08 0:53 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2022-03-08 0:53 UTC (permalink / raw)
To: linux-bluetooth
Hi,
On Wed, Mar 2, 2022 at 7:17 PM <bluez.test.bot@gmail.com> wrote:
>
> 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=619734
>
> ---Test result---
>
> Test Summary:
> CheckPatch FAIL 1.60 seconds
> GitLint PASS 1.09 seconds
> Prep - Setup ELL PASS 50.66 seconds
> Build - Prep PASS 0.92 seconds
> Build - Configure PASS 10.27 seconds
> Build - Make PASS 1761.16 seconds
> Make Check PASS 13.30 seconds
> Make Check w/Valgrind PASS 532.70 seconds
> Make Distcheck PASS 280.62 seconds
> Build w/ext ELL - Configure PASS 10.33 seconds
> Build w/ext ELL - Make PASS 1735.38 seconds
> Incremental Build with patchesPASS 0.00 seconds
>
> Details
> ##############################
> Test: CheckPatch - FAIL
> Desc: Run checkpatch.pl script with rule in .checkpatch.conf
> Output:
> [BlueZ] client: Add support for scan <le/bredr>
> WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const
> #102: FILE: client/main.c:1419:
> +static const char *scan_arguments[] = {
>
> /github/workspace/src/12766921.patch total: 0 errors, 1 warnings, 61 lines checked
>
> NOTE: For some of the reported defects, checkpatch may be able to
> mechanically convert to the typical style using --fix or --fix-inplace.
>
> /github/workspace/src/12766921.patch has style problems, please review.
>
> NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
>
> NOTE: If any of the errors are false positives, please report
> them to the maintainer, see CHECKPATCH in MAINTAINERS.
>
>
>
>
> ---
> Regards,
> Linux Bluetooth
>
Pushed.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-08 0:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 0:31 [PATCH BlueZ] client: Add support for scan <le/bredr> Luiz Augusto von Dentz
2022-03-03 3:17 ` [BlueZ] " bluez.test.bot
2022-03-08 0:53 ` Luiz Augusto von Dentz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.