1.Reference
http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/DBus/DBus_Basics
http://maemo.org/api_refs/5.0/5.0-final/mce-dev/dbus-names_8h.html#c9f233f336f9be78f223a31866455b80
http://www.mail-archive.com/maemo-developers@maemo.org/msg01889.html
2.以下的程式碼片段就是我想要的囉
DBusConnection *conn;
DBusMessage *msg = NULL;
DBusError dbus_error;
dbus_bool_t dresult;
#define MCE_SERVICE "com.nokia.mce"
#define MCE_REQUEST_PATH "/com/nokia/mce/request"
#define MCE_REQUEST_IF "com.nokia.mce.request"
#define MCE_PREVENT_BLANK_REQ "req_display_blanking_pause"
dbus_error_init(&dbus_error);
conn = dbus_bus_get (DBUS_BUS_SYSTEM, &dbus_error);
msg = dbus_message_new_method_call(MCE_SERVICE,
MCE_REQUEST_PATH,
MCE_REQUEST_IF,
MCE_PREVENT_BLANK_REQ);
if (msg == NULL)
return;
dresult = dbus_connection_send (conn, msg, NULL);
if (!dresult)
{
dbus_message_unref(msg);
return;
}
dbus_connection_flush(conn);
dbus_message_unref(msg);
沒有留言:
張貼留言