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:
[o...@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 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() bus.add_signal_receiver(my_func, dbus_interface="org.freedesktop.Hal.Device", signal_name="PropertyModified") loop = gobject.MainLoop() loop.run() I see this when activate the switchs: [o...@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)], signature=dbus.Signature('(sbb)')) 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 wrong? Finally, there are a similar procedure to the XO-1? I am doing all this to http://dev.laptop.org/ticket/10396 Thanks Gonzalo
_______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel