Skip to content

Commit

Permalink
Fix logging for on_interface_proxy_properties_changed()
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermartin committed Feb 11, 2024
1 parent 306acf8 commit d5aa8d6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dbus/gattlib_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,20 @@ on_interface_proxy_properties_changed (GDBusObjectManagerClient *device_manager,
const gchar *const *invalidated_properties,
gpointer user_data)
{
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: on_interface_proxy_properties_changed: interface:%s changed_properties:%s invalidated_properties:%s",
// Count number of invalidated properties
size_t invalidated_properties_count = 0;
if (invalidated_properties != NULL) {
const gchar *const *invalidated_properties_ptr = invalidated_properties;
while (*invalidated_properties_ptr != NULL) {
invalidated_properties_count++;
invalidated_properties_ptr++;
}
}

GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: on_interface_proxy_properties_changed: interface:%s changed_properties:%s invalidated_properties:%d",
g_dbus_proxy_get_interface_name(interface_proxy),
g_variant_print(changed_properties, TRUE),
invalidated_properties);
invalidated_properties_count);

// Check if the object is a 'org.bluez.Device1'
if (strcmp(g_dbus_proxy_get_interface_name(interface_proxy), "org.bluez.Device1") != 0) {
Expand Down

0 comments on commit d5aa8d6

Please sign in to comment.