summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-09-13 22:22:12 -0400
committerPete Johanson <peter@peterjohanson.com>2020-09-13 22:33:31 -0400
commit4658999e31865e54d02955c500c716385e6c69d8 (patch)
tree63218f4af1b20108af667de8e346d204076064bb
parent6c8b0b53f0dbec695ab967ee947916875ed49352 (diff)
fix(bluetooth): Reject pairing to taken profiles.
-rw-r--r--app/src/ble.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/src/ble.c b/app/src/ble.c
index 40e05a3..a2a8207 100644
--- a/app/src/ble.c
+++ b/app/src/ble.c
@@ -366,7 +366,7 @@ static enum bt_security_err auth_pairing_accept(struct bt_conn *conn, const stru
bt_conn_get_info(conn, &info);
LOG_DBG("role %d, open? %s", info.role, active_profile_is_open() ? "yes" : "no");
- if (info.role != BT_CONN_ROLE_SLAVE && !active_profile_is_open()) {
+ if (info.role == BT_CONN_ROLE_SLAVE && !active_profile_is_open()) {
LOG_WRN("Rejecting pairing request to taken profile %d", active_profile);
return BT_SECURITY_ERR_PAIR_NOT_ALLOWED;
}