Skip to contentSkip to conversation

gatt: Fix checking for paired flag instead of bonded

PATCH Applied Luiz Augusto von Dentz 2 participants 2 messages Mar 27, 2018 – Mar 28, 2018 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 gatt: Fix checking for paired flag instead of bonded

From: Luiz Augusto von Dentz <[email protected]>

Device state should remain valid for devices that are bonded/stored not only paired.

---
 src/gatt-database.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/gatt-database.c +2 -2
index 2c2526f74..5e2390b34 100644
@@ -324,7 +324,7 @@ static void att_disconnected(int err, void *user_data)
 	if (!device)
 		goto remove;
 
-	if (device_is_paired(device, state->bdaddr_type))
+	if (device_is_bonded(device, state->bdaddr_type))
 		return;
 
 remove:
@@ -1125,7 +1125,7 @@ static void send_notification_to_device(void *data, void *user_data)
 
 	server = btd_device_get_gatt_server(device);
 	if (!server) {
-		if (!device_is_paired(device, device_state->bdaddr_type))
+		if (!device_is_bonded(device, device_state->bdaddr_type))
 			goto remove;
 		state_set_pending(device_state, notify);
 		return;
Signature · 1 line
2.14.3
Applied
#1 lore raw

Hi Luiz,

Quoted 30 lines · On Tuesday, 27 March 2018 17:38:20 CEST Luiz Augusto von Dentz wrote:

From: Luiz Augusto von Dentz <[email protected]>

Device state should remain valid for devices that are bonded/stored not only paired.

---
 src/gatt-database.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/gatt-database.c +2 -2
index 2c2526f74..5e2390b34 100644
@@ -324,7 +324,7 @@ static void att_disconnected(int err, void *user_data)
 	if (!device)
 		goto remove;
 
-	if (device_is_paired(device, state->bdaddr_type))
+	if (device_is_bonded(device, state->bdaddr_type))
 		return;
 
 remove:
@@ -1125,7 +1125,7 @@ static void send_notification_to_device(void *data,
 void *user_data)
 
 	server = btd_device_get_gatt_server(device);
 	if (!server) {
-		if (!device_is_paired(device, device_state->bdaddr_type))
+		if (!device_is_bonded(device, device_state->bdaddr_type))
 			goto remove;
 		state_set_pending(device_state, notify);
Quoted 1 line

return;

Applied, thanks.

Signature · 2 lines
pozdrawiam
Szymon Janc