Skip to content

Commit f1c13be

Browse files
jhedbergolivier-le-sage
authored andcommitted
[nrf fromtree] Bluetooth: Mesh: shell: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated bt_hci_cmd_create(). Signed-off-by: Johan Hedberg <[email protected]> (cherry picked from commit 58fe2ab)
1 parent 060074d commit f1c13be

File tree

1 file changed

+2
-6
lines changed
  • subsys/bluetooth/mesh/shell

1 file changed

+2
-6
lines changed

subsys/bluetooth/mesh/shell/hci.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ int cmd_mesh_adv(const struct shell *sh, size_t argc, char *argv[])
3030
if (!strcmp(argv[1], "on")) {
3131
struct bt_hci_cp_mesh_advertise *cp;
3232

33-
buf = bt_hci_cmd_create(BT_HCI_OP_VS_MESH,
34-
sizeof(struct bt_hci_cp_mesh) +
35-
sizeof(*cp));
33+
buf = bt_hci_cmd_alloc(K_FOREVER);
3634
if (!buf) {
3735
return -ENOBUFS;
3836
}
@@ -58,9 +56,7 @@ int cmd_mesh_adv(const struct shell *sh, size_t argc, char *argv[])
5856
} else if (!strcmp(argv[1], "off")) {
5957
struct bt_hci_cp_mesh_advertise_cancel *cp;
6058

61-
buf = bt_hci_cmd_create(BT_HCI_OP_VS_MESH,
62-
sizeof(struct bt_hci_cp_mesh) +
63-
sizeof(*cp));
59+
buf = bt_hci_cmd_alloc(K_FOREVER);
6460
if (!buf) {
6561
return -ENOBUFS;
6662
}

0 commit comments

Comments
 (0)