---
test/send-sms | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/test/send-sms b/test/send-sms
index bd1fae5..968824b 100755
--- a/test/send-sms
+++ b/test/send-sms
@@ -3,22 +3,32 @@
import sys
import dbus
+if len(sys.argv) < 4:
+ print "Usage: %s [modem] <to> <message> <delivery report>"
%\
+ (sys.argv[0])
+ sys.exit(1)
+
bus = dbus.SystemBus()
-manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
+if len(sys.argv) == 5:
+ path = sys.argv[1]
+else:
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
+
+print "Send message using modem %s ..." % path
-modems = manager.GetModems()
-path = modems[0][0]
-manager = dbus.Interface(bus.get_object('org.ofono', path),
+mm = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.MessageManager')
-if len(sys.argv) == 4:
- manager.SetProperty("UseDeliveryReports",
- dbus.Boolean(int(sys.argv[1])))
- path = manager.SendMessage(sys.argv[1], sys.argv[2])
+if len(sys.argv) == 5:
+ mm.SetProperty("UseDeliveryReports",
+ dbus.Boolean(int(sys.argv[4])))
+ path = mm.SendMessage(sys.argv[2], sys.argv[3])
else:
- path = manager.SendMessage(sys.argv[1], sys.argv[2])
+ path = mm.SendMessage(sys.argv[1], sys.argv[2])
print path
--
1.7.1
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
Show replies by date
Hi Bertrand,
On 04/28/2011 04:54 AM, Bertrand Aygon wrote:
---
test/send-sms | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
Patch has been applied, thanks.
Regards,
-Denis