Just remove the last element with NULL strings in the array of errors, as we're
safe using G_N_ELEMENTS() to iterate it.
Reported by Jose Maria Gonzalez Calabozo <jmgonzalezc@indra.es>
QMI modems without SIM may report 'UimUninitialized' QMI protocol errors, so
catch those and use them as 'SIM failure' so that they get reported to the user.
This patch changes MMIfaceModem3gpp to differentiate between deferrable
and non-deferrable 3GPP registration state updates. Periodic or
unsolicited registration state updates are deferrable, while internal
updates, e.g. due to modem being disabled, are non-deferrable.
Don't clear the current deferred registration update until having disabled
and cleaned up unsolicited registrations state messages, or we may end up
re-setting the deferred registration update again meanwhile
Allow mm_iface_modem_update_state() receive 'MM_MODEM_STATE_FAILED', and treat
it as any other change to failed state, but with
'MM_MODEM_STATE_FAILED_REASON_UNKNOWN'.
This patch defers the update of 3GPP registration state by 15 seconds
when the registration state changes from 'registered' (home / roaming)
to 'searching'. This allows a temporary loss of 3GPP registration to
recover itself when relying on ModemManager to explicitly disconnect and
reconnect to the network.
When reading the string reply in a +CUSD indication, don't blindly split
using whitespace or comma as field separator, as the string may be a text string
with both whitespaces and commas, e.g.:
+CUSD: 0,"hey hey, something here<LF>***<LF>and something more here"
Also, skip reading the encoding field for now, as we don't use it yet.
MBM devices seem to include the '+CUSD: 0' indication before even returning OK to our '+CUSD=1'
(ttyACM0): --> 'AT+CUSD=1,"*111#",15<CR>'
(ttyACM0): <-- '<CR><LF>+CUSD: 0,"reply here"<CR><LF>'
(ttyACM0): <-- '<CR><LF>OK<CR><LF>'
Treat each port independently in its own idle, as if we're receiving independent
udev events, otherwise, GSources may not be properly scheduled in the main loop.
A new reference to probe was acquired through mm_device_get_probe(), just unref it
when no longer needed. Note that mm_port_probe_run() will take its own reference
for as long as required to complete the operation.
We will now by default wait some time (1s) between port getting fully closed and
the port being reopened again. This logic seems to work for multiple modems
where there is a single port for both AT and data, like my Nokia C7 and Iridium
modems. If this wait time is not applied, the port ends up returning EAGAIN for
every write that we try to do afterwards.
Patch "iface-modem: fix invalid modem state consolidation" (commit
69aff6183a) incorrectly consolidates the
modem state upon the disconnection of a bearer. The modem state remains
'connected' after the last bearer is disconnected. This patch fixes
that.
For the case where we just get a device with all net ports (i.e. all deferred
until result suggested), just abort the probing if the minimum probing time is
consumed.
This may happen when sending commands to the modem while in non-enabled state,
like when sending the PIN. In this case, just send the command, don't fully
initialize the port with the initialization sequence.
We were maintaining the port we used for dialling (the data port) open during
the connection, as specified by the CDMA or 3GPP specific logic. We'll now close
that open count reference ourselves within the CDMA or 3GPP disconnection logic
itself.
Instead of deciding in advance which data port to use, we let the dialling
operation gather it. For the generic dialling logic, ATD-based, always an
'AT' port will be used as data port, even if we grabbed a 'net' port. Those
plugins that can work with 'net' ports will grab the specific 'net' port
themselves.
Instead of returning 3 variables in connect_finish(), return a single reference
counted struct. This simplifies how the result is built and passed within a
GSimpleAsyncResult to each _finish() method.
This also simplifies the dialling step in the 3GPP connection sequence, as we
can use the same new type.