mesh: Fix invalid netkey index in appkey add/delete
authorNagaraj D R <nagaraj.dr@samsung.com>
Tue, 3 Dec 2019 09:53:27 +0000 (15:23 +0530)
committerAnupam Roy <anupam.r@samsung.com>
Tue, 17 Dec 2019 20:50:19 +0000 (02:20 +0530)
8 LSbs of netkey index should be packed into the first octet

Change-Id: Ia2226334e4ef9702e44a9fa96a28e8273780ac04
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
tools/mesh-gatt/config-client.c

index 5e6374f..ed31c67 100644 (file)
@@ -591,7 +591,7 @@ static void cmd_app_key(int argc, char *argv[], uint32_t opcode)
                return bt_shell_noninteractive_quit(EXIT_FAILURE);
        }
 
-       msg[n++] = net_idx & 0xf;
+       msg[n++] = net_idx & 0xff;
        msg[n++] = ((net_idx >> 8) & 0xf) |
                ((app_idx << 4) & 0xf0);
        msg[n++] = app_idx >> 4;