Found by jklimes. If some plugin already supports this port, it's
pointless to let Generic figure out if it supports the port since
we're just going to hand it to the other plugin anyway.
Some devices (Blackberries) always respond to AT+CREG with ERROR,
but will respond to AT+CGREG normally. Ugh. Handle that by
using the PS registration status from AT+CGREG if we don't have
a valid CS registration status at all.
The flash function could be called when the port was closed, and since
the flash function would only be canceled when the port was open,
it could trigger after the port object was destroyed.
Distributions should set dist-version at build time with the
package version and revision, so for RPM-based distros you'd
--with-dist-version=%{version}-%{release}
which will be printed out on MM startup to help debugging.
There were a few problems:
1) If SysMode is present, the registration state it reports should
be authoritative, but if there was a valid SID the plugin would
report 'registered' even if SysMode was NO SRV
2) Turns out that some devices report the roaming values as ERIs,
not plain yes/no as we thought; reported ERI was being mis-parsed
as a boolean value.
Since MMModem is an interface and doesn't store stuff like the
modem's physdev internally (since it's an interface) these things
are handled via GObject properties. And since g_object_get()
returns allocated values, we need to free the returned value
from mm_modem_get_device() after we're done with it.
There are some cases where flashing the primary port doesn't work
either due to stupid modem firmware or crappy kernel drivers. So
if we have a secondary port, try sending the PDP deactivation
command to the secondary port first, and if that fails send it
to the primary port after the primary port gets flashed. This
increases the chances that the +CGACT request will be successful.
Some modems (Huawei, ZTE) don't like +CGACT on the secondary port,
but when that fails, the code falls back to previous behavior of
flashing and sending CGACT to the primary port.