From 4bac5bfb125b00485f1cc4c12466810ce0d4bd3d Mon Sep 17 00:00:00 2001 From: DeepPG <92751452+DeepPG@users.noreply.github.com> Date: Sat, 8 Aug 2026 12:09:03 +0300 Subject: [PATCH] Normalize enable argument in control functions --- src/hci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hci.c b/src/hci.c index 4e54631b04..abf6ba2c1d 100644 --- a/src/hci.c +++ b/src/hci.c @@ -6405,7 +6405,7 @@ static void hci_update_scan_enable(void){ } void gap_discoverable_control(uint8_t enable){ - if (enable) enable = 1; // normalize argument + enable = !!enable // normalize argument if (hci_stack->discoverable == enable){ hci_emit_scan_mode_changed(hci_stack->discoverable, hci_stack->connectable); @@ -6417,7 +6417,7 @@ void gap_discoverable_control(uint8_t enable){ } void gap_connectable_control(uint8_t enable){ - if (enable) enable = 1; // normalize argument + enable = !!enable // normalize argument // don't emit event if (hci_stack->connectable == enable) return;