Skip to content

Commit

Permalink
on_handle_device_property_change: Logging changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermartin committed Feb 15, 2024
1 parent f894c8e commit ad7aa18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dbus/gattlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ gboolean on_handle_device_property_change(

g_variant_get (arg_changed_properties, "a{sv}", &iter);
while (g_variant_iter_loop (iter, "{&sv}", &key, &value)) {
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change: %s: %s", key, g_variant_print(value, TRUE));
if (strcmp(key, "Connected") == 0) {
if (!g_variant_get_boolean(value)) {
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change: Disconnection");
gattlib_on_disconnected_device(connection);
} else {
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change: Connection");
}
} else if (strcmp(key, "ServicesResolved") == 0) {
if (g_variant_get_boolean(value)) {
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change: Service Resolved");
_on_device_connect(connection);
}
}
Expand Down

0 comments on commit ad7aa18

Please sign in to comment.