Skip to content

Commit d5aa8d6

Browse files
committed
Fix logging for on_interface_proxy_properties_changed()
1 parent 306acf8 commit d5aa8d6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

dbus/gattlib_adapter.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,20 @@ on_interface_proxy_properties_changed (GDBusObjectManagerClient *device_manager,
183183
const gchar *const *invalidated_properties,
184184
gpointer user_data)
185185
{
186-
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: on_interface_proxy_properties_changed: interface:%s changed_properties:%s invalidated_properties:%s",
186+
// Count number of invalidated properties
187+
size_t invalidated_properties_count = 0;
188+
if (invalidated_properties != NULL) {
189+
const gchar *const *invalidated_properties_ptr = invalidated_properties;
190+
while (*invalidated_properties_ptr != NULL) {
191+
invalidated_properties_count++;
192+
invalidated_properties_ptr++;
193+
}
194+
}
195+
196+
GATTLIB_LOG(GATTLIB_DEBUG, "DBUS: on_interface_proxy_properties_changed: interface:%s changed_properties:%s invalidated_properties:%d",
187197
g_dbus_proxy_get_interface_name(interface_proxy),
188198
g_variant_print(changed_properties, TRUE),
189-
invalidated_properties);
199+
invalidated_properties_count);
190200

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

0 commit comments

Comments
 (0)