We are currently developing an embedded device based on the am335x sdk from ti (based on Arago project)
The main application on the device is being developed using Qt4.8
We want to detect when the device is entering Standby / Mem states so that we can save data and suspend our main application
We also want to detect when the device is resuming from these states so that the main application can be resumed correctly
Does anyone have experience / information / links to how this may be achieved?
I've found a solution to my issue above.
On our system the Standby / Mem state can be invoked via a script
/usr/bin/pm_suspend.sh
which in turn callsecho mem > /sys/power/state
to suspend the device to memory.I've added
kill -USR2 {App.pid}
before the call to suspend andkill -USR1 {App.pid}
after.My application understands that
USR2
is a signal to save our data and delete our main form and thatUSR1
is a signal to spawn a new instance of our main form.