gatt: Print error if gatt_db_attribut_notify fails
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 14 Mar 2022 21:46:21 +0000 (14:46 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:53 +0000 (14:55 +0530)
This prints an error if gatt_db_attribut_notify fails.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/gatt-database.c

index 9b746fc..8c56a2e 100644 (file)
@@ -1926,8 +1926,9 @@ static void send_service_changed(struct btd_gatt_database *database,
        put_le16(start, value);
        put_le16(end, value + 2);
 
-       gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value),
-                               NULL);
+       if (!gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value),
+                                                               NULL))
+               error("Failed to notify Service Changed");
 }
 
 static void gatt_db_service_added(struct gatt_db_attribute *attrib,
@@ -4682,6 +4683,7 @@ void btd_gatt_database_restore_svc_chng_ccc(struct btd_gatt_database *database)
        put_le16(0x0001, value);
        put_le16(0xffff, value + 2);
 
-       gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value),
-                               NULL);
+       if (!gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value),
+                                                               NULL))
+               error("Failed to notify Service Changed");
 }