Hello community,

here is the log from the commit of package libqmi for openSUSE:Factory checked 
in at 2020-05-14 23:23:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libqmi (Old)
 and      /work/SRC/openSUSE:Factory/.libqmi.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libqmi"

Thu May 14 23:23:11 2020 rev:31 rq:805077 version:1.24.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/libqmi/libqmi.changes    2020-04-25 
20:08:12.179532730 +0200
+++ /work/SRC/openSUSE:Factory/.libqmi.new.2738/libqmi.changes  2020-05-14 
23:23:15.192779170 +0200
@@ -1,0 +2,16 @@
+Sat May  9 12:29:42 UTC 2020 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 1.24.12:
+  * libqmi-glib:
+    - Skip UTF-8 validation on 0xFF suffix that may happen in
+      fixed sized strings (e.g. 2-digit MNC value in 3-byte fixed
+      sized field).
+    - Explicitly allow CR and LF as valid characters in strings
+      (e.g. when given in NMEA trace indications).
+  * qmi-proxy:
+    - Fix loss of last requests on client hangup.
+    - Fix missing indication/removal signal handling in clients.
+    - Fix forwarding of broadcast indications to all clients.
+  * Several other minor improvements and fixes.
+
+-------------------------------------------------------------------

Old:
----
  libqmi-1.24.10.tar.xz

New:
----
  libqmi-1.24.12.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libqmi.spec ++++++
--- /var/tmp/diff_new_pack.qDPvTG/_old  2020-05-14 23:23:15.904780724 +0200
+++ /var/tmp/diff_new_pack.qDPvTG/_new  2020-05-14 23:23:15.908780733 +0200
@@ -20,7 +20,7 @@
 %define _soname libqmi-glib5
 
 Name:           libqmi
-Version:        1.24.10
+Version:        1.24.12
 Release:        0
 # NOTE: The file headers state LESSER GPL, which is a mistake. The upstream 
intended license is LIBRARY GPL 2.0+
 Summary:        Library to control QMI devices

++++++ libqmi-1.24.10.tar.xz -> libqmi-1.24.12.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/Makefile.in 
new/libqmi-1.24.12/Makefile.in
--- old/libqmi-1.24.10/Makefile.in      2020-04-10 14:32:34.000000000 +0200
+++ new/libqmi-1.24.12/Makefile.in      2020-05-09 11:04:25.000000000 +0200
@@ -163,7 +163,7 @@
 DIST_SUBDIRS = $(SUBDIRS)
 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
        COPYING COPYING.LIB ChangeLog INSTALL NEWS README TODO compile \
-       config.guess config.sub depcomp install-sh ltmain.sh missing
+       config.guess config.sub install-sh ltmain.sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/NEWS new/libqmi-1.24.12/NEWS
--- old/libqmi-1.24.10/NEWS     2020-04-10 14:32:24.000000000 +0200
+++ new/libqmi-1.24.12/NEWS     2020-05-09 11:02:03.000000000 +0200
@@ -1,4 +1,21 @@
 
+Overview of changes in libqmi 1.24.12
+----------------------------------------
+
+ * libqmi-glib:
+   ** Skip UTF-8 validation on 0xFF suffix that may happen in fixed sized
+      strings (e.g. 2-digit MNC value in 3-byte fixed sized field).
+   ** Explicitly allow CR and LF as valid characters in strings (e.g. when
+      given in NMEA trace indications).
+
+ * qmi-proxy:
+   ** Fix loss of last requests on client hangup.
+   ** Fix missing indication/removal signal handling in clients.
+   ** Fix forwarding of broadcast indications to all clients.
+
+ * Several other minor improvements and fixes.
+
+
 Overview of changes in libqmi 1.24.10
 ----------------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/configure new/libqmi-1.24.12/configure
--- old/libqmi-1.24.10/configure        2020-04-10 14:32:34.000000000 +0200
+++ new/libqmi-1.24.12/configure        2020-05-09 11:04:24.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libqmi 1.24.10.
+# Generated by GNU Autoconf 2.69 for libqmi 1.24.12.
 #
 # Report bugs to <libqmi-de...@lists.freedesktop.org>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='libqmi'
 PACKAGE_TARNAME='libqmi'
-PACKAGE_VERSION='1.24.10'
-PACKAGE_STRING='libqmi 1.24.10'
+PACKAGE_VERSION='1.24.12'
+PACKAGE_STRING='libqmi 1.24.12'
 PACKAGE_BUGREPORT='libqmi-de...@lists.freedesktop.org'
 PACKAGE_URL=''
 
