The mm_device_create_modem() was updated so that it would not run the
modem initialization implicitly. Due to this change, we must ensure
the modem initialization is run after a modem inhibition operation
after we recreate the modem object.
Fixes: 04d826f563
The mm_device_create_modem() was updated so that it would not run the
modem initialization implicitly. Due to this change, we must ensure
the modem initialization is run after a modem reprobe operation,
e.g. when switching SIM slots.
The logic to run the modem initialization is moved to MMDevice for
simplicity and clarity.
Fixes: 04d826f563
The whole codebase is updated to assume the MMBaseModem AT operations
require an object implementing the MMIfacePortAt interface, instead of
a MMPortSerialAt object.
In the places where we know the port is a MMPortSerialAt, e.g. when we
query explicitly for the primary or secondary serial AT port, we will
use an explicit MM_IFACE_PORT_AT() cast when calling the AT command
method.
In the places where we get_best_at_port() we're going to assume that
we don't know the port type. This method will be updated in a follow
up commit to support the MMIfacePortAt interface as well.
No functional changes should happen.
The purpose of this change is to align coding style with the rest of
the project and also simplify the implementation of the different AT
command handling methods, e.g. to avoid needing so many internal
helper methods.
The new modem_initialize() method is run for both real devices (after
the modem setup phase) and also for virtual devices in unit
tests (where no modem setup phase exists).
There are cases where the user wants to configure some actions
to be run on a modem before ModemManager takes over full control.
The new "modem setup" dispatcher scripts allow running operations
in the modem after the port probing has happened and we know which
ports are usable in the device.
The scripts may e.g. change device configuration, enable modem
logging infrastructure, or any other process that would otherwise
conflict with MM's own modem management operations.
This uses the proprietary `^NDISSTATQRY` instead of the default
`+CGDCONT` command, as the latter might return diffrent results
(i.e. reporting v6 support, that can't be used via NDIS).
Also add a fallback to `+CGDCONT?` for older modems that don't
support ^NDISSTATQRY.
Refactor the loading/setting of supported/current modes/bands,
mostly to enable LTE support via ^SYSCFGEX.
This unfortunately requires many changes at once, as these methods
use the same AT commands and their fallbacks.
When sending or storing an SMS, the per-part operation is itself split
into two steps: first we send the AT command specifying the index, and
then we send the actual PDU data with a raw command. We must ensure
that the raw command is sent exactly in the same port as the AT
command.