mirror of git://git.sysmocom.de/ofono
test: Add test script to set sms alphabet
This commit is contained in:
parent
a2168cd136
commit
638583522e
|
@ -825,7 +825,8 @@ test_scripts = test/backtrace \
|
|||
test/test-serving-cell-info \
|
||||
test/ims-register \
|
||||
test/ims-unregister \
|
||||
test/list-applications
|
||||
test/list-applications \
|
||||
test/set-sms-alphabet
|
||||
|
||||
|
||||
if TEST
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import dbus
|
||||
import sys
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
if len(sys.argv) == 3:
|
||||
path = sys.argv[1]
|
||||
alphabet = sys.argv[2]
|
||||
elif len(sys.argv) == 2:
|
||||
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
||||
'org.ofono.Manager')
|
||||
modems = manager.GetModems()
|
||||
path = modems[0][0]
|
||||
alphabet = sys.argv[1]
|
||||
else:
|
||||
print("%s [PATH] turkish|spanish|portuguese|bengali|gujarati" % (sys.argv[0]))
|
||||
sys.exit(1)
|
||||
|
||||
print("Setting alphabet for modem %s..." % path)
|
||||
sms = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.MessageManager')
|
||||
|
||||
sms.SetProperty("Alphabet", dbus.String(alphabet));
|
Loading…
Reference in New Issue