diff mbox series

[BlueZ,2/5] client: Print integers decimal value

Message ID 20230619203032.6812-2-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,1/5] shared/bap: Add unespecified bit in audio context to PAC records | expand

Commit Message

Luiz Augusto von Dentz June 19, 2023, 8:30 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This make the code print D-Bus integer iterators also in decimal format
in addition to hexadecimal.
---
 client/print.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/client/print.c b/client/print.c
index 798d22c7e..66439e541 100644
--- a/client/print.c
+++ b/client/print.c
@@ -127,15 +127,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);