From 17ea315e203906e44351ee43ea59700b3dc98c39 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 19 Dec 2016 15:48:48 +0100 Subject: [PATCH] Bluetooth: shell: Add option to specify BR/EDR discovery length This allows to specify length of discovery from command line. Change-Id: I3ad80e74b5cdc263e549ce309b75c1f5c117b653 Signed-off-by: Szymon Janc --- tests/bluetooth/shell/src/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/bluetooth/shell/src/main.c b/tests/bluetooth/shell/src/main.c index 7fe4f25f807..3929f0da927 100644 --- a/tests/bluetooth/shell/src/main.c +++ b/tests/bluetooth/shell/src/main.c @@ -1704,10 +1704,13 @@ static int cmd_bredr_discovery(int argc, char *argv[]) struct bt_br_discovery_param param; param.limited = false; - /* FIXME: expose providing length on the command line */ param.length = 8; - if (argc > 2 && !strcmp(argv[2], "limited")) { + if (argc > 2) { + param.length = atoi(argv[2]); + } + + if (argc > 3 && !strcmp(argv[3], "limited")) { param.limited = true; } @@ -2291,7 +2294,7 @@ static const struct shell_cmd commands[] = { { "br-pscan", cmd_bredr_connectable, "value: on, off" }, { "br-connect", cmd_connect_bredr, "
" }, { "br-discovery", cmd_bredr_discovery, - " [mode: limited]" }, + " [length: 0x01-0x30] [mode: limited]" }, { "br-l2cap-register", cmd_bredr_l2cap_register, "" }, { "br-oob", cmd_bredr_oob }, #if defined(CONFIG_BLUETOOTH_RFCOMM)