[Sugar-devel] Dbus signal when ebook switch is activated

Gonzalo Odiard gonzalo at laptop.org
Wed Oct 13 11:33:50 EDT 2010

I am trying to catch a event when the ebook switch in a XO-1.5 is activated
and read the switch state.
Using dbus-monitor I have found the signal emited, but the message does not
inform the switch state. It 's odd because send a array of booleans values,
but are always in False.
The signal is emited when the ebook switch or the lid switch are activated.
Simple test code:

[olpc at xo-a7-2b-49 ~]$ cat test-dbus.py
#!/usr/bin/env python

#def my_func(account, sender, message, conversation, flags):
def my_func(sender, message):
    print sender, "said:", message

import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
bus = dbus.SystemBus()


loop = gobject.MainLoop()

I see this when activate the switchs:

[olpc at xo-a7-2b-49 ~]$ python test-dbus.py
1 said: dbus.Array([dbus.Struct((dbus.String(u'button.state.value'),
dbus.Boolean(False), dbus.Boolean(False)), signature=None)],

I know I can read the switch state from
/proc/acpi/olpc-switch/ebook/EBK/state and /proc/acpi/button/lid/LID/state

The question is: the dbus message must send the state? i am doing anything
Finally, there are a similar procedure to the XO-1?

I am doing all this to http://dev.laptop.org/ticket/10396


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20101013/a473fc65/attachment.html>

More information about the Sugar-devel mailing list