Update SIM related data according to an event
Carlo Lobrano
c.lobrano at gmail.com
Tue Mar 22 14:25:32 UTC 2016
Hi Aleksander,
I had some time now to look at the changes for SIM hot insertion feature
(QSS unsolicited in Telit modems), lot of doubts actually.
My idea is the following:
1. in modem iface initialization, ask the modem whether it supports or not
SIM hot insertion (TBD: sync method? property?).
2. according to point 1, if initialization fails for
MM_MOBILE_EQUIPMENT_ERROR_SIM_NOT_INSERTED, allow the modem enable command
(I am not sure about this actually, see my note below).
3. In telit plugin, register an handler for QSS unsolicited (3gpp iface)
a. when sim is removed
- disable modem (mm_modem_disable) keeping the QSS handler (and the
port open)
- set modem in locked state (mm_iface_modem_update_state)
b. when sim is inserted
- start re-probe (mm_base_modem_set_valid(..., false))
There are still some open points, here are the most important IMO
A. The modem really needs to be enabled to get the the unsolicited?
B. How to keep the port open.
Point A
=======
I added a QSS handler in the plugin along with the other unsolicited in
`modem_3gpp_setup/enable_unsolicited_events` functions, but this way I can
register an handler only when modem is enabled, which is not something I
would allow when SIM is not inserted. I also tried to move the handler
registration logic inside a new modem-iface's function (namely, not in 3gpp
iface), but did't work.
Am I missing something, or enabling the modem is really needed to listen to
modem's unsolicited?
Point B
=======
I thought to solve this point adding a parameter "keep_open" to
MMPortSerialPrivate along with a new function to set it to TRUE, in order
to keep the port open when open_count==1, but it does not seems to be
effective (the main issue now is a crash, that I am still debugging, when
SIM is removed and then re-inserted, like if the port status is invalid,
"partially" close). Do you think is a viable solution?
Best regards,
Carlo
On 13 March 2016 at 12:46, Carlo Lobrano <c.lobrano at gmail.com> wrote:
> Thanks a lot! I'll have a look at that
>
> Carlo
>
> Il dom 13 mar 2016 11:57 AM Aleksander Morgado <aleksander at aleksander.es>
> ha scritto:
>
>> On Sun, Mar 13, 2016 at 10:25 AM, Carlo Lobrano <c.lobrano at gmail.com>
>> wrote:
>> > That looks like a lot of work :D, better design all the changes before
>> > starting.
>>
>> Well, maybe not much work, but probably a bit hard to get the logic right.
>>
>> > Brief recap
>> > 1. Put the modem in failed state
>>
>> You may want to check what happens if you run
>> mm_base_modem_set_valid(FALSE) whenever the SIM is lost. That method
>> should flag the modem as invalid and reprobe from scratch, and that
>> will itself end up going into failed state.
>>
>> > 2. Keep a port open when in failed state but with handlers still
>> assigned to
>> > unsolicited
>>
>> Only with the handler that you expect; not with all unsolicited
>> message handlers.
>>
>> > 3. start a full reprobe
>> >
>> > Another problem I saw is that when the SIM is not inserted from the
>> start,
>> > the modem is not initialized at all, so I cannot even set an handler to
>> > watch for unsolicited events. Do you think that is something that can be
>> > changed?
>>
>> That is equivalent to your step #2 above. When a modem starts without
>> SIM, it goes to Failed state right away. In your case, your Failed
>> state will be special, so that it really ends up keeping a port open
>> to monitor for the unsolicited messages you need.
>>
>> --
>> Aleksander
>> https://aleksander.es
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20160322/2377fe67/attachment.html>
More information about the ModemManager-devel
mailing list