To avoid display off, Maemo is providing DBUS API using which you can disable display off.
Following is Qt code to send dbus call to disable display off. You need to call this method at least once in every 60 seconds to avoid display off.
QDBusConnection::systemBus().call(QDBusMessage::createMethodCall(MCE_SERVICE,
MCE_REQUEST_PATH,MCE_REQUEST_IF, MCE_PREVENT_BLANK_REQ));
You will also need to include "mce/mode-names.h","mce/dbus-names.h" and "QtDBus" headers and add dbus support in Qt's pro file.
I hope this will help to someone facing similar problem.
No comments:
Post a Comment