Question about resetting ModemManager SIM data.

Troels Olesen to at movis.dk
Wed Jan 6 08:59:18 PST 2016


The SIM switcher is controlled by a GPIO pin, and it does not
give the modem a indication that the sim has been switched.

The modem is a Sierra MC7710 set to use ATmodem commands,
its configured to disable the SIM card connection when entering 
low-power mode.

An example of how i switch the sim:

mm_modem_set_power_state_sync(modem, MM_MODEM_POWER_STATE_LOW, NULL, 
&error);
sleep(3);
int fd = open("/sys/class/gpio/gpio9/value", O_WRONLY);
write(fd, card, 1);
close(fd);
sleep(3);
mm_modem_set_power_state_sync(modem, MM_MODEM_POWER_STATE_ON, NULL, &error);

(example is simplified)

So what i am missing is a some functionality to tell ModemManager that 
the SIM has been switched,
and thereby reinitializing the the MMBaseSim object.

Kind Regards,
Troels Olesen

Den 06-01-2016 kl. 16:53 skrev Dan Williams:
> On Wed, 2016-01-06 at 15:03 +0100, Troels Olesen wrote:
>> Hi ModemManager developers.
>>
>> My situation is this. I have a Sierra MC7710 Modem,
>> that is connected to a external SIM card switcher.
>>
>> I can switch the SIM card when the modem is in low-power state.
>> But when i return the modem to high-power state after the switch,
>> the SIM data stored by ModemManager is not changed.
>>
>> Is there some way i can force an reinitialization of the SIM card
>> data?
> Does the modem give any unsolicited indication of the SIM switch?  Can
> you run MM with --debug and see what QMI notifications, if any, are
> emitted while in the low-power state when you switch the SIM?  If we
> can get an indication of the switch, then we could trigger a re-init of
> the SIM information.
>
> It's also possible that we haven't enabled the right QMI notifications,
> so you might get nothing, but that doesn't meant the modem couldn't
> send something if we toggled the right message.
>
> Dan
>
>> I have looked at the ModemManager code, and found,
>> that a modified version of the function "mm_iface_modem_initialize"
>> in
>> "mm-iface-modem.c",
>> might be able to reset the SIM object data, and force a
>> reinitialization.
>>
>> But figuring out how to do this has eluded me.
>> Maybe from the function "modem_after_power_up_ready".
>>
>> I would appreciate your input, about what you would consider best
>> practice.
>> And if there already exists a way to force a reinitialization of the
>> stored SIM data.
>> And more important without rebooting the modem hardware.
>>
>> Thanks in advance for any help you can give me.
>>
>> Kind Regards,
>> Troels Olesen
>> _______________________________________________
>> ModemManager-devel mailing list
>> ModemManager-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel



More information about the ModemManager-devel mailing list