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

Dan Williams dcbw at redhat.com
Wed Jan 6 08:59:52 PST 2016


On Wed, 2016-01-06 at 17:18 +0100, Aleksander Morgado wrote:
> 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.

Fixed and merged to master, 1-12, and 1-10.

Dan



More information about the libqmi-devel mailing list