RANJAN schrieb:


On Tue, Oct 27, 2009 at 11:02 PM, Matthias Huber <matthias.hu...@wollishausen.de <mailto:matthias.hu...@wollishausen.de>> wrote:

    RANJAN schrieb:

        Hi,

        Any idea about a simple script to send and read the received
        SMS on the FR in python?

    i tried it at the moment: for example:

    mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device
    org.freesmartphone.GSM.SMS.SendMessage 0049987654321   "test
    message"    []

    is this ok, or do you want a python script ?


A script would help but I guess it is about creating an object and calling the function using it.

Sriranjan

of course, what else, but because i tried it already, you must not reinvent the wheel again:


r...@om-gta02 ~/contactx # cat sms_read.py
#!/usr/bin/python

import sys
import dbus
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)

bus = dbus.SystemBus()
device = bus.get_object( 'org.freesmartphone.ogsmd', '/org/freesmartphone/GSM/Device' )
iface = dbus.Interface(device, 'org.freesmartphone.GSM.SIM')
for i in iface.RetrieveMessagebook("all"):
   print repr(i)



r...@om-gta02 ~/contactx # cat sms_send.py
#!/usr/bin/python

import sys
import dbus
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)

bus = dbus.SystemBus()
gsm_device_obj = bus.get_object( 'org.freesmartphone.ogsmd', '/org/freesmartphone/GSM/Device' )
gsm_sms_iface = dbus.Interface(gsm_device_obj, 'org.freesmartphone.GSM.SMS')
gsm_sms_iface.SendMessage( sys.argv[1], sys.argv[2], [] )


--
Mit freundlichen GrĂ¼ssen
Matthias Huber Kohlstattstr. 14
86459 Wollishausen
Tel: 08238-7998
LPI000181125

_______________________________________________
devel mailing list
devel@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/devel

Reply via email to