How to Detect Physical Power Switch at Shutdown?

Started by ayman, July 15, 2014, 05:09:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ayman

Hi everyone,

I'm trying to code in this suggestion in another thread into working for the Canon 6D:

Quote from: ptygmit on March 29, 2014, 06:27:48 AM
Is it possible to set the power save to only come into effect when the camera is powered off using the main switch, rather than the camera's auto power off feature?

I see the ml_shutdown() function in tasks.c but I'm not sure how to detect if the shutdown is called by sleep or physical switch.  Is there a method to query the switch or an event to listen for?

-ayman

a1ex

These should help: GMT_GUICMD_START_AS_CHECK, GMT_GUICMD_OPEN_SLOT_COVER, GMT_GUICMD_LOCK_OFF.

I didn't play much with them (they are Canon events sent at shutdown), but would be nice to have a core API that tells how the shutdown was done. The harder part is testing it on all models (it's not exactly something that can be automated, and is unlikely to be widely used, to get good testing coverage).

ayman

Thanks a1ex - I'll give that a peek.  Selfishly I'm wanting this feature on my 6D.  :-)