<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
RANJAN schrieb:
<blockquote
 cite="mid:1a9a6b160910271121i2e5b4208h5fe92abffcd7de27@mail.gmail.com"
 type="cite"><br>
  <br>
  <div class="gmail_quote">On Tue, Oct 27, 2009 at 11:02 PM, Matthias
Huber <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:matthias.huber@wollishausen.de">matthias.huber@wollishausen.de</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">RANJAN
schrieb:
    <div class="im"><br>
    <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
      <br>
Any idea about a simple script to send and read the received SMS on the
FR in python?<br>
    </blockquote>
    </div>
i tried it at the moment: for example:<br>
    <br>
mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device
org.freesmartphone.GSM.SMS.SendMessage 0049987654321 &nbsp; "test message" &nbsp;
&nbsp;[]<br>
    <br>
is this ok, or do you want a python script ?<br>
  </blockquote>
  <div><br>
A script would help but I guess it is about creating an object and
calling the function using it.<br>
  <br>
Sriranjan <br>
  </div>
  </div>
  <br>
</blockquote>
of course, what else, but because i tried it already, you must not
reinvent the wheel again:<br>
<br>
<br>
root@om-gta02 ~/contactx # cat sms_read.py <br>
#!/usr/bin/python<br>
<br>
import sys<br>
import dbus<br>
from dbus.mainloop.glib import DBusGMainLoop<br>
DBusGMainLoop(set_as_default=True)<br>
<br>
bus = dbus.SystemBus()<br>
device = bus.get_object( 'org.freesmartphone.ogsmd',
'/org/freesmartphone/GSM/Device' )<br>
iface = dbus.Interface(device, 'org.freesmartphone.GSM.SIM')<br>
for i in iface.RetrieveMessagebook("all"):<br>
&nbsp;&nbsp;&nbsp; print repr(i)<br>
<br>
<br>
<br>
root@om-gta02 ~/contactx # cat sms_send.py <br>
#!/usr/bin/python<br>
<br>
import sys<br>
import dbus<br>
from dbus.mainloop.glib import DBusGMainLoop<br>
DBusGMainLoop(set_as_default=True)<br>
<br>
bus = dbus.SystemBus()<br>
gsm_device_obj = bus.get_object( 'org.freesmartphone.ogsmd',
'/org/freesmartphone/GSM/Device' )<br>
gsm_sms_iface = dbus.Interface(gsm_device_obj,
'org.freesmartphone.GSM.SMS')<br>
gsm_sms_iface.SendMessage( sys.argv[1], sys.argv[2], [] )<br>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Mit freundlichen Gr&uuml;ssen
Matthias Huber 
Kohlstattstr. 14
86459 Wollishausen
Tel: 08238-7998
LPI000181125
</pre>
</body>
</html>