On Mon, Mar 14, 2016 at 5:01 PM, Carlo Lobrano <c lobrano gmail com> wrote:
>> I'm not entirely sure what you mean with "power off" and "shut down the
>> radio", but here are the definitions I'm using:
>> power off: the entire modem is powered off not just the radio. The
>> device does not communicate with the host because it is unpowered.
>>
>> radio off: the radio is powered down and no network communication is
>> possible, but the modem can still communicate with the host.
>
> clear, the same as mine.
>
> So, saying that my targets are ModemManager Telit plugin's modem_power_down
> and modem_power_off functions, we have:
>
> * modem_power_off (which is not implemented) == power off.
> Ideally, CFUN=0 would be the candidate, but it would make the modem
> unrecoverable, so CFUN=4 would be my choice, which is OK, if I understood
> correcly.
>
Well, I think you can do CFUN=0 for the power off. Power off assumes
that the modem may get totally removed after the command, as in the
log we print:
mm_info ("Modem powered off... may no longer be accessible");
The purpose of the power off as it is, is to shutdown the modem, even
if we cannot access it any more. A use case would be when you have a
externally powered modem, and you want the modem to totally shutdown
cleanly before cutting the power to it, for example.
> * modem_power_down is currently implemented with CFUN=4 so == radio off.
> However, considering that it is activated with "mmcli -m <ID>
> --set-power-low", it looks to me as a function that puts the modem in a
> "power saving state", for which Telit's CFUN=5 would be more appropriate.
> The problem is that if I change modem_power_down to CFUN=5, when I use
> "nmcli radio off" ModemManager will send CFUN=5, which is not a "radio off"
> state.
> So, the question is, "mmcli -i <ID> --state-power-low" is to be considered
> like "go to power save" or "radio off"?
>
"power low" as MM sees it is more like "radio off", not as "power
saving mode". Just think that when you switch off the radio, the power
consumed goes very low :)
>
>> The ModemManager API specification would not allow CFUN=5 for the
>> "disabled" state, since it defines the disabled state as not allowing
>> network communication. So I would still use CFUN=4 for "disabled"
>> state.
>
> But, if I got it right, I can't override mm_modem_disable for a plugin,
> right? When I disable the modem (mmcli -m ID --disable) no AT+CFUN command
> is sent to the modem.
>
No functionality/power change is ever done automatically in the modem
disabling step. There was some time where we did the low-power
switching automatically as a step in disabling, but we removed that.
So.:
* Modem enable does an implicit change to full functionality mode: CFUN=1
* Modem disable does not change the functionality mode.
* You can only go to low-power mode when the modem is in disabled state: CFUN=4
>> But couldn't the modem instead be set to CFUN=5 whenever it is
>> enabled? The Telit docs seem to say it's a fully functional state,
>> just that the modem can do some power saving. Which sounds like a win
>> without a downside.
>
> I guess that moving in and out from a power saving state would cost some
> time (and maybe overhead?) respect CFUN=1 which should be more responsive.
> Moreover, I would expect to get into a power saving state issuing
> --set-power-low more that with --set-power-on.
We could always add a new "--set-power-saving" operation that can be
run at any time, when modem enabled or disabled. If modem is disabled
and we set "power saving" state, we cache that request and once we
enable the modem we could issue a CFUN=5 instead of CFUN=1. If the
modem is enabled when we set "power saving" state, we just do the
CFUN=5 right away.
--
Aleksander
https://aleksander.es