[PATCH] libqmi-glib,device: debug-print raw invalid QMI messages too
Dan Williams
dcbw at redhat.com
Tue Jan 5 09:48:21 PST 2016
---
src/libqmi-glib/qmi-device.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c
index c9d05c0..04bac97 100644
--- a/src/libqmi-glib/qmi-device.c
+++ b/src/libqmi-glib/qmi-device.c
@@ -1451,6 +1451,22 @@ parse_response (QmiDevice *self)
self->priv->path_display,
error->message);
g_error_free (error);
+
+ if (qmi_utils_get_traces_enabled ()) {
+ gchar *printable;
+ guint len = CLAMP (self->priv->buffer->len, 0, 2048);
+
+ printable = __qmi_utils_str_hex (self->priv->buffer->data,
+ len,
+ ':');
+ g_debug ("<<<<<< RAW INVALID MESSAGE:\n"
+ "<<<<<< length = %u\n"
+ "<<<<<< data = %s\n",
+ self->priv->buffer->len, /* show full buffer len */
+ printable);
+ g_free (printable);
+ }
+
} else {
/* Play with the received message */
process_message (self, message);
--
2.4.3
More information about the libqmi-devel
mailing list