The Huawei plugin uses +CFUN=0 to put the modem in low power mode as
+CFUN=4 isn't supported by all Huawei modems. This patch modifies the
plugin to treat CFUN 0 as the 'LOW' power state, which is necessary as
otherwise ModemManager would prevent the modem from transitioning to the
'ON' power state.
AT+COPS=0 in a FXT009 may end up making the device stuck in a weird state
in which it only replies "+CME ERROR: 515" to every AT command. So try to
avoid this command whenever possible.
When automatic mode (i.e. 2G+3G+none preferred) is selected, we need to
explicitly request it by giving the AT+COPS write command with values (i.e. not
just empty fields).
Powering off Wavecom devices is done via the AT^CPOF=1 command. These devices
seem to not only power-off, but also power-cycle when this command is received,
which means that the user needs to make sure to fully cut the power to the
device when the SetPowerState() method replies.
Powering off Cinterion modems is done with the AT^SMSO command. Once this
command is sent to the device, ModemManager still needs to wait to get an
unsolicited ^SHUTDOWN message from the modem, which is when the shutdown
is considered complete.
Newer Cinterion devices, though, don't seem to follow this rule and just
reply OK to AT^SMSO (i.e. no ^SHUTDOWN), but instead, they will remove the
tty ports.
This patch simply fixes the following debug message:
from:
<debug> (Huawei) couldn't turn off unsolicited messages insecondary ports: 'Unknown error'
to:
<debug> (Huawei) couldn't turn off unsolicited messages in secondary ports: 'Unknown error'
This patch fixes the out-of-bounds array accesses in test-port-context.c,
which is detected by AddressSanitizer, by checking the index against the
array length before accessing the array.
This patches fixes the following error when testing ModemManager with
glib < 2.36, which still requires g_type_init() to be called:
TEST: test-service-generic... (pid=20166)
/MM/Service/Generic:
(/work/ModemManager/plugins/.libs/lt-test-service-generic:20166): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()
FAIL
Adds support for the Huawei E3276 by sending the shortened form of the
AT^NDISDUP command where possible, as the E3276 fails with an '+CME ERROR:
Incorrect parameters' if encoded_auth is set to 0. This behaviour is slightly
different to the E1820 and K4605 (E372) which will happily establish a
connection with encoded_auth set to 0, 1 or 2.
The QCDM port commands are never cached, so remove the option from the command()
method. Will also simplify command caching afterwards as it will be an AT-only
thing.
The new PHS8 or PXS8 devices may expose multiple tty ports, but only one is
supposed to be used for PPP. So, query which port that is and flag it before
grabbing it in the modem.