MDBus2 for Maemo5

During FOSDEM I attended few talks in Openmoko devroom. During one of them Mickey ‘mickeyl’ Lauer was using his ‘mdbus’ tool to inspect and play with DBus services and methods. As tool looked interesting I decided to try it.

Same day I played a bit with it on Nokia N900. Results were nicer then with using “dbus-monitor” or “dbus-send” but speed was a bit slow (due to Python used). But there was a hope: Mickeyl already started rewriting “mickeydbus” in Vala which should give speed boost.

Yesterday I built “mickeydbus2” for Maemo5 using OpenEmbedded (more about it in next posts) and played with it. Few bugs appeared, but I fixed some, Mickeyl did rest and coded few improvements.

But what this app really do? It has 2 modes basically: listener and method inspector/caller. Example listen session:

Nokia-N900-42-11:~# mdbus2 -sl
[SIGNAL] org.freedesktop.DBus.NameAcquired  /org/freedesktop/DBus  org.freedesktop.DBus
( ":1.928" )
[SIGNAL] com.nokia.mce.signal.tklock_mode_ind  /com/nokia/mce/signal  :1.8
( "locked" )
[SIGNAL] org.freedesktop.Hal.Device.PropertyModified  /org/freedesktop/Hal/devices/platform_slide  :1.12
( 1, [ ( "button.state.value", false, false ) ] )
[SIGNAL] org.freedesktop.Hal.Device.Condition  /org/freedesktop/Hal/devices/platform_slide  :1.12
( "ButtonPressed", "cover" )
[SIGNAL] org.freedesktop.Hal.Device.PropertyModified  /org/freedesktop/Hal/devices/platform_kb_lock  :1.12
( 1, [ ( "button.state.value", false, false ) ] )
[SIGNAL] org.freedesktop.Hal.Device.Condition  /org/freedesktop/Hal/devices/platform_kb_lock  :1.12
( "ButtonPressed", "cover" )
[SIGNAL] com.nokia.mce.signal.tklock_mode_ind  /com/nokia/mce/signal  :1.8
( "unlocked" )
[SIGNAL] com.nokia.mce.signal.system_inactivity_ind  /com/nokia/mce/signal  :1.8
( false )
[SIGNAL] com.nokia.mce.signal.display_status_ind  /com/nokia/mce/signal  :1.8
( "on" )
[SIGNAL] org.freedesktop.Hal.Device.PropertyModified  /org/freedesktop/Hal/devices/bme  :1.12
( 2, [ ( "battery.reporting.current", false, false ), ( "battery.charge_level.percentage", false, false ) ] )
[SIGNAL] org.freedesktop.Hal.Device.PropertyModified  /org/freedesktop/Hal/devices/platform_kb_lock  :1.12
( 1, [ ( "button.state.value", false, false ) ] )
[SIGNAL] org.freedesktop.Hal.Device.Condition  /org/freedesktop/Hal/devices/platform_kb_lock  :1.12
( "ButtonPressed", "cover" )

Asking for bus and methods:

Nokia-N900-42-11:~# mdbus2 -s org.bluez
/
/com
/com/nokia
/com/nokia/MaemoTelephony
/org
/org/bluez
/org/bluez/899
/org/bluez/899/any
/org/bluez/899/hci0
/org/bluez/899/hci0/dev_00_1D_82_32_0A_22
Nokia-N900-42-11:~# mdbus2 -s org.bluez /com/nokia/MaemoTelephony
[METHOD]    org.freedesktop.DBus.Introspectable.Introspect() -> ( s:none )
[METHOD]    com.nokia.MaemoTelephony.SetCallerId( s:none ) -> ()

And there is also interactive mode with tab completion:

Nokia-N900-42-11:~# mdbus2 -i -s
MDBUS2> org.bluez /com/nokia
/com/nokia                 /com/nokia/MaemoTelephony
MDBUS2> org.bluez /com/nokia/MaemoTelephony
[METHOD]    org.freedesktop.DBus.Introspectable.Introspect() -> ( s:none )
[METHOD]    com.nokia.MaemoTelephony.SetCallerId( s:none ) -> ()
MDBUS2>

How to get it on your N900? Enable “extras-devel” repository and install “mdbus2” package. Report bugs, send us fixes, ideas, improvements. Git tree is available.

dbus maemo n900 nokia openmoko