Bearers will ask for data ports that can be used for connections. Right now,
only one data port is expected to be handled, but we don't impose any
restriction in the API.
If the SIM is not inserted or the modem reports SIM failures, just abort the
initialization process. We don't want to export modems which cannot be used.
I know at least of one modem (wavecom) which supports SIM insertion while
connected, but being such a corner case, probably not worth supporting it.
Bearer list operations, except for Bearer creation, are so generic that the
interface itself can implement it for every object implementing the interface.
This implementation is based on a new MMBearerList object.
Some operations are clearly asynchronous (e.g. monitoring modem state), while
others are clearly synchronous (e.g. printing modem info). So just allow option
groups to force the operation to be async or sync based on the detected action.
Avoid trying to merge all interfaces into the same set of APIs, and keep having
a specific object (proxy) for each interface handled by the GDBusObjects
reported listed by the GDBusObjectManager.
Usually, if not always, the connection stored in the SIM object never exists
when disposing it, as we clear the connection property in the Modem object
before destroying it, and both properties are bound. But just in case, in order
to avoid ending up with a zombie object in DBus, we make sure we unexport it.
Make a tight connection between the action of sending AT commands, either single
or in a sequence, with the MMBaseModem object owning the port. This direct
relation allows sending commands without specifying which port to use, so that
the modem object can get the best port at each time, and handling all that in a
single common place.
The original mm-at API has also been modified so that when a single command is
sent, a constant string is returned. We are allowed to return constant strings
in mm_base_modem_at_command_finish() because the string itself is owned by the
GSimpleAsyncResult, and hence, alive enough time. The GSimpleAsyncResult is
completely disposed only after the async call is fully completed.
Same reasoning behind the GVariant returned in the AT sequences; it should not
be owned by the caller, it's a transfer-none in introspection terms.