@@ -1397,7 +1397,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libqmi 1.24.10 to adapt to many kinds of systems.
+\`configure' configures libqmi 1.24.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1467,7 +1467,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libqmi 1.24.10:";;
+     short | recursive ) echo "Configuration of libqmi 1.24.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1614,7 +1614,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libqmi configure 1.24.10
+libqmi configure 1.24.12
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1892,7 +1892,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libqmi $as_me 1.24.10, which was
+It was created by libqmi $as_me 1.24.12, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2760,7 +2760,7 @@
 
 # Define the identity of the package.
  PACKAGE='libqmi'
- VERSION='1.24.10'
+ VERSION='1.24.12'
 
 
 # Some tools Automake needs.
@@ -12230,8 +12230,8 @@
 
 QMI_MAJOR_VERSION=1
 QMI_MINOR_VERSION=24
-QMI_MICRO_VERSION=10
-QMI_VERSION=1.24.10
+QMI_MICRO_VERSION=12
+QMI_VERSION=1.24.12
 
 
 
@@ -13997,7 +13997,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libqmi $as_me 1.24.10, which was
+This file was extended by libqmi $as_me 1.24.12, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -14063,7 +14063,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libqmi config.status 1.24.10
+libqmi config.status 1.24.12
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/configure.ac 
new/libqmi-1.24.12/configure.ac
--- old/libqmi-1.24.10/configure.ac     2020-04-10 14:32:24.000000000 +0200
+++ new/libqmi-1.24.12/configure.ac     2020-05-09 11:03:23.000000000 +0200
@@ -4,7 +4,7 @@
 dnl The QMI version number
 m4_define([qmi_major_version], [1])
 m4_define([qmi_minor_version], [24])
-m4_define([qmi_micro_version], [10])
+m4_define([qmi_micro_version], [12])
 m4_define([qmi_version],
           [qmi_major_version.qmi_minor_version.qmi_micro_version])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/docs/man/qmi-firmware-update.1 
new/libqmi-1.24.12/docs/man/qmi-firmware-update.1
--- old/libqmi-1.24.10/docs/man/qmi-firmware-update.1   2020-04-10 
14:11:39.000000000 +0200
+++ new/libqmi-1.24.12/docs/man/qmi-firmware-update.1   2020-05-09 
11:06:17.000000000 +0200
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.13.
-.TH QMI-FIRMWARE-UPDATE "1" "April 2020" "qmi-firmware-update " "User Commands"
+.TH QMI-FIRMWARE-UPDATE "1" "May 2020" "qmi-firmware-update " "User Commands"
 .SH NAME
 qmi-firmware-update \- Update firmware in QMI devices
 .SH DESCRIPTION
@@ -108,7 +108,7 @@
 .IP
 libqmi\-de...@lists.freedesktop.org
 .PP
-qmi\-firmware\-update 1.24.10
+qmi\-firmware\-update 1.24.12
 .IP
 Copyright (C) 2016\-2019 Bj?rn Mork
 Copyright (C) 2016\-2019 Aleksander Morgado
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/docs/man/qmi-network.1 
new/libqmi-1.24.12/docs/man/qmi-network.1
--- old/libqmi-1.24.10/docs/man/qmi-network.1   2020-04-10 14:11:39.000000000 
+0200
+++ new/libqmi-1.24.12/docs/man/qmi-network.1   2020-05-09 11:06:17.000000000 
+0200
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.13.
-.TH QMI-NETWORK "1" "April 2020" "qmi-network 1.24.10" "User Commands"
+.TH QMI-NETWORK "1" "May 2020" "qmi-network 1.24.12" "User Commands"
 .SH NAME
 qmi-network \- Simple network management of QMI devices
 .SH SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/docs/man/qmicli.1 
new/libqmi-1.24.12/docs/man/qmicli.1
--- old/libqmi-1.24.10/docs/man/qmicli.1        2020-04-10 14:11:39.000000000 
+0200
+++ new/libqmi-1.24.12/docs/man/qmicli.1        2020-05-09 11:06:17.000000000 
+0200
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.13.
-.TH QMICLI "1" "April 2020" "qmicli " "User Commands"
+.TH QMICLI "1" "May 2020" "qmicli " "User Commands"
 .SH NAME
 qmicli \- Control QMI devices
 .SH DESCRIPTION
@@ -588,7 +588,7 @@
 \fB\-V\fR, \fB\-\-version\fR
 Print version
 .PP
-qmicli 1.24.10
+qmicli 1.24.12
 Copyright \(co 2012\-2019 Aleksander Morgado
 License GPLv2+: GNU GPL version 2 or later 
<http://gnu.org/licenses/gpl\-2.0.html>
 This is free software: you are free to change and redistribute it.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libqmi-1.24.10/docs/reference/libqmi-glib/html/index.html 
new/libqmi-1.24.12/docs/reference/libqmi-glib/html/index.html
--- old/libqmi-1.24.10/docs/reference/libqmi-glib/html/index.html       
2020-04-10 14:35:48.000000000 +0200
+++ new/libqmi-1.24.12/docs/reference/libqmi-glib/html/index.html       
2020-05-09 14:20:36.000000000 +0200
@@ -14,7 +14,7 @@
 <div class="titlepage">
 <div>
 <div><table class="navigation" id="top" width="100%" cellpadding="2" 
cellspacing="0"><tr><th valign="middle"><p class="title">libqmi-glib Reference 
Manual</p></th></tr></table></div>
-<div><p class="releaseinfo">for libqmi-glib 1.24.10
+<div><p class="releaseinfo">for libqmi-glib 1.24.12
 </p></div>
 <div><p class="copyright">Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 
2018, 2019 The libqmi-glib authors</p></div>
 <div><div class="legalnotice">
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libqmi-1.24.10/docs/reference/libqmi-glib/html/libqmi-glib-QmiMessage.html 
new/libqmi-1.24.12/docs/reference/libqmi-glib/html/libqmi-glib-QmiMessage.html
--- 
old/libqmi-1.24.10/docs/reference/libqmi-glib/html/libqmi-glib-QmiMessage.html  
    2020-04-10 14:35:48.000000000 +0200
+++ 
new/libqmi-1.24.12/docs/reference/libqmi-glib/html/libqmi-glib-QmiMessage.html  
    2020-05-09 14:20:36.000000000 +0200
@@ -2568,6 +2568,11 @@
 is successfully read, <em class="parameter"><code>offset</code></em>
  will be updated to point past the read item.</p>
 <p>Since 1.24.6 the read string is guaranteed to be valid UTF-8.</p>
+<p>The fixed sized field may be suffixed with e.g. 0xFF if the contents are
+shorter than <em class="parameter"><code>string_length</code></em>
+. Since 1.24.12, this method will return the
+valid UTF-8 characters in the start of the string, instead of returning an
+error when doing the full UTF-8 string validation.</p>
 <div class="refsect3">
 <a 
name="qmi-message-tlv-read-fixed-size-string.parameters"></a><h4>Parameters</h4>
 <div class="informaltable"><table class="informaltable" width="100%" 
border="0">
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libqmi-1.24.10/docs/reference/libqmi-glib/html/libqmi-glib-Version-and-feature-checks.html
 
new/libqmi-1.24.12/docs/reference/libqmi-glib/html/libqmi-glib-Version-and-feature-checks.html
--- 
old/libqmi-1.24.10/docs/reference/libqmi-glib/html/libqmi-glib-Version-and-feature-checks.html
      2020-04-10 14:35:48.000000000 +0200
+++ 
new/libqmi-1.24.12/docs/reference/libqmi-glib/html/libqmi-glib-Version-and-feature-checks.html
      2020-05-09 14:20:36.000000000 +0200
@@ -140,7 +140,7 @@
 <hr>
 <div class="refsect2">
 <a name="QMI-MICRO-VERSION:CAPS"></a><h3>QMI_MICRO_VERSION</h3>
-<pre class="programlisting">#define QMI_MICRO_VERSION (10)
+<pre class="programlisting">#define QMI_MICRO_VERSION (12)
 </pre>
 <p>Evaluates to the micro version number of libqmi-glib which this source
 compiled against.</p>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libqmi-1.24.10/docs/reference/libqmi-glib/version.xml 
new/libqmi-1.24.12/docs/reference/libqmi-glib/version.xml
--- old/libqmi-1.24.10/docs/reference/libqmi-glib/version.xml   2020-04-10 
14:32:36.000000000 +0200
+++ new/libqmi-1.24.12/docs/reference/libqmi-glib/version.xml   2020-05-09 
11:04:31.000000000 +0200
@@ -1 +1 @@
-1.24.10
+1.24.12
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/src/libqmi-glib/qmi-message.c 
new/libqmi-1.24.12/src/libqmi-glib/qmi-message.c
--- old/libqmi-1.24.10/src/libqmi-glib/qmi-message.c    2020-04-10 
13:59:25.000000000 +0200
+++ new/libqmi-1.24.12/src/libqmi-glib/qmi-message.c    2020-05-09 
10:13:36.000000000 +0200
@@ -1355,26 +1355,37 @@
                                         gchar       *out,
                                         GError     **error)
 {
+    const guint8 *ptr;
+    const gchar  *end = NULL;
+
     g_return_val_if_fail (self != NULL, FALSE);
     g_return_val_if_fail (offset != NULL, FALSE);
     g_return_val_if_fail (out != NULL, FALSE);
 
-    if (string_length > 0) {
-        const guint8 *ptr;
-
-        if (!(ptr = tlv_error_if_read_overflow (self, tlv_offset, *offset, 
string_length, error)))
-            return FALSE;
+    if (string_length == 0)
+        return TRUE;
 
-        if (!g_utf8_validate ((const gchar *)ptr, string_length, NULL)) {
-            g_set_error (error, QMI_CORE_ERROR, QMI_CORE_ERROR_INVALID_DATA, 
"invalid string");
-            return FALSE;
-        }
+    if (!(ptr = tlv_error_if_read_overflow (self, tlv_offset, *offset, 
string_length, error)))
+        return FALSE;
 
+    /* full string valid? */
+    if (g_utf8_validate ((const gchar *)ptr, string_length, &end)) {
         memcpy (out, ptr, string_length);
+        *offset = (*offset + string_length);
+        return TRUE;
+    }
+
+    /* partial string valid? */
+    if (end && end > (const gchar *)ptr) {
+        /* copy only the valid bytes */
+        memcpy (out, ptr, end - (const gchar *)ptr);
+        /* but update offset with the full expected length */
+        *offset = (*offset + string_length);
+        return TRUE;
     }
 
-    *offset = (*offset + string_length);
-    return TRUE;
+    g_set_error (error, QMI_CORE_ERROR, QMI_CORE_ERROR_INVALID_DATA, "invalid 
string");
+    return FALSE;
 }
 
 guint16
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/src/libqmi-glib/qmi-message.h 
new/libqmi-1.24.12/src/libqmi-glib/qmi-message.h
--- old/libqmi-1.24.10/src/libqmi-glib/qmi-message.h    2020-04-10 
13:59:25.000000000 +0200
+++ new/libqmi-1.24.12/src/libqmi-glib/qmi-message.h    2020-05-09 
10:13:36.000000000 +0200
@@ -952,6 +952,11 @@
  *
  * Since 1.24.6 the read string is guaranteed to be valid UTF-8.
  *
+ * The fixed sized field may be suffixed with e.g. 0xFF if the contents are
+ * shorter than @string_length. Since 1.24.12, this method will return the
+ * valid UTF-8 characters in the start of the string, instead of returning an
+ * error when doing the full UTF-8 string validation.
+ *
  * Returns: %TRUE if the variable is successfully read, otherwise %FALSE is 
returned and @error is set.
  *
  * Since: 1.12
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/src/libqmi-glib/qmi-proxy.c 
new/libqmi-1.24.12/src/libqmi-glib/qmi-proxy.c
--- old/libqmi-1.24.10/src/libqmi-glib/qmi-proxy.c      2020-04-10 
13:59:25.000000000 +0200
+++ new/libqmi-1.24.12/src/libqmi-glib/qmi-proxy.c      2020-05-09 
10:52:46.000000000 +0200
@@ -306,8 +306,10 @@
         QmiClientInfo *info;
 
         info = &g_array_index (client->qmi_client_info_array, QmiClientInfo, 
i);
+
         /* If service and CID match; or if service and broadcast, forward to
-         * the remote client */
+         * the remote client. This message may therefore be forwarded to 
multiple
+         * clients, all that match the conditions. */
         if ((qmi_message_get_service (message) == info->service) &&
             (qmi_message_get_client_id (message) == info->cid ||
              qmi_message_get_client_id (message) == QMI_CID_BROADCAST)) {
@@ -317,9 +319,6 @@
                 g_warning ("couldn't forward indication to client: %s", 
error->message);
                 g_error_free (error);
             }
-
-            /* Avoid forwarding broadcast messages multiple times */
-            break;
         }
     }
 }
@@ -332,6 +331,20 @@
 }
 
 static void
+register_signal_handlers (Client *client)
+{
+    /* Register for device indications */
+    client->indication_id = g_signal_connect (client->device,
+                                              "indication",
+                                              G_CALLBACK (indication_cb),
+                                              client);
+    client->device_removed_id = g_signal_connect (client->device,
+                                                  "device-removed",
+                                                  G_CALLBACK 
(device_removed_cb),
+                                                  client);
+}
+
+static void
 device_open_ready (QmiDevice *device,
                    GAsyncResult *res,
                    Client *client)
@@ -360,15 +373,7 @@
         self->priv->devices = g_list_append (self->priv->devices, g_object_ref 
(client->device));
     }
 
-    /* Register for device indications */
-    client->indication_id = g_signal_connect (client->device,
-                                              "indication",
-                                              G_CALLBACK (indication_cb),
-                                              client);
-    client->device_removed_id = g_signal_connect (client->device,
-                                                  "device-removed",
-                                                  G_CALLBACK 
(device_removed_cb),
-                                                  client);
+    register_signal_handlers (client);
 
     complete_internal_proxy_open (self, client);
 
@@ -465,7 +470,8 @@
         g_object_unref (file);
         g_free (device_file_path);
         return TRUE;
-    }
+    } else
+        register_signal_handlers (client);
 
     g_free (device_file_path);
 
@@ -679,38 +685,35 @@
 
     self = client->proxy;
 
-    if (condition & G_IO_HUP || condition & G_IO_ERR) {
-        untrack_client (self, client);
-        return FALSE;
-    }
+    if (condition & G_IO_IN || condition & G_IO_PRI) {
+        r = g_input_stream_read (g_io_stream_get_input_stream (G_IO_STREAM 
(client->connection)),
+                                buffer,
+                                BUFFER_SIZE,
+                                NULL,
+                                &error);
+        if (r < 0) {
+            g_warning ("Error reading from istream: %s", error ? 
error->message : "unknown");
+            if (error)
+                g_error_free (error);
+            untrack_client (self, client);
+            return FALSE;
+        }
 
-    if (!(condition & G_IO_IN || condition & G_IO_PRI))
-        return TRUE;
+        if (r > 0) {
+            if (!G_UNLIKELY (client->buffer))
+                client->buffer = g_byte_array_sized_new (r);
+            g_byte_array_append (client->buffer, buffer, r);
 
-    r = g_input_stream_read (g_io_stream_get_input_stream (G_IO_STREAM 
(client->connection)),
-                             buffer,
-                             BUFFER_SIZE,
-                             NULL,
-                             &error);
-    if (r < 0) {
-        g_warning ("Error reading from istream: %s", error ? error->message : 
"unknown");
-        if (error)
-            g_error_free (error);
+            /* Try to parse input messages */
+            parse_request (self, client);
+        }
+    }
+
+    if (condition & G_IO_HUP || condition & G_IO_ERR) {
         untrack_client (self, client);
         return FALSE;
     }
 
-    if (r == 0)
-        return TRUE;
-
-    /* else, r > 0 */
-    if (!G_UNLIKELY (client->buffer))
-        client->buffer = g_byte_array_sized_new (r);
-    g_byte_array_append (client->buffer, buffer, r);
-
-    /* Try to parse input messages */
-    parse_request (self, client);
-
     return TRUE;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/src/libqmi-glib/qmi-utils.c 
new/libqmi-1.24.12/src/libqmi-glib/qmi-utils.c
--- old/libqmi-1.24.10/src/libqmi-glib/qmi-utils.c      2020-04-10 
13:59:25.000000000 +0200
+++ new/libqmi-1.24.12/src/libqmi-glib/qmi-utils.c      2020-05-09 
10:13:36.000000000 +0200
@@ -141,6 +141,12 @@
     for (p = init; (gsize)(p - init) < utf8_len; p = g_utf8_next_char (p)) {
         gunichar unichar;
 
+        /* Explicitly allow CR and LF even if they're control characters, given
+         * that NMEA traces reported via QMI LOC indications seem to have these
+         * suffixed. */
+        if (*p == '\r' || *p == '\n')
+            continue;
+
         unichar = g_utf8_get_char (p);
         if (!g_unichar_isprint (unichar))
             return FALSE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/src/libqmi-glib/qmi-version.h 
new/libqmi-1.24.12/src/libqmi-glib/qmi-version.h
--- old/libqmi-1.24.10/src/libqmi-glib/qmi-version.h    2020-04-10 
14:32:36.000000000 +0200
+++ new/libqmi-1.24.12/src/libqmi-glib/qmi-version.h    2020-05-09 
11:04:31.000000000 +0200
@@ -57,7 +57,7 @@
  *
  * Since: 1.6
  */
-#define QMI_MICRO_VERSION (10)
+#define QMI_MICRO_VERSION (12)
 
 /**
  * QMI_CHECK_VERSION:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/src/libqmi-glib/test/test-generated.c 
new/libqmi-1.24.12/src/libqmi-glib/test/test-generated.c
--- old/libqmi-1.24.10/src/libqmi-glib/test/test-generated.c    2020-03-21 
15:25:02.000000000 +0100
+++ new/libqmi-1.24.12/src/libqmi-glib/test/test-generated.c    2020-05-09 
10:13:36.000000000 +0200
@@ -731,6 +731,161 @@
 }
 
 /*****************************************************************************/
+/* NAS Get System Info */
+
+static void
+nas_get_system_info_ready (QmiClientNas *client,
+                           GAsyncResult *res,
+                           TestFixture  *fixture)
+{
+    QmiMessageNasGetSystemInfoOutput *output;
+    GError *error = NULL;
+    gboolean st;
+
+    output = qmi_client_nas_get_system_info_finish (client, res, &error);
+    g_assert_no_error (error);
+    g_assert (output);
+
+    st = qmi_message_nas_get_system_info_output_get_result (output, &error);
+    g_assert_no_error (error);
+    g_assert (st);
+
+    {
+        gboolean                    domain_valid = FALSE;
+        QmiNasNetworkServiceDomain  domain;
+        gboolean                    service_capability_valid = FALSE;
+        QmiNasNetworkServiceDomain  service_capability;
+        gboolean                    roaming_status_valid = FALSE;
+        QmiNasRoamingStatus         roaming_status;
+        gboolean                    forbidden_valid = FALSE;
+        gboolean                    forbidden;
+        gboolean                    lac_valid = FALSE;
+        guint16                     lac;
+        gboolean                    cid_valid = FALSE;
+        guint32                     cid;
+        gboolean                    registration_reject_info_valid = FALSE;
+        QmiNasNetworkServiceDomain  registration_reject_domain;
+        guint8                      registration_reject_cause;
+        gboolean                    network_id_valid = FALSE;
+        const gchar                *mcc = NULL;
+        const gchar                *mnc = NULL;
+        gboolean                    tac_valid = FALSE;
+        guint16                     tac;
+
+        /*
+         *     LTE service:
+         *             Status: 'available'
+         *             True Status: 'available'
+         *             Preferred data path: 'no'
+         *             Domain: 'cs-ps'
+         *             Service capability: 'cs-ps'
+         *             Roaming status: 'off'
+         *             Forbidden: 'no'
+         *             Cell ID: '1609474'
+         *             MCC: '530'
+         *             MNC: '24'                -- Given as 2 digits, suffixed 
with 0xFF!
+         *             Tracking Area Code: '63001'
+         *             Voice support: 'yes'
+         *             IMS voice support: 'no'
+         *             eMBMS coverage info support: 'no'
+         *             eMBMS coverage info trace ID: '65535'
+         *             Cell access: 'all-calls'
+         *             Registration restriction: 'unrestricted'
+         *             Registration domain: 'not-applicable'
+         */
+
+        g_assert (qmi_message_nas_get_system_info_output_get_lte_system_info 
(output,
+                                                                              
&domain_valid,
+                                                                              
&domain,
+                                                                              
&service_capability_valid,
+                                                                              
&service_capability,
+                                                                              
&roaming_status_valid,
+                                                                              
&roaming_status,
+                                                                              
&forbidden_valid,
+                                                                              
&forbidden,
+                                                                              
&lac_valid,
+                                                                              
&lac,
+                                                                              
&cid_valid,
+                                                                              
&cid,
+                                                                              
&registration_reject_info_valid,
+                                                                              
&registration_reject_domain,
+                                                                              
&registration_reject_cause,
+                                                                              
&network_id_valid,
+                                                                              
&mcc,
+                                                                              
&mnc,
+                                                                              
&tac_valid,
+                                                                              
&tac,
+                                                                              
&error));
+        g_assert_no_error (error);
+        g_assert (domain_valid);
+        g_assert_cmpuint (domain, ==, QMI_NAS_NETWORK_SERVICE_DOMAIN_CS_PS);
+        g_assert (service_capability_valid);
+        g_assert_cmpuint (service_capability, ==, 
QMI_NAS_NETWORK_SERVICE_DOMAIN_CS_PS);
+        g_assert (roaming_status_valid);
+        g_assert_cmpuint (roaming_status, ==, QMI_NAS_ROAMING_STATUS_OFF);
+        g_assert (forbidden_valid);
+        g_assert (!forbidden);
+        g_assert (!lac_valid);
+        g_assert (cid_valid);
+        g_assert_cmpuint (cid, ==, 1616133);
+        g_assert (!registration_reject_info_valid);
+        g_assert (network_id_valid);
+        g_assert_cmpstr (mcc, ==, "530");
+        g_assert_cmpstr (mnc, ==, "24");
+        g_assert (tac_valid);
+        g_assert_cmpuint (tac, ==, 63001);
+    }
+
+    qmi_message_nas_get_system_info_output_unref (output);
+
+    test_fixture_loop_stop (fixture);
+}
+
+static void
+test_generated_nas_get_system_info (TestFixture *fixture)
+{
+    guint8 expected[] = {
+        0x01,
+        0x0C, 0x00, 0x00, 0x03, 0x01,
+        0x00, 0x01, 0x00, 0x4D, 0x00, 0x00, 0x00
+    };
+    guint8 response[] = {
+        0x01,
+        0x9A, 0x00, 0x80, 0x03, 0x01,
+        0x02, 0x01, 0x00, 0x4D, 0x00, 0x8E, 0x00, 0x02,
+        0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x03,
+        0x00, 0x00, 0x00, 0x00, 0x13, 0x03, 0x00, 0x00,
+        0x00, 0x00, 0x14, 0x03, 0x00, 0x02, 0x02, 0x00,
+        0x19, 0x1D, 0x00, 0x01, 0x03, 0x01, 0x03, 0x01,
+        0x00, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0x01, 0x05,
+        0xA9, 0x18, 0x00, 0x00, 0x00, 0x00, 0x01, 0x35,
+        0x33, 0x30, 0x32, 0x34, 0xFF, 0x01, 0x19, 0xF6,
+        0x1E, 0x02, 0x00, 0xFF, 0xFF, 0x21, 0x01, 0x00,
+        0x01, 0x26, 0x01, 0x00, 0x00, 0x27, 0x04, 0x00,
+        0x01, 0x00, 0x00, 0x00, 0x29, 0x01, 0x00, 0x00,
+        0x2A, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2F,
+        0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x04,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00,
+        0xFF, 0xFF, 0x38, 0x04, 0x00, 0x03, 0x00, 0x00,
+        0x00, 0x39, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00,
+        0x3E, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44,
+        0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x04,
+        0x00, 0x04, 0x00, 0x00, 0x00
+    };
+
+    test_port_context_set_command (fixture->ctx,
+                                   expected, G_N_ELEMENTS (expected),
+                                   response, G_N_ELEMENTS (response),
+                                   
fixture->service_info[QMI_SERVICE_NAS].transaction_id++);
+
+    qmi_client_nas_get_system_info (QMI_CLIENT_NAS 
(fixture->service_info[QMI_SERVICE_NAS].client), NULL, 3, NULL,
+                                    (GAsyncReadyCallback) 
nas_get_system_info_ready,
+                                    fixture);
+
+    test_fixture_loop_run (fixture);
+}
+
+/*****************************************************************************/
 
 static void
 nas_get_cell_location_info_invalid_response_ready (QmiClientNas *client,
@@ -800,6 +955,7 @@
     TEST_ADD ("/libqmi-glib/generated/nas/network-scan",           
test_generated_nas_network_scan);
     TEST_ADD ("/libqmi-glib/generated/nas/get-cell-location-info", 
test_generated_nas_get_cell_location_info);
     TEST_ADD ("/libqmi-glib/generated/nas/get-serving-system",     
test_generated_nas_get_serving_system);
+    TEST_ADD ("/libqmi-glib/generated/nas/get-system-info",        
test_generated_nas_get_system_info);
 
     /* Invalid responses */
     TEST_ADD ("/libqmi-glib/generated/nas/invalid/get-cell-location-info", 
test_generated_nas_get_cell_location_info_invalid_response);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/src/libqmi-glib/test/test-message.c 
new/libqmi-1.24.12/src/libqmi-glib/test/test-message.c
--- old/libqmi-1.24.10/src/libqmi-glib/test/test-message.c      2020-04-10 
13:54:45.000000000 +0200
+++ new/libqmi-1.24.12/src/libqmi-glib/test/test-message.c      2020-05-09 
10:13:36.000000000 +0200
@@ -175,8 +175,9 @@
 }
 
 static void
-test_message_overflow_common (const guint8 *buffer,
-                              guint buffer_len)
+test_message_printable_common (const guint8 *buffer,
+                               guint         buffer_len,
+                               const gchar  *expected_in_printable)
 {
     QmiMessage *message;
     GByteArray *array;
@@ -190,8 +191,10 @@
     g_assert (message);
 
     printable = qmi_message_get_printable_full (message, NULL, "");
+#ifdef TEST_PRINT_MESSAGE
     g_print ("\n%s\n", printable);
-    g_assert (strstr (printable, "ERROR: Reading TLV would overflow"));
+#endif
+    g_assert (strstr (printable, expected_in_printable));
     g_free (printable);
 
     g_byte_array_unref (array);
@@ -211,7 +214,7 @@
         0x06, 0x00, 0x01, 0x01, 0x01, 0x02, 0x01, 0x05
     };
 
-    test_message_overflow_common (buffer, G_N_ELEMENTS (buffer));
+    test_message_printable_common (buffer, G_N_ELEMENTS (buffer), "ERROR: 
Reading TLV would overflow");
 }
 
 static void
@@ -234,7 +237,24 @@
         0x01
     };
 
-    test_message_overflow_common (buffer, G_N_ELEMENTS (buffer));
+    test_message_printable_common (buffer, G_N_ELEMENTS (buffer), "ERROR: 
Reading TLV would overflow");
+}
+
+static void
+test_message_parse_string_with_crlf (void)
+{
+    /* LOC indication: NMEA
+     * The NMEA trace comes suffixed with \r\n, this test makes sure the proper
+     * parsing is done on the string.
+     */
+    const guint8 buffer[] = {
+        0x01, 0x2D, 0x00, 0x80, 0x10, 0x01, 0x04, 0xB4, 0x00, 0x26, 0x00, 0x21,
+        0x00, 0x01, 0x1E, 0x00, 0x24, 0x47, 0x50, 0x47, 0x53, 0x41, 0x2C, 0x41,
+        0x2C, 0x31, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C,
+        0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2A, 0x31, 0x45, 0x0D, 0x0A
+    };
+
+    test_message_printable_common (buffer, sizeof (buffer), 
"$GPGSA,A,1,,,,,,,,,,,,,,,*1E");
 }
 
 /*****************************************************************************/
@@ -1566,6 +1586,7 @@
     g_test_add_func ("/libqmi-glib/message/parse/complete-and-complete", 
test_message_parse_complete_and_complete);
     g_test_add_func ("/libqmi-glib/message/parse/wrong-tlv",             
test_message_parse_wrong_tlv);
     g_test_add_func ("/libqmi-glib/message/parse/missing-size",          
test_message_parse_missing_size);
+    g_test_add_func ("/libqmi-glib/message/parse/string-with-crlf",      
test_message_parse_string_with_crlf);
 
     g_test_add_func ("/libqmi-glib/message/new/request",           
test_message_new_request);
     g_test_add_func ("/libqmi-glib/message/new/request-from-data", 
test_message_new_request_from_data);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libqmi-1.24.10/src/qmicli/qmicli-loc.c 
new/libqmi-1.24.12/src/qmicli/qmicli-loc.c
--- old/libqmi-1.24.10/src/qmicli/qmicli-loc.c  2020-04-10 13:59:25.000000000 
+0200
+++ new/libqmi-1.24.12/src/qmicli/qmicli-loc.c  2020-05-09 10:18:59.000000000 
+0200
@@ -216,6 +216,9 @@
     if (context->nmea_indication_id)
         g_signal_handler_disconnect (context->client, 
context->nmea_indication_id);
 
+    if (context->delete_assistance_data_indication_id)
+        g_signal_handler_disconnect (context->client, 
context->delete_assistance_data_indication_id);
+
     g_clear_object (&context->cancellable);
     g_clear_object (&context->client);
     g_clear_object (&context->device);
@@ -485,9 +488,12 @@
         else
             g_print ("   time source: n/a\n");
 
-        if (qmi_indication_loc_position_report_output_get_sensor_data_usage 
(output, &sensor_data_usage, NULL))
-            g_print ("   sensor data usage: %s\n", 
qmi_loc_reliability_get_string (sensor_data_usage));
-        else
+        if (qmi_indication_loc_position_report_output_get_sensor_data_usage 
(output, &sensor_data_usage, NULL)) {
+            g_autofree gchar *sensor_data_usage_str = NULL;
+
+            sensor_data_usage_str = 
qmi_loc_sensor_data_usage_build_string_from_mask (sensor_data_usage);
+            g_print ("   sensor data usage: %s\n", sensor_data_usage_str);
+        } else
             g_print ("   sensor data usage: n/a\n");
 
         if (qmi_indication_loc_position_report_output_get_session_fix_count 
(output, &aux32, NULL))
@@ -685,13 +691,13 @@
     GError                 *error = NULL;
 
     if 
(!qmi_indication_loc_delete_assistance_data_output_get_indication_status 
(output, &status, &error)) {
-        g_printerr ("Couldn't delete assistance data: %s\n", error->message);
+        g_printerr ("error: couldn't delete assistance data: %s\n", 
error->message);
         g_error_free (error);
         operation_shutdown (FALSE);
         return;
     }
 
-    g_printerr ("Successfully deleted assistance data\n");
+    g_print ("Successfully deleted assistance data\n");
     operation_shutdown (TRUE);
 }
 


Reply via email to