Toggling +CFUN=0/1 upon receiving an unsolicited message

Dan Williams dcbw at redhat.com
Wed Sep 18 21:24:04 PDT 2013


On Tue, 2013-09-17 at 08:52 +0200, Aleksander Morgado wrote:
> On 17/09/13 08:26, Ben Chan wrote:
> > 
> > We're looking into a way to toggle the CFUN state (from 1 to 0, and then
> > back to 1) upon receiving an unsolicited message after the modem is
> > enabled. An example use case would be SIM OTA.
> > 
> > Do you see any potential issue with the following implementation in a
> > modem plugin:
> > 
> > - When the modem is being enabled, set up an unsolicited message handler.
> > - When the unsolicited message handler is called after the modem is
> > enabled, perform the following:
> > 
> >     mm_base_modem_disable ()
> >     mm_base_base_modem_at_sequence ( [ "+CFUN=0", "+CFUN=1" ] )
> >     mm_base_modem_enable ()
> 
> The +CFUN=1 shouldn't be required if it is already part of power_up();
> i.e. enable() already implicitly does power_up(). And +CFUN=0 should
> likely be part of power_down() already as well, so the sequence could
> just be:
>  disable()
>  power_down()
>  enable()
> 
> Regarding the actual issue, if this is a plugin-specific thing and it is
> required by the plugin to perform an operation, it shouldn't be a big
> issue. Firmware changes and CDMA activation actually perform a whole
> power cycle of the modem, not just disable/enable, but of course this
> are user requested. Just make sure you remove/disable the unsolicited
> message handler when you no longer need it.
> 
> Dan, what's your take on it?

I don't see any issues with this, though does the use-cases you're
thinking about touch stuff on the modem, or only the SIM?  If it's only
the SIM, can we do CFUN=4 instead to avoid a complete power cycle of the
modem?  Or is CFUN=0 really required?  The problem with '0' is that it's
interpreted wildly differently on devices and may actually be a complete
reboot of the device.  With CDMA that's expected since it might update
NV items, PRL, ERI, etc, but that shouldn't be the case if the SIM OTA
is just updating SIM stuff.

Dan



More information about the ModemManager-devel mailing list