Talk:Mdbus

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(making a phone call)
(realtimeclock)
Line 37: Line 37:
 
mdbus -s -org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 
mdbus -s -org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 
  org.freesmartphone.GSM.Initiate "+49123456789" "voice"
 
  org.freesmartphone.GSM.Initiate "+49123456789" "voice"
 +
</pre>
 +
 +
 +
==Realtime clock==
 +
<pre>
 +
#!/usr/bin/env python
 +
 +
import dbus
 +
import time
 +
 +
# Wakeup in 60 seconds
 +
wakeuptime=str(time.time()+60)
 +
 +
system_bus = dbus.SystemBus()
 +
 +
rtc_object = system_bus.get_object('org.freesmartphone.odeviced', '/org/freesmartphone/Device/RealTimeClock/0')
 +
rtc_interface = dbus.Interface(rtc_object, dbus_interface='org.freesmartphone.Device.RealTimeClock')
 +
rtc_interface.SetWakeupTime(wakeuptime)
 
</pre>
 
</pre>

Revision as of 15:08, 19 March 2009

I like tutorials, but I have not found proper place to highlight interesting tutorials:

making a phone call

(from discussion of Sten Kvamme and Michael 'Mickey' Lauer at devel malinglist)

mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 org.freesmartphone.Resource.Enable

This will not work, since mdbus will register to the bus and vanish right afterwards, meaning the resource will be released immediately (if noone else has requested it). Try setting the policy to always-enabled:

mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage
org.freesmartphone.Usage.SetResourcePolicy "GSM" "enabled"


mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 org.freesmartphone.GSM.Device.SetAntennaPower boolean:True
mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 org.freesmartphone.GSM.Network.Register
mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/Phone \
 org.freesmartphone.Phone.CreateCall string:0123456789 \
 string:GSM boolean:True

should work -- although I'd rather use the ogsmd subsystem here, in which case it would be:

mdbus -s -org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 org.freesmartphone.GSM.Initiate "+49123456789" "voice"


Realtime clock

#!/usr/bin/env python
 
import dbus
import time
 
# Wakeup in 60 seconds
wakeuptime=str(time.time()+60)
 
system_bus = dbus.SystemBus()

rtc_object = system_bus.get_object('org.freesmartphone.odeviced', '/org/freesmartphone/Device/RealTimeClock/0')
rtc_interface = dbus.Interface(rtc_object, dbus_interface='org.freesmartphone.Device.RealTimeClock')
rtc_interface.SetWakeupTime(wakeuptime)
Personal tools

I like tutorials, but I have not found proper place to highlight interesting tutorials:

making a phone call

(from discussion of Sten Kvamme and Michael 'Mickey' Lauer at devel malinglist)

mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 org.freesmartphone.Resource.Enable

This will not work, since mdbus will register to the bus and vanish right afterwards, meaning the resource will be released immediately (if noone else has requested it). Try setting the policy to always-enabled:

mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage
org.freesmartphone.Usage.SetResourcePolicy "GSM" "enabled"


mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 org.freesmartphone.GSM.Device.SetAntennaPower boolean:True
mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 org.freesmartphone.GSM.Network.Register
mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/Phone \
 org.freesmartphone.Phone.CreateCall string:0123456789 \
 string:GSM boolean:True

should work -- although I'd rather use the ogsmd subsystem here, in which case it would be:

mdbus -s -org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device \
 org.freesmartphone.GSM.Initiate "+49123456789" "voice"