From ebc643ffb0108f8f17e3e9bb8a5d1f7522c681b0 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 2 Feb 2023 15:18:25 +0100 Subject: [PATCH] pkg/nimble/autoadv: fix flag comparisons --- pkg/nimble/autoadv/nimble_autoadv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/nimble/autoadv/nimble_autoadv.c b/pkg/nimble/autoadv/nimble_autoadv.c index 32c1b14cd8..590f3fe778 100644 --- a/pkg/nimble/autoadv/nimble_autoadv.c +++ b/pkg/nimble/autoadv/nimble_autoadv.c @@ -192,11 +192,11 @@ void nimble_autoadv_start(ble_addr_t *addr) if (addr != NULL) { mode = BLE_GAP_CONN_MODE_DIR; } - else if (_cfg.flags && NIMBLE_AUTOADV_FLAG_CONNECTABLE) { + else if (_cfg.flags & NIMBLE_AUTOADV_FLAG_CONNECTABLE) { mode = BLE_GAP_CONN_MODE_UND; } - uint8_t disc = (_cfg.flags && NIMBLE_AUTOADV_FLAG_SCANNABLE) ? BLE_GAP_CONN_MODE_DIR - : BLE_GAP_CONN_MODE_UND; + uint8_t disc = (_cfg.flags & NIMBLE_AUTOADV_FLAG_SCANNABLE) ? BLE_GAP_CONN_MODE_DIR + : BLE_GAP_CONN_MODE_UND; struct ble_gap_adv_params advp = { .conn_mode = mode, .disc_mode = disc,