Skip to content

Commit

Permalink
dbus: Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermartin committed Mar 13, 2024
1 parent 7925aa6 commit faaf234
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dbus/gattlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@ gboolean on_handle_device_property_change(
while (g_variant_iter_loop (iter, "{&sv}", &key, &value)) {
if (strcmp(key, "Connected") == 0) {
if (!g_variant_get_boolean(value)) {
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change: Disconnection");
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change(%s): Disconnection",
conn_context->device_object_path);
gattlib_on_disconnected_device(connection);
} else {
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change: Connection");
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change(%s): Connection",
conn_context->device_object_path);
}
} else if (strcmp(key, "ServicesResolved") == 0) {
if (g_variant_get_boolean(value)) {
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change: Service Resolved");
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: device_property_change(%s): Service Resolved",
conn_context->device_object_path);
_on_device_connect(connection);
}
}
Expand Down

0 comments on commit faaf234

Please sign in to comment.