[PATCH 1/3] altair-lte: reference the secondary port in DetailedConnectContext

Aleksander Morgado aleksander at aleksander.es
Mon Jan 6 08:09:09 PST 2014


On 03/01/14 18:07, Ben Chan wrote:
>>> ---
>>> > >  plugins/altair/mm-broadband-bearer-altair-lte.c | 6 ++++++
>>> > >  1 file changed, 6 insertions(+)
>>> > >
>> >
>> > What's the purpose of keeping a reference to the secondary port around
>> > if it is not going to be used during the connection sequence?
>> >
>> >
> IIUC, the connection sequence uses mm_base_modem_at_command, which could
> potentially pick up the secondary port, if one exists. The existing code
> works but this patch makes the code more future-proof (and more symmetric
> to the disconnection sequence, which also references the secondary port).
> Alternatively, we could explicitly use the primary port, or add g_assert
> (secondary == NULL) if the modem never has a secondary port.
> 

The disconnection sequence also references the secondary port; but it
shouldn't do it as it's not using it for anything.

The 3GPP connection sequence receives the primary port always, plus a
secondary port if available, and the sequence logic is responsible for
making sure that the ports that are going to be used during the sequence
are available (i.e. a reference to them exist).

In the case of the Altair-LTE plugin (actually, in every plugin in which
use AT commands and a net iface), the best thing to do is to explicitly
use the primary port as you suggest, i.e. use the _full() version of the
command where we can specify the port to use when running the connection
request. Don't g_assert (secondary == NULL), as that doesn't really
gives us anything.

-- 
Aleksander


More information about the ModemManager-devel mailing list