Skip to content

Commit f0348f9

Browse files
committed
Bluetooth: ISO: Shell: Fix bcode for big_create
The broadcast code was attempting to read from argv[1] instead of argv[2] that actually contains the broadcast code. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 4875978 commit f0348f9

File tree

1 file changed

+5
-3
lines changed
  • subsys/bluetooth/host/shell

1 file changed

+5
-3
lines changed

subsys/bluetooth/host/shell/iso.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <stddef.h>
1414
#include <stdlib.h>
1515
#include <ctype.h>
16+
#include <string.h>
1617
#include <zephyr/bluetooth/hci_types.h>
1718
#include <zephyr/kernel.h>
1819
#include <zephyr/shell/shell.h>
@@ -794,10 +795,11 @@ static int cmd_big_create(const struct shell *sh, size_t argc, char *argv[])
794795

795796
if (argc > 1) {
796797
if (!strcmp(argv[1], "enc")) {
797-
uint8_t bcode_len = hex2bin(argv[1], strlen(argv[1]), param.bcode,
798-
sizeof(param.bcode));
798+
size_t bcode_len =
799+
hex2bin(argv[2], strlen(argv[2]), param.bcode, sizeof(param.bcode));
800+
799801
if (!bcode_len || bcode_len != sizeof(param.bcode)) {
800-
shell_error(sh, "Invalid Broadcast Code Length");
802+
shell_error(sh, "Invalid Broadcast Code Length %zu", bcode_len);
801803
return -ENOEXEC;
802804
}
803805
param.encryption = true;

0 commit comments

Comments
 (0)