client: Print integers decimal value
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 19 Jun 2023 20:30:29 +0000 (13:30 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 13:34:03 +0000 (19:04 +0530)
This make the code print D-Bus integer iterators also in decimal format
in addition to hexadecimal.

client/print.c

index 0314421..cfc0f48 100644 (file)
@@ -126,15 +126,18 @@ void print_iter(const char *label, const char *name, DBusMessageIter *iter)
                break;
        case DBUS_TYPE_UINT32:
                dbus_message_iter_get_basic(iter, &valu32);
-               bt_shell_printf("%s%s: 0x%08x\n", label, name, valu32);
+               bt_shell_printf("%s%s: 0x%08x (%d)\n", label, name, valu32,
+                                                               valu32);
                break;
        case DBUS_TYPE_UINT16:
                dbus_message_iter_get_basic(iter, &valu16);
-               bt_shell_printf("%s%s: 0x%04x\n", label, name, valu16);
+               bt_shell_printf("%s%s: 0x%04x (%d)\n", label, name, valu16,
+                                                               valu16);
                break;
        case DBUS_TYPE_INT16:
                dbus_message_iter_get_basic(iter, &vals16);
-               bt_shell_printf("%s%s: %d\n", label, name, vals16);
+               bt_shell_printf("%s%s: 0x%04x (%d)\n", label, name, vals16,
+                                                               vals16);
                break;
        case DBUS_TYPE_BYTE:
                dbus_message_iter_get_basic(iter, &byte);