legatoproject / legato-af

Legato Application Framework
Mozilla Public License 2.0
153 stars 118 forks source link

Le ulpm #57

Closed goowza closed 4 years ago

goowza commented 4 years ago

This patch adds a new method to le_ulpm API : _le_ulpmSetShutDownValue. This function allows the user to configure the Low Power mode before shutdown. The possible values that can be selected are defined by an enum, based on the swimcu_pm documentation:

This function changes the value written in /sys/module/swimcu_pm/boot_source/enable by _le_ulpmShutDown method. This is why this patch required to slightly modify _le_ulpmShutDown too.

The default behavior of _le_ulpmShutDown is not impacted, because if the user doesn't call _le_ulpmSetShutDownValue beforehand, _le_ulpmShutDown will write PSM_WITH_ULPM_FALLBACK (1) into /sys/module/swimcu_pm/boot_source/enable as it was previously done.

This patch allow the user to have a better control over the Low Power modes used by the system.
It makes it easier to disable PSM or ULPM without having to use AT commands in your Legato applications (as it was suggested in the workaround described in this post to disable PSM).

Thank you for your time, have a great day !

BR Paul Meis paul.meis@wiifor.com

CoRfr commented 4 years ago

Hi @goowza and thanks for your contribution! I provided few comments on your patch, please have a look and see if you can fix them. Also a few things:

CoRfr commented 4 years ago

Internal tracker: https://issues.sierrawireless.com/browse/LE-14950

CoRfr commented 4 years ago

As we try to maintain a clean git history, could you rebase your changes on top of the master branch, and squash them together (so that your changes appear as a single commit) ?

Also I don't think we received your CLA, where you able to send it?

Thanks @goowza

goowza commented 4 years ago

As we try to maintain a clean git history, could you rebase your changes on top of the master branch, and squash them together (so that your changes appear as a single commit) ?

Also I don't think we received your CLA, where you able to send it?

Thanks @goowza

Yes I'm trying to do that ASAP ! I'll send the CLA today

Edit : it's done !