From aee842f466963a439795b2351ea2fa39da393623 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 4 Mar 2021 14:17:40 -0800 Subject: [PATCH] adapter: Fix not using the correct setting set_mode shall use opcode to identify what setting are being changed rather then the mode. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- src/adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index f8a17cb..08c6ed4 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1066,7 +1066,7 @@ static bool set_mode(struct btd_adapter *adapter, uint16_t opcode, memset(&cp, 0, sizeof(cp)); cp.val = mode; - switch (mode) { + switch (opcode) { case MGMT_OP_SET_POWERED: setting = MGMT_SETTING_POWERED; break; -- 2.7.4