mirror of
https://github.com/sailfishos/ofono
synced 2025-11-30 14:41:04 +08:00
test: Add test script to set sms alphabet
This commit is contained in:
committed by
Adam Pigg
parent
fea0b49834
commit
e7f7197e5f
@@ -892,7 +892,8 @@ test_scripts = test/backtrace \
|
|||||||
test/test-serving-cell-info \
|
test/test-serving-cell-info \
|
||||||
test/ims-register \
|
test/ims-register \
|
||||||
test/ims-unregister \
|
test/ims-unregister \
|
||||||
test/list-applications
|
test/list-applications \
|
||||||
|
test/set-sms-alphabet
|
||||||
|
|
||||||
|
|
||||||
if TEST
|
if TEST
|
||||||
|
|||||||
25
ofono/test/set-sms-alphabet
Normal file
25
ofono/test/set-sms-alphabet
Normal file
@@ -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));
|
||||||
Reference in New Issue
Block a user