[PATCH] libqmi-glib, device: debug-print raw invalid QMI messages too

Aleksander Morgado aleksander at aleksander.es
Wed Jan 6 08:18:21 PST 2016


On Tue, Jan 5, 2016 at 6:48 PM, Dan Williams <dcbw at redhat.com> wrote:
> ---
>  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,
> +                                                 ':');

Maybe just a single line for the previous call?

> +                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);

Otherwise looks good, go merge it.

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list