Bluetooth: GATT: Fix ccc cfg clear logic on disconnect
The ccc config clear logic should only clear its own cfg value if it is not bonded and not the other ones. Change-Id: I1b053b714744bdfb61fdbb445c08dffd3c9e1a1f Signed-off-by: Roger Lendenmann <roger.lendenmann@intel.com>
This commit is contained in:
parent
d75acb44c3
commit
a96e8bb615
1 changed files with 6 additions and 6 deletions
|
@ -645,7 +645,7 @@ static uint8_t disconnected_cb(const struct bt_gatt_attr *attr, void *user_data)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bt_addr_le_cmp(&conn->le.dst, &ccc->cfg[i].peer)) {
|
if (bt_addr_le_cmp(&conn->le.dst, &ccc->cfg[i].peer)) {
|
||||||
struct bt_conn *tmp;
|
struct bt_conn *tmp;
|
||||||
|
|
||||||
/* Skip if there is another peer connected */
|
/* Skip if there is another peer connected */
|
||||||
|
@ -657,12 +657,12 @@ static uint8_t disconnected_cb(const struct bt_gatt_attr *attr, void *user_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
bt_conn_unref(tmp);
|
bt_conn_unref(tmp);
|
||||||
|
|
||||||
/* Clear value if not paired */
|
|
||||||
if (!ccc->cfg[i].valid)
|
|
||||||
memset(&ccc->cfg[i].value, 0,
|
|
||||||
sizeof(ccc->cfg[i].value));
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* Clear value if not paired */
|
||||||
|
if (!ccc->cfg[i].valid)
|
||||||
|
memset(&ccc->cfg[i].value, 0,
|
||||||
|
sizeof(ccc->cfg[i].value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue