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

Aleksander Morgado aleksander at lanedo.com
Mon Sep 16 23:52:31 PDT 2013


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?

-- 
Aleksander


More information about the ModemManager-devel mailing list