diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-29 11:08:05 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-30 09:13:51 +0100 |
commit | d89b9064afa991d5cc7737fa9b0b1b55c0e31158 (patch) | |
tree | b66d846114812ba796ad1d7cb02f2f3123d824e6 /libqmi-glib | |
parent | 996c343b90eb10de33646643d27762f463cd5309 (diff) |
libqmi-glib,message: include raw data buffer when building printable string
Diffstat (limited to 'libqmi-glib')
-rw-r--r-- | libqmi-glib/qmi-message.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libqmi-glib/qmi-message.c b/libqmi-glib/qmi-message.c index 2c2394e..4dd88cf 100644 --- a/libqmi-glib/qmi-message.c +++ b/libqmi-glib/qmi-message.c @@ -800,6 +800,7 @@ qmi_message_get_printable (QmiMessage *self, GString *printable; gchar *qmi_flags_str; gchar *contents; + gchar *raw; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (line_prefix != NULL, NULL); @@ -808,6 +809,20 @@ qmi_message_get_printable (QmiMessage *self, line_prefix = ""; printable = g_string_new (""); + + /* Print raw binary stream */ + raw = __qmi_utils_str_hex (((GByteArray *)self)->data, + ((GByteArray *)self)->len, + ':'); + g_string_append_printf (printable, + "%sRAW:\n" + "%s length = %u\n" + "%s data = %s\n", + line_prefix, + line_prefix, ((GByteArray *)self)->len, + line_prefix, raw); + g_free (raw); + g_string_append_printf (printable, "%sQMUX:\n" "%s length = %u\n" |