All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Modify send sms test to be able to set the modem to use
@ 2011-04-28  9:54 Bertrand Aygon
  2011-04-28 14:23 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Bertrand Aygon @ 2011-04-28  9:54 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2027 bytes --]

---
 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.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-28 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28  9:54 [PATCH] Modify send sms test to be able to set the modem to use Bertrand Aygon
2011-04-28 14:23 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.