[ofono] vendor code
by Tonny Tzeng
Hi List,
While debugging a connection issue using huawei EM770W modem, I added
a DBG code to print out the status value received in at_cgreg_cb() in
drivers/atmodem/gprs.c, I found the status got from the
at_util_parse_reg() is incorrect sometimes, because ofono does not set
vendor ID in the gprs_data, and it looks to me the vendor code is
required so that the at_util_parse_reg() will read unquoted strings in
the solicited events for huawei modem. For example, when we got
"+CGREG: 1, 2833, 1231B60" followed by "+CGREG: 2,1, 2733, 1B60"
unsolicited codes, the status parsed from this code is 2833 (i.e. the
1st code), instead of the expected 1 in the 2nd code.
It looks like all modem plugins invoke ofono_gprs_context_create()
with vendor=0, is this on purpose? then how could at_util_parse_reg()
parses strings correctly without knowing vendor code?
ofonod[29687]: PCUI: > AT+CGREG?\r
ofonod[29687]: PCUI: < \r\n^RSSI:31\r\n
ofonod[29687]: PCUI: < \r\n^SRVST:2\r\n\r\n^MODE:5,4\r\n
ofonod[29687]: PCUI: < \r\n+CREG: 1, 2833, 1231B60\r\n\r\n+CGREG: 1,
2833, 1231B60\r\n
ofonod[29687]: src/gprs.c:netreg_status_changed() 1
ofonod[29687]: src/cbs.c:cbs_location_changed() 1, 10291, 19077984,
-1, (null)(null)
ofonod[29687]: PCUI: < \r\n+CGREG: 2,1, 2833, 1B60\r\n\r\nOK\r\n
ofonod[29687]: drivers/atmodem/gprs.c:at_cgreg_cb() vendor=0, status=2833
ofonod[29687]: src/gprs.c:registration_status_cb() /huawei0 error 0 status 2833
Best Regards,
Tonny
10 years, 4 months
[PATCH] voicecall: fix DBG message
by Gustavo F. Padovan
---
drivers/atmodem/voicecall.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c
index 10b8f4b..3c31d72 100644
--- a/drivers/atmodem/voicecall.c
+++ b/drivers/atmodem/voicecall.c
@@ -723,7 +723,7 @@ static void clip_notify(GAtResult *result, gpointer user_data)
/* If we have CLI validity field, override our guessed value */
g_at_result_iter_next_number(&iter, &validity);
- DBG("clip_notify: %s %d %d", num, type, validity);
+ DBG("%s %d %d", num, type, validity);
call = l->data;
--
1.7.3.2
10 years, 4 months
[PATCH] atmodem: fix DBG message
by Gustavo F. Padovan
---
drivers/atmodem/voicecall.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c
index 10b8f4b..f6714cb 100644
--- a/drivers/atmodem/voicecall.c
+++ b/drivers/atmodem/voicecall.c
@@ -679,7 +679,7 @@ static void cring_notify(GAtResult *result, gpointer user_data)
*/
vd->clcc_source = g_timeout_add(CLIP_INTERVAL, poll_clcc, vc);
- DBG("cring_notify");
+ DBG("");
}
static void clip_notify(GAtResult *result, gpointer user_data)
@@ -723,7 +723,7 @@ static void clip_notify(GAtResult *result, gpointer user_data)
/* If we have CLI validity field, override our guessed value */
g_at_result_iter_next_number(&iter, &validity);
- DBG("clip_notify: %s %d %d", num, type, validity);
+ DBG("%s %d %d", num, type, validity);
call = l->data;
@@ -784,7 +784,7 @@ static void ccwa_notify(GAtResult *result, gpointer user_data)
/* If we have CLI validity field, override our guessed value */
g_at_result_iter_next_number(&iter, &validity);
- DBG("ccwa_notify: %s %d %d %d", num, num_type, cls, validity);
+ DBG("%s %d %d %d", num, num_type, cls, validity);
call = create_call(vc, class_to_call_type(cls), 1, 5,
num, num_type, validity);
--
1.7.3.2
10 years, 4 months
[PATCH] test: add compatibility with python3
by Lucas De Marchi
The following conversion was made to python scripts, which maintains
compatibility with both python 2.6 and 3.x:
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
- print "Release"
+ print("Release")
- for key in props.keys():
+ for key in list(props.keys()):
- if properties.has_key('Manufacturer'):
+ if 'Manufacturer' in properties:
Scripts that use raw_input() or use a unicode object are
not yet compatible with python3.
---
test/activate-context | 6 +-
test/answer-calls | 4 +-
test/backtrace | 8 ++--
test/cancel-ussd | 2 +-
test/create-internet-context | 10 ++--
test/create-mms-context | 10 ++--
test/create-multiparty | 2 +-
test/deactivate-context | 6 +-
test/dial-number | 2 +-
test/disable-gprs | 2 +-
test/disable-modem | 2 +-
test/enable-cbs | 2 +-
test/enable-gprs | 2 +-
test/enable-modem | 2 +-
test/enter-pin | 4 +-
test/get-icon | 4 +-
test/get-operators | 8 ++--
test/get-tech-preference | 2 +-
test/initiate-ussd | 12 +++---
test/list-calls | 10 ++--
test/list-contexts | 12 +++---
test/list-modems | 14 +++---
test/list-operators | 10 ++--
test/lock-pin | 4 +-
test/monitor-ofono | 20 ++++----
test/offline-modem | 2 +-
test/online-modem | 2 +-
test/private-chat | 2 +-
test/process-context-settings | 14 +++---
test/receive-sms | 4 +-
test/remove-contexts | 2 +-
test/reset-pin | 4 +-
test/scan-for-operators | 10 ++--
test/send-sms | 2 +-
test/send-vcard | 2 +-
test/set-cbs-topics | 4 +-
test/set-fast-dormancy | 4 +-
test/set-mms-details | 8 ++--
test/set-roaming-allowed | 2 +-
test/set-tech-preference | 4 +-
test/set-tty | 4 +-
test/set-use-sms-reports | 4 +-
test/test-advice-of-charge | 36 ++++++++--------
test/test-call-barring | 24 +++++-----
test/test-call-forwarding | 70 +++++++++++++++---------------
test/test-call-settings | 36 ++++++++--------
test/test-modem | 18 ++++----
test/test-network-registration | 34 +++++++-------
test/test-phonebook | 2 +-
test/test-push-notification | 10 ++--
test/test-smart-messaging | 20 ++++----
test/test-ss-control-cb | 76 ++++++++++++++++----------------
test/test-ss-control-cf | 32 +++++++-------
test/test-ss-control-cs | 92 ++++++++++++++++++++--------------------
test/test-stk-menu | 48 ++++++++++----------
test/test-ussd | 16 ++++----
test/test-voicecall | 38 ++++++++--------
test/unlock-pin | 4 +-
58 files changed, 395 insertions(+), 395 deletions(-)
diff --git a/test/activate-context b/test/activate-context
index 2e64db5..0b83b41 100755
--- a/test/activate-context
+++ b/test/activate-context
@@ -20,7 +20,7 @@ for path, properties in modems:
contexts = connman.GetContexts()
if (len(contexts) == 0):
- print "No context available"
+ print("No context available")
sys.exit(1)
connman.SetProperty("Powered", dbus.Boolean(1))
@@ -35,6 +35,6 @@ for path, properties in modems:
try:
context.SetProperty("Active", dbus.Boolean(1))
- except dbus.DBusException, e:
- print "Error activating %s: %s" % (path, str(e))
+ except dbus.DBusException as e:
+ print("Error activating %s: %s" % (path, str(e)))
exit(2)
diff --git a/test/answer-calls b/test/answer-calls
index 0deb832..45ff08f 100755
--- a/test/answer-calls
+++ b/test/answer-calls
@@ -10,7 +10,7 @@ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
modems = manager.GetModems()
for path, properties in modems:
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
if "org.ofono.VoiceCallManager" not in properties["Interfaces"]:
continue
@@ -22,7 +22,7 @@ for path, properties in modems:
for path, properties in calls:
state = properties["State"]
- print "[ %s ] %s" % (path, state)
+ print("[ %s ] %s" % (path, state))
if state != "incoming":
continue
diff --git a/test/backtrace b/test/backtrace
index c906f36..c624709 100755
--- a/test/backtrace
+++ b/test/backtrace
@@ -6,7 +6,7 @@ import sys
import subprocess
if (len(sys.argv) < 3):
- print "Usage: %s [binary] [log]" % (sys.argv[0])
+ print("Usage: %s [binary] [log]" % (sys.argv[0]))
sys.exit(1)
binary = sys.argv[1]
@@ -50,8 +50,8 @@ child_stdout.close()
frame_count = len(frames);
count = 0
-print "-------- backtrace --------"
+print("-------- backtrace --------")
while count < frame_count:
- print "[%d]: %s() [%s]" % (count/2, frames[count], frames[count + 1])
+ print("[%d]: %s() [%s]" % (count/2, frames[count], frames[count + 1]))
count = count + 2
-print "---------------------------"
+print("---------------------------")
diff --git a/test/cancel-ussd b/test/cancel-ussd
index 7379622..2a7407d 100755
--- a/test/cancel-ussd
+++ b/test/cancel-ussd
@@ -18,7 +18,7 @@ ussd = dbus.Interface(bus.get_object('org.ofono', path),
properties = ussd.GetProperties()
state = properties["State"]
-print "State: %s" % (state)
+print("State: %s" % (state))
if state != "idle":
ussd.Cancel()
diff --git a/test/create-internet-context b/test/create-internet-context
index 3d548d0..efd0998 100755
--- a/test/create-internet-context
+++ b/test/create-internet-context
@@ -27,21 +27,21 @@ for path, properties in modems:
if path == "":
path = connman.AddContext("internet")
- print "Created new context %s" % (path)
+ print("Created new context %s" % (path))
else:
- print "Found context %s" % (path)
+ print("Found context %s" % (path))
context = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.ConnectionContext')
if len(sys.argv) > 1:
context.SetProperty("AccessPointName", sys.argv[1])
- print "Setting APN to %s" % (sys.argv[1])
+ print("Setting APN to %s" % (sys.argv[1]))
if len(sys.argv) > 2:
context.SetProperty("Username", sys.argv[2])
- print "Setting username to %s" % (sys.argv[2])
+ print("Setting username to %s" % (sys.argv[2]))
if len(sys.argv) > 3:
context.SetProperty("Password", sys.argv[3])
- print "Setting password to %s" % (sys.argv[3])
+ print("Setting password to %s" % (sys.argv[3]))
diff --git a/test/create-mms-context b/test/create-mms-context
index 861ca7c..e5be08d 100755
--- a/test/create-mms-context
+++ b/test/create-mms-context
@@ -27,21 +27,21 @@ for path, properties in modems:
if path == "":
path = connman.AddContext("mms")
- print "Created new context %s" % (path)
+ print("Created new context %s" % (path))
else:
- print "Found context %s" % (path)
+ print("Found context %s" % (path))
context = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.ConnectionContext')
if len(sys.argv) > 1:
context.SetProperty("AccessPointName", sys.argv[1])
- print "Setting APN to %s" % (sys.argv[1])
+ print("Setting APN to %s" % (sys.argv[1]))
if len(sys.argv) > 2:
context.SetProperty("Username", sys.argv[2])
- print "Setting username to %s" % (sys.argv[2])
+ print("Setting username to %s" % (sys.argv[2]))
if len(sys.argv) > 3:
context.SetProperty("Password", sys.argv[3])
- print "Setting password to %s" % (sys.argv[3])
+ print("Setting password to %s" % (sys.argv[3]))
diff --git a/test/create-multiparty b/test/create-multiparty
index 79e98a6..649936a 100755
--- a/test/create-multiparty
+++ b/test/create-multiparty
@@ -18,4 +18,4 @@ manager = dbus.Interface(bus.get_object('org.ofono', path),
mpty = manager.CreateMultiparty()
for path in mpty:
- print path
+ print(path)
diff --git a/test/deactivate-context b/test/deactivate-context
index e3754c2..848bcbd 100755
--- a/test/deactivate-context
+++ b/test/deactivate-context
@@ -20,7 +20,7 @@ for path, properties in modems:
contexts = connman.GetContexts()
if (len(contexts) == 0):
- print "No context available"
+ print("No context available")
sys.exit(1)
if len(sys.argv) > 1:
@@ -33,6 +33,6 @@ for path, properties in modems:
try:
context.SetProperty("Active", dbus.Boolean(0))
- except dbus.DBusException, e:
- print "Error activating %s: %s" % (path, str(e))
+ except dbus.DBusException as e:
+ print("Error activating %s: %s" % (path, str(e)))
exit(2)
diff --git a/test/dial-number b/test/dial-number
index d66a878..3d344cb 100755
--- a/test/dial-number
+++ b/test/dial-number
@@ -20,4 +20,4 @@ if len(sys.argv) > 2:
else:
path = manager.Dial(sys.argv[1], "")
-print path
+print(path)
diff --git a/test/disable-gprs b/test/disable-gprs
index cca2c78..c6c40a5 100755
--- a/test/disable-gprs
+++ b/test/disable-gprs
@@ -13,7 +13,7 @@ else:
modems = manager.GetModems()
path = modems[0][0]
-print "Disconnecting GPRS on modem %s..." % path
+print("Disconnecting GPRS on modem %s..." % path)
cm = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.ConnectionManager')
diff --git a/test/disable-modem b/test/disable-modem
index 45ac2a9..b9373b6 100755
--- a/test/disable-modem
+++ b/test/disable-modem
@@ -13,7 +13,7 @@ else:
modems = manager.GetModems()
path = modems[0][0]
-print "Disconnecting modem %s..." % path
+print("Disconnecting modem %s..." % path)
modem = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.Modem')
diff --git a/test/enable-cbs b/test/enable-cbs
index 9b5b57b..c08bf2b 100755
--- a/test/enable-cbs
+++ b/test/enable-cbs
@@ -13,7 +13,7 @@ else:
modems = manager.GetModems()
path = modems[0][0]
-print "Enabling cell broadcast on modem %s..." % path
+print("Enabling cell broadcast on modem %s..." % path)
cbs = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.CellBroadcast')
diff --git a/test/enable-gprs b/test/enable-gprs
index 2b273a7..8664891 100755
--- a/test/enable-gprs
+++ b/test/enable-gprs
@@ -13,7 +13,7 @@ else:
modems = manager.GetModems()
path = modems[0][0]
-print "Connecting modem %s..." % path
+print("Connecting modem %s..." % path)
cm = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.ConnectionManager')
diff --git a/test/enable-modem b/test/enable-modem
index 44ce64a..2b12e22 100755
--- a/test/enable-modem
+++ b/test/enable-modem
@@ -13,7 +13,7 @@ else:
modems = manager.GetModems()
path = modems[0][0]
-print "Connecting modem %s..." % path
+print("Connecting modem %s..." % path)
modem = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.Modem')
diff --git a/test/enter-pin b/test/enter-pin
index 0bfe112..faeb22b 100755
--- a/test/enter-pin
+++ b/test/enter-pin
@@ -17,9 +17,9 @@ elif len(sys.argv) == 3:
pin_type = sys.argv[1]
pin = sys.argv[2]
else:
- print "%s [PATH] pin_type pin" % (sys.argv[0])
+ print("%s [PATH] pin_type pin" % (sys.argv[0]))
-print "Enter Pin for modem %s..." % path
+print("Enter Pin for modem %s..." % path)
simmanager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.SimManager')
diff --git a/test/get-icon b/test/get-icon
index 326d562..bba463d 100755
--- a/test/get-icon
+++ b/test/get-icon
@@ -8,7 +8,7 @@ bus = dbus.SystemBus()
if len(sys.argv) == 2:
id = sys.argv[1]
else:
- print "%s <icon id>" % (sys.argv[0])
+ print("%s <icon id>" % (sys.argv[0]))
sys.exit(0)
manager = dbus.Interface(bus.get_object("org.ofono", "/"),
@@ -28,4 +28,4 @@ icon = sim.GetIcon(dbus.Byte(int(sys.argv[1])))
xpm = ""
for byte in icon:
xpm += str(byte)
-print xpm
+print(xpm)
diff --git a/test/get-operators b/test/get-operators
index f5bac12..7f70abf 100755
--- a/test/get-operators
+++ b/test/get-operators
@@ -22,16 +22,16 @@ for entry in operators:
path = entry[0]
properties = entry[1]
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["Technologies"]:
val = ""
for i in properties[key]:
val += i + " "
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
- print
+ print()
diff --git a/test/get-tech-preference b/test/get-tech-preference
index fc65536..77d20d0 100755
--- a/test/get-tech-preference
+++ b/test/get-tech-preference
@@ -17,4 +17,4 @@ radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
properties = radiosettings.GetProperties()
-print "Technology preference: %s" % (properties["TechnologyPreference"])
+print("Technology preference: %s" % (properties["TechnologyPreference"]))
diff --git a/test/initiate-ussd b/test/initiate-ussd
index b6a2d86..5f5c0ae 100755
--- a/test/initiate-ussd
+++ b/test/initiate-ussd
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) < 2):
- print "Usage: %s <ussd-string>" % (sys.argv[0])
+ print("Usage: %s <ussd-string>" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -21,7 +21,7 @@ ussd = dbus.Interface(bus.get_object('org.ofono', path),
properties = ussd.GetProperties()
state = properties["State"]
-print "State: %s" % (state)
+print("State: %s" % (state))
if state != "idle":
sys.exit(1);
@@ -31,12 +31,12 @@ result = ussd.Initiate(sys.argv[1], timeout=100)
properties = ussd.GetProperties()
state = properties["State"]
-print result[0] + ": " + result[1]
+print(result[0] + ": " + result[1])
if state == "idle":
sys.exit(0)
-print "State: %s" % (state)
+print("State: %s" % (state))
while state == "user-response":
response = raw_input("Enter response: ")
@@ -46,7 +46,7 @@ while state == "user-response":
properties = ussd.GetProperties()
state = properties["State"]
- print result
+ print(result)
if state != "idle":
- print "State: %s" % (state)
+ print("State: %s" % (state))
diff --git a/test/list-calls b/test/list-calls
index 53124dc..b305dc2 100755
--- a/test/list-calls
+++ b/test/list-calls
@@ -10,7 +10,7 @@ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
modems = manager.GetModems()
for path, properties in modems:
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
if "org.ofono.VoiceCallManager" not in properties["Interfaces"]:
continue
@@ -21,10 +21,10 @@ for path, properties in modems:
calls = mgr.GetCalls()
for path, properties in calls:
- print " [ %s ]" % (path)
+ print(" [ %s ]" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
- print
+ print()
diff --git a/test/list-contexts b/test/list-contexts
index 68dae6a..bab06ad 100755
--- a/test/list-contexts
+++ b/test/list-contexts
@@ -10,7 +10,7 @@ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
modems = manager.GetModems()
for path, properties in modems:
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
continue
@@ -21,12 +21,12 @@ for path, properties in modems:
contexts = connman.GetContexts()
for path, properties in contexts:
- print " [ %s ]" % (path)
+ print(" [ %s ]" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["Settings"]:
val = "{"
- for i in properties[key].keys():
+ for i in list(properties[key].keys()):
val += " " + i + "="
if i in ["DomainNameServers"]:
for n in properties[key][i]:
@@ -36,6 +36,6 @@ for path, properties in modems:
val += " }"
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
- print
+ print()
diff --git a/test/list-modems b/test/list-modems
index 557efd5..5e7f74b 100755
--- a/test/list-modems
+++ b/test/list-modems
@@ -10,29 +10,29 @@ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
modems = manager.GetModems()
for path, properties in modems:
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["Interfaces", "Features"]:
val = ""
for i in properties[key]:
val += i + " "
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
for interface in properties["Interfaces"]:
object = dbus.Interface(bus.get_object('org.ofono', path),
interface)
- print " [ %s ]" % (interface)
+ print(" [ %s ]" % (interface))
try:
properties = object.GetProperties()
except:
continue
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["Calls",
"MultipartyCalls",
"EmergencyNumbers",
@@ -58,6 +58,6 @@ for path, properties in modems:
")" for text, icon in properties[key] ])
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
- print
+ print()
diff --git a/test/list-operators b/test/list-operators
index be00c5b..f7a149e 100755
--- a/test/list-operators
+++ b/test/list-operators
@@ -11,7 +11,7 @@ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
modems = manager.GetModems()
for path, properties in modems:
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
if "org.ofono.NetworkRegistration" not in properties["Interfaces"]:
continue
@@ -25,15 +25,15 @@ for path, properties in modems:
operators = netreg.GetOperators()
for path, properties in operators:
- print " [ %s ]" % (path)
+ print(" [ %s ]" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["Technologies"]:
val = ""
for i in properties[key]:
val += i + " "
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
- print
+ print()
diff --git a/test/lock-pin b/test/lock-pin
index 60c3afb..5579735 100755
--- a/test/lock-pin
+++ b/test/lock-pin
@@ -17,10 +17,10 @@ elif len(sys.argv) == 3:
pin_type = sys.argv[1]
pin = sys.argv[2]
else:
- print "%s [PATH] pin_type pin" % (sys.argv[0])
+ print("%s [PATH] pin_type pin" % (sys.argv[0]))
sys.exit(0)
-print "Lock %s %s for modem %s..." % (pin_type, pin, path)
+print("Lock %s %s for modem %s..." % (pin_type, pin, path))
simmanager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.SimManager')
diff --git a/test/monitor-ofono b/test/monitor-ofono
index 8570c34..2c544f0 100755
--- a/test/monitor-ofono
+++ b/test/monitor-ofono
@@ -24,7 +24,7 @@ def dbus2py(d):
if t in _dbus2py:
return _dbus2py[t](d)
if t is dbus.Dictionary:
- return dict([(dbus2py(k), dbus2py(v)) for k, v in d.items()])
+ return dict([(dbus2py(k), dbus2py(v)) for k, v in list(d.items())])
if t is dbus.Array and d.signature == "y":
return "".join([chr(b) for b in d])
if t is dbus.Array or t is list:
@@ -40,7 +40,7 @@ def pretty(d):
if t in (dict, tuple, list) and len(d) > 0:
if t is dict:
d = ", ".join(["%s = %s" % (k, pretty(v))
- for k, v in d.items()])
+ for k, v in list(d.items())])
return "{ %s }" % d
d = " ".join([pretty(e) for e in d])
@@ -52,32 +52,32 @@ def pretty(d):
def property_changed(name, value, path, interface):
iface = interface[interface.rfind(".") + 1:]
- print "{%s} [%s] %s = %s" % (iface, path, name, pretty(value))
+ print("{%s} [%s] %s = %s" % (iface, path, name, pretty(value)))
def added(name, value, member, path, interface):
iface = interface[interface.rfind(".") + 1:]
- print "{%s} [%s] %s %s" % (iface, member, name, pretty(value))
+ print("{%s} [%s] %s %s" % (iface, member, name, pretty(value)))
def removed(name, member, path, interface):
iface = interface[interface.rfind(".") + 1:]
- print "{%s} [%s] %s" % (iface, name, member)
+ print("{%s} [%s] %s" % (iface, name, member))
def event(member, path, interface):
iface = interface[interface.rfind(".") + 1:]
- print "{%s} [%s] %s" % (iface, path, member)
+ print("{%s} [%s] %s" % (iface, path, member))
def message(msg, args, member, path, interface):
iface = interface[interface.rfind(".") + 1:]
- print "{%s} [%s] %s %s (%s)" % (iface, path, member,
- str(msg), pretty(args))
+ print("{%s} [%s] %s %s (%s)" % (iface, path, member,
+ str(msg), pretty(args)))
def ussd(msg, member, path, interface):
iface = interface[interface.rfind(".") + 1:]
- print "{%s} [%s] %s %s" % (iface, path, member, str(msg))
+ print("{%s} [%s] %s %s" % (iface, path, member, str(msg)))
def value(value, member, path, interface):
iface = interface[interface.rfind(".") + 1:]
- print "{%s} [%s] %s %s" % (iface, path, member, str(value))
+ print("{%s} [%s] %s %s" % (iface, path, member, str(value)))
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
diff --git a/test/offline-modem b/test/offline-modem
index 793e9d4..e450d12 100755
--- a/test/offline-modem
+++ b/test/offline-modem
@@ -12,6 +12,6 @@ else:
modems = manager.GetModems()
path = modems[0][0]
-print "Setting modem %s offline..." % path
+print("Setting modem %s offline..." % path)
modem = dbus.Interface(bus.get_object('org.ofono', path), 'org.ofono.Modem')
modem.SetProperty("Online", dbus.Boolean(0))
diff --git a/test/online-modem b/test/online-modem
index f37b046..bd10b50 100755
--- a/test/online-modem
+++ b/test/online-modem
@@ -12,6 +12,6 @@ else:
modems = manager.GetModems()
path = modems[0][0]
-print "Setting modem %s online..." % path
+print("Setting modem %s online..." % path)
modem = dbus.Interface(bus.get_object('org.ofono', path), 'org.ofono.Modem')
modem.SetProperty("Online", dbus.Boolean(1))
diff --git a/test/private-chat b/test/private-chat
index 4938a25..a9edfb6 100755
--- a/test/private-chat
+++ b/test/private-chat
@@ -17,4 +17,4 @@ manager = dbus.Interface(bus.get_object('org.ofono', path),
mpty = manager.PrivateChat(sys.argv[1])
for path in mpty:
- print path
+ print(path)
diff --git a/test/process-context-settings b/test/process-context-settings
index 09635b3..a0c582d 100755
--- a/test/process-context-settings
+++ b/test/process-context-settings
@@ -23,7 +23,7 @@ for path, properties in modems:
if properties["Active"] == dbus.Boolean(0):
continue
- print "Configuring %s" % (path)
+ print("Configuring %s" % (path))
settings = properties["Settings"]
@@ -35,20 +35,20 @@ for path, properties in modems:
gateway = "0.0.0.0";
if settings["Method"] == "dhcp":
- print " Run DHCP on interface %s" % (interface)
+ print(" Run DHCP on interface %s" % (interface))
else:
- print " Interface is %s" % (interface)
- print " IP address is %s" % (address)
- print " Gateway is %s" % (gateway)
+ print(" Interface is %s" % (interface))
+ print(" IP address is %s" % (address))
+ print(" Gateway is %s" % (gateway))
cmd = "ifconfig " + interface + " " + address
cmd += " netmask 255.255.255.255"
os.system(cmd);
for i in settings["DomainNameServers"]:
- print " Nameserver is %s" % (i)
+ print(" Nameserver is %s" % (i))
cmd = "route add -host " + i
cmd +=" dev " + interface
os.system(cmd);
- print
+ print()
diff --git a/test/receive-sms b/test/receive-sms
index a658c58..b40ce3c 100755
--- a/test/receive-sms
+++ b/test/receive-sms
@@ -6,11 +6,11 @@ import dbus
import dbus.mainloop.glib
def incoming_message(message, details, path, interface):
- print "%s" % (message)
+ print("%s" % (message))
for key in details:
val = details[key]
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
diff --git a/test/remove-contexts b/test/remove-contexts
index a600d0b..c5082cb 100755
--- a/test/remove-contexts
+++ b/test/remove-contexts
@@ -20,4 +20,4 @@ for path, properties in modems:
for path, properties in contexts:
connman.RemoveContext(path)
- print"Removed: [ %s ]" % (path)
+ print("Removed: [ %s ]" % (path))
diff --git a/test/reset-pin b/test/reset-pin
index d0145fe..b429254 100755
--- a/test/reset-pin
+++ b/test/reset-pin
@@ -14,9 +14,9 @@ elif len(sys.argv) == 4:
path = modems[0][0]
puk_type, puk, pin = sys.argv[1:]
else:
- print "%s [PATH] puk_type puk pin" % (sys.argv[0])
+ print("%s [PATH] puk_type puk pin" % (sys.argv[0]))
-print "Reset pin for modem %s..." % path
+print("Reset pin for modem %s..." % path)
simmanager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.SimManager')
diff --git a/test/scan-for-operators b/test/scan-for-operators
index 285f111..5c1af10 100755
--- a/test/scan-for-operators
+++ b/test/scan-for-operators
@@ -13,7 +13,7 @@ else:
modems = manager.GetModems()
path = modems[0][0]
-print "Propose scanning for modem %s..." % path
+print("Propose scanning for modem %s..." % path)
netreg = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.NetworkRegistration')
@@ -23,16 +23,16 @@ for entry in operators:
path = entry[0]
properties = entry[1]
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["Technologies"]:
val = ""
for i in properties[key]:
val += i + " "
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
- print
+ print()
diff --git a/test/send-sms b/test/send-sms
index bd1fae5..00b130e 100755
--- a/test/send-sms
+++ b/test/send-sms
@@ -21,4 +21,4 @@ if len(sys.argv) == 4:
else:
path = manager.SendMessage(sys.argv[1], sys.argv[2])
-print path
+print(path)
diff --git a/test/send-vcard b/test/send-vcard
index d11d5ac..2f54a0c 100755
--- a/test/send-vcard
+++ b/test/send-vcard
@@ -17,4 +17,4 @@ manager = dbus.Interface(bus.get_object('org.ofono', path),
vcard = file(sys.argv[2]).read()
path = manager.SendBusinessCard(sys.argv[1], vcard)
-print path
+print(path)
diff --git a/test/set-cbs-topics b/test/set-cbs-topics
index fbf7aa4..78d6d44 100755
--- a/test/set-cbs-topics
+++ b/test/set-cbs-topics
@@ -15,9 +15,9 @@ elif len(sys.argv) == 2:
path = modems[0][0]
topics = sys.argv[1]
else:
- print "%s [PATH] topics" % (sys.argv[0])
+ print("%s [PATH] topics" % (sys.argv[0]))
-print "Setting cell broadcast topics for modem %s..." % path
+print("Setting cell broadcast topics for modem %s..." % path)
cbs = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.CellBroadcast')
diff --git a/test/set-fast-dormancy b/test/set-fast-dormancy
index 6951813..7bf7715 100755
--- a/test/set-fast-dormancy
+++ b/test/set-fast-dormancy
@@ -15,10 +15,10 @@ elif len(sys.argv) == 2:
path = modems[0][0]
enable = int(sys.argv[1])
else:
- print "%s [PATH] {0|1}" % (sys.argv[0])
+ print("%s [PATH] {0|1}" % (sys.argv[0]))
exit(1)
-print "Setting fast dormancy for modem %s..." % path
+print("Setting fast dormancy for modem %s..." % path)
radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.RadioSettings')
diff --git a/test/set-mms-details b/test/set-mms-details
index 7540948..d2d0838 100755
--- a/test/set-mms-details
+++ b/test/set-mms-details
@@ -26,18 +26,18 @@ for path, properties in modems:
break
if path == "":
- print "No MMS context"
+ print("No MMS context")
exit(1)
context = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.ConnectionContext')
if len(sys.argv) < 3:
- print "Usage: %s <proxy> <center>" % (sys.argv[0])
+ print("Usage: %s <proxy> <center>" % (sys.argv[0]))
exit(1)
context.SetProperty("MessageProxy", sys.argv[1])
- print "Setting MMS Proxy to %s" % (sys.argv[1])
+ print("Setting MMS Proxy to %s" % (sys.argv[1]))
context.SetProperty("MessageCenter", sys.argv[2])
- print "Setting MMSC to %s" % (sys.argv[2])
+ print("Setting MMSC to %s" % (sys.argv[2]))
diff --git a/test/set-roaming-allowed b/test/set-roaming-allowed
index f7f9c9d..9e3e058 100755
--- a/test/set-roaming-allowed
+++ b/test/set-roaming-allowed
@@ -24,4 +24,4 @@ for path, properties in modems:
connman.SetProperty("RoamingAllowed", allowed)
- print "Setting %s to RoamingAllowed=%d" % (path, allowed)
+ print("Setting %s to RoamingAllowed=%d" % (path, allowed))
diff --git a/test/set-tech-preference b/test/set-tech-preference
index cc735ce..2666cbd 100755
--- a/test/set-tech-preference
+++ b/test/set-tech-preference
@@ -15,9 +15,9 @@ elif len(sys.argv) == 2:
path = modems[0][0]
tech = sys.argv[1]
else:
- print "%s [PATH] technology" % (sys.argv[0])
+ print("%s [PATH] technology" % (sys.argv[0]))
-print "Setting technology preference for modem %s..." % path
+print("Setting technology preference for modem %s..." % path)
radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.RadioSettings')
diff --git a/test/set-tty b/test/set-tty
index 67876af..53d6b99 100755
--- a/test/set-tty
+++ b/test/set-tty
@@ -15,10 +15,10 @@ elif len(sys.argv) == 2:
path = modems[0][0]
enable = int(sys.argv[1])
else:
- print "%s [PATH] {0|1}" % (sys.argv[0])
+ print("%s [PATH] {0|1}" % (sys.argv[0]))
exit(1)
-print "Setting TTY for modem %s..." % path
+print("Setting TTY for modem %s..." % path)
texttelephony = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.TextTelephony')
diff --git a/test/set-use-sms-reports b/test/set-use-sms-reports
index 1188197..f1aa87e 100755
--- a/test/set-use-sms-reports
+++ b/test/set-use-sms-reports
@@ -15,10 +15,10 @@ elif len(sys.argv) == 2:
path = modems[0][0]
enabled = sys.argv[1]
else:
- print "%s [PATH] on/off" % (sys.argv[0])
+ print("%s [PATH] on/off" % (sys.argv[0]))
sys.exit(1)
-print "Setting delivery report use for modem %s..." % path
+print("Setting delivery report use for modem %s..." % path)
sms = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.MessageManager')
diff --git a/test/test-advice-of-charge b/test/test-advice-of-charge
index d71b7c6..07af425 100755
--- a/test/test-advice-of-charge
+++ b/test/test-advice-of-charge
@@ -7,16 +7,16 @@ import dbus.mainloop.glib
def cm_property_changed(name, value):
- print "CallMeter property: '%s' changed to '%s'" % (name, str(value))
+ print("CallMeter property: '%s' changed to '%s'" % (name, str(value)))
if canexit:
mainloop.quit()
def cm_maximum_reached():
- print "Only 30 seconds call time remains, recharge."
+ print("Only 30 seconds call time remains, recharge.")
def print_useage(s):
- print "Usage: %s <property> <newvalue> <password>" % (s)
- print "Usage: %s reset <password>" % (s)
+ print("Usage: %s <property> <newvalue> <password>" % (s))
+ print("Usage: %s reset <password>" % (s))
sys.exit(1);
if __name__ == "__main__":
@@ -51,24 +51,24 @@ if __name__ == "__main__":
properties = cm.GetProperties()
- print "Currency: %s" % (properties['Currency'])
- print "PricePerUnit %s" % (properties['PricePerUnit'])
- print "Call meter for the current call: %s" % (properties['CallMeter'])
- print "Call meter for current and previous calls: %s" %\
- properties['AccumulatedCallMeter']
- print "Call meter maximum, once reached calls are not possible: %s" %\
- properties['AccumulatedCallMeterMaximum']
+ print("Currency: %s" % (properties['Currency']))
+ print("PricePerUnit %s" % (properties['PricePerUnit']))
+ print("Call meter for the current call: %s" % (properties['CallMeter']))
+ print("Call meter for current and previous calls: %s" %\
+ properties['AccumulatedCallMeter'])
+ print("Call meter maximum, once reached calls are not possible: %s" %\
+ properties['AccumulatedCallMeterMaximum'])
total = properties['PricePerUnit'] * properties['AccumulatedCallMeter']
- print "Accumulated Meter in Currency: %s %s" %\
- (total, properties['Currency'])
+ print("Accumulated Meter in Currency: %s %s" %\
+ (total, properties['Currency']))
if (sys.argv[1] == 'reset'):
- print "Resetting Accumulated Call Meter"
+ print("Resetting Accumulated Call Meter")
try:
cm.Reset(pin)
- except dbus.DBusException, e:
- print "Unable to reset ACM: ", e
+ except dbus.DBusException as e:
+ print("Unable to reset ACM: ", e)
sys.exit(1)
else:
try:
@@ -77,8 +77,8 @@ if __name__ == "__main__":
elif property == 'PricePerUnit':
newvalue = float(newvalue)
cm.SetProperty(property, newvalue, pin)
- except dbus.DBusException, e:
- print "Unable to set property: ", e
+ except dbus.DBusException as e:
+ print("Unable to set property: ", e)
sys.exit(1)
canexit = True
diff --git a/test/test-call-barring b/test/test-call-barring
index 5385a10..ad5841a 100755
--- a/test/test-call-barring
+++ b/test/test-call-barring
@@ -7,13 +7,13 @@ import dbus.mainloop.glib
def property_changed(name, value):
- print "CallBarring property: '%s' changed to '%s'" % (name, str(value))
+ print("CallBarring property: '%s' changed to '%s'" % (name, str(value)))
if canexit:
mainloop.quit()
def print_useage(s):
- print "Usage: %s <property> <newvalue> <password>" % (s)
- print "Usage: %s disableall <password>" % (s)
+ print("Usage: %s <property> <newvalue> <password>" % (s))
+ print("Usage: %s disableall <password>" % (s))
sys.exit(1);
if __name__ == "__main__":
@@ -47,23 +47,23 @@ if __name__ == "__main__":
properties = cb.GetProperties()
- print "Barring settings for Incoming Voice calls: %s" %\
- (properties['VoiceIncoming'])
- print "Barring settings for Outgoing Calls: %s" %\
- (properties['VoiceOutgoing'])
+ print("Barring settings for Incoming Voice calls: %s" %\
+ (properties['VoiceIncoming']))
+ print("Barring settings for Outgoing Calls: %s" %\
+ (properties['VoiceOutgoing']))
if (sys.argv[1] == 'disableall'):
- print "Disabling all barrings"
+ print("Disabling all barrings")
try:
cb.DisableAll(pin)
- except dbus.DBusException, e:
- print "Unable to Disable All barrings: ", e
+ except dbus.DBusException as e:
+ print("Unable to Disable All barrings: ", e)
sys.exit(1)
else:
try:
cb.SetProperty(property, newvalue, pin)
- except dbus.DBusException, e:
- print "Unable to set property: ", e
+ except dbus.DBusException as e:
+ print("Unable to set property: ", e)
sys.exit(1)
canexit = True
diff --git a/test/test-call-forwarding b/test/test-call-forwarding
index 85aca23..a7ec1e4 100755
--- a/test/test-call-forwarding
+++ b/test/test-call-forwarding
@@ -6,16 +6,16 @@ import dbus
import dbus.mainloop.glib
def property_changed(property, value):
- print "CallForwarding property %s changed to %s" % (property, value)
+ print("CallForwarding property %s changed to %s" % (property, value))
def print_properties(cf):
properties = cf.GetProperties()
for p in properties:
if len(properties[p].__str__()) > 0:
- print "%s call forwarding rule is: %s" % (p, properties[p])
+ print("%s call forwarding rule is: %s" % (p, properties[p]))
else:
- print "%s call forwarding rule disabled" % (p)
+ print("%s call forwarding rule disabled" % (p))
if __name__ == "__main__":
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -36,84 +36,84 @@ if __name__ == "__main__":
try:
cf.SetProperty("FoobarNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
- print "Unable to set timeout - Good"
+ except dbus.DBusException as e:
+ print("Unable to set timeout - Good")
try:
cf.SetProperty("VoiceNotReachableTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
- print "Unable to set timeout - Good"
+ except dbus.DBusException as e:
+ print("Unable to set timeout - Good")
try:
cf.SetProperty("VoiceNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
- print "Unable to set timeout - Good"
+ except dbus.DBusException as e:
+ print("Unable to set timeout - Good")
try:
cf.SetProperty("DataNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
- print "Unable to set timeout - Good"
+ except dbus.DBusException as e:
+ print("Unable to set timeout - Good")
try:
cf.SetProperty("FaxNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
- print "Unable to set timeout - Good"
+ except dbus.DBusException as e:
+ print("Unable to set timeout - Good")
try:
cf.SetProperty("SmsNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
- print "Unable to set timeout - Good"
+ except dbus.DBusException as e:
+ print("Unable to set timeout - Good")
try:
cf.SetProperty("VoiceNoReply", "")
- except dbus.DBusException, e:
- print "Unable to erase voice no reply rule - Bad"
+ except dbus.DBusException as e:
+ print("Unable to erase voice no reply rule - Bad")
try:
cf.SetProperty("VoiceNoReply", "+134444")
- except dbus.DBusException, e:
- print "Unable to register voice no reply rule - Bad"
+ except dbus.DBusException as e:
+ print("Unable to register voice no reply rule - Bad")
try:
cf.SetProperty("VoiceNoReplyTimeout", dbus.UInt16(30))
- except dbus.DBusException, e:
- print "Unable to set voice no reply timeout - Bad"
+ except dbus.DBusException as e:
+ print("Unable to set voice no reply timeout - Bad")
properties = cf.GetProperties()
- print properties["VoiceNoReply"]
- print properties["VoiceNoReplyTimeout"]
+ print(properties["VoiceNoReply"])
+ print(properties["VoiceNoReplyTimeout"])
try:
cf.SetProperty("VoiceUnconditional", "+155555")
- except dbus.DBusException, e:
- print "Unable to set Voice Unconditional - Bad"
+ except dbus.DBusException as e:
+ print("Unable to set Voice Unconditional - Bad")
properties = cf.GetProperties()
- print properties["VoiceUnconditional"]
+ print(properties["VoiceUnconditional"])
try:
cf.DisableAll("foobar")
- except dbus.DBusException, e:
- print "Unable to delete invalids - Good"
+ except dbus.DBusException as e:
+ print("Unable to delete invalids - Good")
try:
cf.DisableAll("conditional")
- except dbus.DBusException, e:
- print "Unable to delete all conditional - Bad"
+ except dbus.DBusException as e:
+ print("Unable to delete all conditional - Bad")
properties = cf.GetProperties()
- print properties["VoiceNoReply"]
- print properties["VoiceNoReplyTimeout"]
+ print(properties["VoiceNoReply"])
+ print(properties["VoiceNoReplyTimeout"])
try:
cf.DisableAll("all")
- except dbus.DBusException, e:
- print "Unable to delete all conditional - Bad"
+ except dbus.DBusException as e:
+ print("Unable to delete all conditional - Bad")
- print properties["VoiceUnconditional"]
+ print(properties["VoiceUnconditional"])
mainloop = gobject.MainLoop()
mainloop.run()
diff --git a/test/test-call-settings b/test/test-call-settings
index 60fe3ba..0d5fb8c 100755
--- a/test/test-call-settings
+++ b/test/test-call-settings
@@ -7,15 +7,15 @@ import dbus.mainloop.glib
import sys
def property_changed(name, value):
- print "CallSettings property: '%s' changed to '%s'" % (name, value)
+ print("CallSettings property: '%s' changed to '%s'" % (name, value))
if canexit:
mainloop.quit();
if __name__ == "__main__":
if len(sys.argv) < 3:
- print "Usage: %s <property> <newvalue>" % (sys.argv[0])
- print "Properties can be: VoiceCallWaiting, HideCallerId"
+ print("Usage: %s <property> <newvalue>" % (sys.argv[0]))
+ print("Properties can be: VoiceCallWaiting, HideCallerId")
sys.exit(1)
canexit = False
@@ -39,26 +39,26 @@ if __name__ == "__main__":
properties = cs.GetProperties()
- print "Current Property values:"
- print "Network Status of Call Waiting - Voice: %s" %\
- (properties['VoiceCallWaiting'])
- print "Network Status of Called Line Restriction: %s" %\
- (properties['CalledLineRestriction'])
- print "Network Status of Calling Line Restriction: %s" %\
- (properties['CallingLineRestriction'])
- print "Network Status of Calling Line Presentation: %s" %\
- (properties['CallingLinePresentation'])
- print "Network Status of Called Line Presentation: %s" %\
- (properties['CalledLinePresentation'])
- print "Hide my Caller Id: %s" % (properties['HideCallerId'])
+ print("Current Property values:")
+ print("Network Status of Call Waiting - Voice: %s" %\
+ (properties['VoiceCallWaiting']))
+ print("Network Status of Called Line Restriction: %s" %\
+ (properties['CalledLineRestriction']))
+ print("Network Status of Calling Line Restriction: %s" %\
+ (properties['CallingLineRestriction']))
+ print("Network Status of Calling Line Presentation: %s" %\
+ (properties['CallingLinePresentation']))
+ print("Network Status of Called Line Presentation: %s" %\
+ (properties['CalledLinePresentation']))
+ print("Hide my Caller Id: %s" % (properties['HideCallerId']))
try:
cs.SetProperty(property, newvalue)
- except dbus.DBusException, e:
- print "Unable to set property: ", e
+ except dbus.DBusException as e:
+ print("Unable to set property: ", e)
sys.exit(1);
- print "Setting successful"
+ print("Setting successful")
canexit = True
diff --git a/test/test-modem b/test/test-modem
index 5859ae3..e045f34 100755
--- a/test/test-modem
+++ b/test/test-modem
@@ -6,7 +6,7 @@ import dbus
import dbus.mainloop.glib
def property_changed(name, value):
- print "Modem property %s changed to %s" % (name, value)
+ print("Modem property %s changed to %s" % (name, value))
if __name__ == "__main__":
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -24,17 +24,17 @@ if __name__ == "__main__":
properties = modem.GetProperties()
- if properties.has_key('Manufacturer'):
- print "Manufacturer: %s" % (properties['Manufacturer'])
+ if 'Manufacturer' in properties:
+ print("Manufacturer: %s" % (properties['Manufacturer']))
- if properties.has_key('Model'):
- print "Model: %s" % (properties['Model'])
+ if 'Model' in properties:
+ print("Model: %s" % (properties['Model']))
- if properties.has_key('Revision'):
- print "Revision: %s" % (properties['Revision'])
+ if 'Revision' in properties:
+ print("Revision: %s" % (properties['Revision']))
- if properties.has_key('Serial'):
- print "Serial: %s" % (properties['Serial'])
+ if 'Serial' in properties:
+ print("Serial: %s" % (properties['Serial']))
mainloop = gobject.MainLoop()
mainloop.run()
diff --git a/test/test-network-registration b/test/test-network-registration
index a8bd141..8cfd2d8 100755
--- a/test/test-network-registration
+++ b/test/test-network-registration
@@ -6,20 +6,20 @@ import dbus
import dbus.mainloop.glib
def network_property_changed(name, value):
- print "Network Registration property '%s' changed to '%s'" %\
- (name, value)
+ print("Network Registration property '%s' changed to '%s'" %\
+ (name, value))
if name == 'Name' and canexit:
mainloop.quit()
if __name__ == "__main__":
if len(sys.argv) != 2:
- print "Usage: %s <path> - Register to PLMN on <path>" %\
- (sys.argv[0])
- print "Usage: %s default - Register to default PLMN" %\
- (sys.argv[0])
- print "Usage: %s unregister - Unregister from all PLMNs" %\
- (sys.argv[0])
+ print("Usage: %s <path> - Register to PLMN on <path>" %\
+ (sys.argv[0]))
+ print("Usage: %s default - Register to default PLMN" %\
+ (sys.argv[0]))
+ print("Usage: %s unregister - Unregister from all PLMNs" %\
+ (sys.argv[0]))
sys.exit(1)
canexit = False
@@ -40,15 +40,15 @@ if __name__ == "__main__":
props = netreg.GetProperties()
- print "Status is: '%s', Operator Name is: '%s'" %\
- (props['Status'], props['Name'])
+ print("Status is: '%s', Operator Name is: '%s'" %\
+ (props['Status'], props['Name']))
- if props.has_key('LocationAreaCode') and props.has_key('CellId'):
- print "Location: '%d', Cell: '%d'" %\
- (props['LocationAreaCode'], props['CellId'])
+ if 'LocationAreaCode' in props and 'CellId' in props:
+ print("Location: '%d', Cell: '%d'" %\
+ (props['LocationAreaCode'], props['CellId']))
- if props.has_key('Technology'):
- print "Technology: '%s'" % (props['Technology'])
+ if 'Technology' in props:
+ print("Technology: '%s'" % (props['Technology']))
try:
if sys.argv[1] == 'default':
@@ -59,8 +59,8 @@ if __name__ == "__main__":
obj = bus.get_object('org.ofono', sys.argv[1]);
op = dbus.Interface(obj, 'org.ofono.NetworkOperator')
op.Register()
- except dbus.DBusException, e:
- print "Unable to register/deregister: ", e
+ except dbus.DBusException as e:
+ print("Unable to register/deregister: ", e)
sys.exit(1)
canexit = True
diff --git a/test/test-phonebook b/test/test-phonebook
index 183394c..fa42b60 100755
--- a/test/test-phonebook
+++ b/test/test-phonebook
@@ -12,4 +12,4 @@ if __name__ == "__main__":
phonebook = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.Phonebook')
- print phonebook.Import(timeout=100)
+ print(phonebook.Import(timeout=100))
diff --git a/test/test-push-notification b/test/test-push-notification
index 4dca0d4..9c3b837 100755
--- a/test/test-push-notification
+++ b/test/test-push-notification
@@ -11,16 +11,16 @@ class PushNotificationAgent(dbus.service.Object):
@dbus.service.method("org.ofono.PushNotificationAgent",
in_signature="", out_signature="")
def Release(self):
- print "Release"
+ print("Release")
mainloop.quit()
@dbus.service.method("org.ofono.PushNotificationAgent",
in_signature="aya{sv}", out_signature="")
def ReceiveNotification(self, data, props):
- for key in props.keys():
- print "Key: %s, Value: %s" % (key, props[key])
+ for key in list(props.keys()):
+ print("Key: %s, Value: %s" % (key, props[key]))
- print "Received notification of size: %d" % len(data)
+ print("Received notification of size: %d" % len(data))
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -41,7 +41,7 @@ if __name__ == '__main__':
path = "/test/agent"
agent = PushNotificationAgent(bus, path)
pn.RegisterAgent(path)
- print "Agent registered"
+ print("Agent registered")
mainloop = gobject.MainLoop()
mainloop.run()
diff --git a/test/test-smart-messaging b/test/test-smart-messaging
index b263edd..6d25a1e 100755
--- a/test/test-smart-messaging
+++ b/test/test-smart-messaging
@@ -11,34 +11,34 @@ class SmartMessagingAgent(dbus.service.Object):
@dbus.service.method("org.ofono.SmartMessagingAgent",
in_signature="", out_signature="")
def Release(self):
- print "Release"
+ print("Release")
mainloop.quit()
@dbus.service.method("org.ofono.SmartMessagingAgent",
in_signature="aya{sv}", out_signature="")
def ReceiveBusinessCard(self, data, props):
- for key in props.keys():
- print "Key: %s, Value: %s" % (key, props[key])
+ for key in list(props.keys()):
+ print("Key: %s, Value: %s" % (key, props[key]))
string = ""
for byte in data:
string += str(byte)
- print "Received Business Card:"
- print string
+ print("Received Business Card:")
+ print(string)
@dbus.service.method("org.ofono.SmartMessagingAgent",
in_signature="aya{sv}", out_signature="")
def ReceiveAppointment(self, data, props):
- for key in props.keys():
- print "Key: %s, Value: %s" % (key, props[key])
+ for key in list(props.keys()):
+ print("Key: %s, Value: %s" % (key, props[key]))
string = ""
for byte in data:
string += str(byte)
- print "Received Appointment:"
- print string
+ print("Received Appointment:")
+ print(string)
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -59,7 +59,7 @@ if __name__ == '__main__':
path = "/test/agent"
agent = SmartMessagingAgent(bus, path)
pn.RegisterAgent(path)
- print "Agent registered"
+ print("Agent registered")
mainloop = gobject.MainLoop()
mainloop.run()
diff --git a/test/test-ss-control-cb b/test/test-ss-control-cb
index f855635..d972097 100755
--- a/test/test-ss-control-cb
+++ b/test/test-ss-control-cb
@@ -6,13 +6,13 @@ import dbus
import dbus.mainloop.glib
def property_changed(property, value):
- print "CallBarring property %s changed to %s" % (property, value)
+ print("CallBarring property %s changed to %s" % (property, value))
def print_properties(cb):
properties = cb.GetProperties()
for p in properties:
- print "property %s, value: %s" % (p, properties[p])
+ print("property %s, value: %s" % (p, properties[p]))
if __name__ == "__main__":
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -34,61 +34,61 @@ if __name__ == "__main__":
print_properties(cb)
- print "Trying invalid SS request for CB"
+ print("Trying invalid SS request for CB")
try:
- print ss.Initiate("*33#456666")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*33#456666"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Trying invalid SS request for CB"
+ print("Trying invalid SS request for CB")
try:
- print ss.Initiate("*33*ABC#")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*33*ABC#"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Trying invalid SS request for CB"
+ print("Trying invalid SS request for CB")
try:
- print ss.Initiate("*33**ABC#")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*33**ABC#"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Trying invalid SS request for CB"
+ print("Trying invalid SS request for CB")
try:
- print ss.Initiate("*33***12#")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*33***12#"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Query Outgoing All"
- print ss.Initiate("*#33#")
+ print("Query Outgoing All")
+ print(ss.Initiate("*#33#"))
- print "Query Outgoing International"
- print ss.Initiate("*#331#")
+ print("Query Outgoing International")
+ print(ss.Initiate("*#331#"))
- print "Query Outgoing except home country"
- print ss.Initiate("*#332#")
+ print("Query Outgoing except home country")
+ print(ss.Initiate("*#332#"))
- print "Query Incoming All"
- print ss.Initiate("*#35#")
+ print("Query Incoming All")
+ print(ss.Initiate("*#35#"))
- print "Query Incoming while Roaming"
- print ss.Initiate("*#351#")
+ print("Query Incoming while Roaming")
+ print(ss.Initiate("*#351#"))
- print "Query All Outgoing"
- print ss.Initiate("*#333#")
+ print("Query All Outgoing")
+ print(ss.Initiate("*#333#"))
- print "Query All Incoming"
- print ss.Initiate("*#353#")
+ print("Query All Incoming")
+ print(ss.Initiate("*#353#"))
- print "Query All"
- print ss.Initiate("*#330#")
+ print("Query All")
+ print(ss.Initiate("*#330#"))
- print "Enable Barring for Outgoing International calls for Voice"
- print ss.Initiate("*33*3579*11#")
+ print("Enable Barring for Outgoing International calls for Voice")
+ print(ss.Initiate("*33*3579*11#"))
print_properties(cb)
- print "Disable All Barrings"
- print ss.Initiate("#330*3579#")
+ print("Disable All Barrings")
+ print(ss.Initiate("#330*3579#"))
mainloop = gobject.MainLoop()
mainloop.run()
diff --git a/test/test-ss-control-cf b/test/test-ss-control-cf
index 6391bdd..1ba9512 100755
--- a/test/test-ss-control-cf
+++ b/test/test-ss-control-cf
@@ -6,7 +6,7 @@ import dbus
import dbus.mainloop.glib
def property_changed(property, value):
- print "CallForwarding property %s changed to %s" % (property, value)
+ print("CallForwarding property %s changed to %s" % (property, value))
def print_properties(cf):
properties = cf.GetProperties()
@@ -17,7 +17,7 @@ def print_properties(cf):
else:
value = "disabled"
- print "%s call forwarding rule: %s" % (p, value)
+ print("%s call forwarding rule: %s" % (p, value))
if __name__ == "__main__":
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -42,33 +42,33 @@ if __name__ == "__main__":
print_properties(cf)
# Busy To +155542, for Voice
- print "Setting Busy Voice rule to +155542"
- print ss.Initiate("*67*+155542*11#")
+ print("Setting Busy Voice rule to +155542")
+ print(ss.Initiate("*67*+155542*11#"))
print_properties(cf)
# Not Reachable to +155543, Voice
- print "Setting Voice Not Reachable rule to +155543"
- print ss.Initiate("**62*+155543*11#")
+ print("Setting Voice Not Reachable rule to +155543")
+ print(ss.Initiate("**62*+155543*11#"))
# Not Reachable to +155544, Voice service
- print "Setting Voice No Reply rule to +155544, timeout=30"
- print ss.Initiate("**61*+155544*11*30#")
+ print("Setting Voice No Reply rule to +155544, timeout=30")
+ print(ss.Initiate("**61*+155544*11*30#"))
# Unconditional to +155547, Voice
- print "Setting Unconditional for Voice to +155545"
- print ss.Initiate("*21*+155545*10#")
+ print("Setting Unconditional for Voice to +155545")
+ print(ss.Initiate("*21*+155545*10#"))
print_properties(cf)
- print "Query all voice forwardings"
- print ss.Initiate("*#002**11#")
+ print("Query all voice forwardings")
+ print(ss.Initiate("*#002**11#"))
- print "Query no reply voice forwardings"
- print ss.Initiate("*#61**11#")
+ print("Query no reply voice forwardings")
+ print(ss.Initiate("*#61**11#"))
# Deactivate everything
- print "Deactivating everything"
- print ss.Initiate("##002#")
+ print("Deactivating everything")
+ print(ss.Initiate("##002#"))
print_properties(cf)
mainloop = gobject.MainLoop()
diff --git a/test/test-ss-control-cs b/test/test-ss-control-cs
index bf59789..e02d20f 100755
--- a/test/test-ss-control-cs
+++ b/test/test-ss-control-cs
@@ -6,13 +6,13 @@ import dbus
import dbus.mainloop.glib
def property_changed(property, value):
- print "CallSettings property %s changed to %s" % (property, value)
+ print("CallSettings property %s changed to %s" % (property, value))
def print_properties(cs):
properties = cs.GetProperties()
for p in properties:
- print "property %s, value: %s" % (p, properties[p])
+ print("property %s, value: %s" % (p, properties[p]))
if __name__ == "__main__":
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -34,77 +34,77 @@ if __name__ == "__main__":
print_properties(cs)
- print "Trying invalid SS request for CLIR"
+ print("Trying invalid SS request for CLIR")
try:
- print ss.Initiate("*31#456666")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*31#456666"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Trying invalid SS request for CLIR"
+ print("Trying invalid SS request for CLIR")
try:
- print ss.Initiate("*31*455*4#")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*31*455*4#"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Trying invalid SS request for CLIR"
+ print("Trying invalid SS request for CLIR")
try:
- print ss.Initiate("*31**44435#")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*31**44435#"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Query CLIP"
- print ss.Initiate("*#30#")
+ print("Query CLIP")
+ print(ss.Initiate("*#30#"))
- print "Query COLP"
- print ss.Initiate("*#76#")
+ print("Query COLP")
+ print(ss.Initiate("*#76#"))
- print "Query CLIR"
- print ss.Initiate("*#31#")
+ print("Query CLIR")
+ print(ss.Initiate("*#31#"))
- print "Activate CLIR"
- print ss.Initiate("*31#")
+ print("Activate CLIR")
+ print(ss.Initiate("*31#"))
print_properties(cs)
- print "Deactivate CLIR"
- print ss.Initiate("#31#")
+ print("Deactivate CLIR")
+ print(ss.Initiate("#31#"))
print_properties(cs)
- print "Trying invalid SS request for CW"
+ print("Trying invalid SS request for CW")
try:
- print ss.Initiate("*43#456666")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*43#456666"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Trying invalid SS request for CW"
+ print("Trying invalid SS request for CW")
try:
- print ss.Initiate("*43*455*4#")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*43*455*4#"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Trying invalid SS request for CW"
+ print("Trying invalid SS request for CW")
try:
- print ss.Initiate("*43**44435#")
- except dbus.DBusException, e:
- print "Failed with %s - Good" % e
+ print(ss.Initiate("*43**44435#"))
+ except dbus.DBusException as e:
+ print("Failed with %s - Good" % e)
- print "Query CW"
- print ss.Initiate("*#43#")
+ print("Query CW")
+ print(ss.Initiate("*#43#"))
- print "Query CW, only Voice"
- print ss.Initiate("*#43*11#")
+ print("Query CW, only Voice")
+ print(ss.Initiate("*#43*11#"))
- print "Query CW, only Fax"
- print ss.Initiate("*#43*13#")
+ print("Query CW, only Fax")
+ print(ss.Initiate("*#43*13#"))
- print "Disable CW for everything"
- print ss.Initiate("#43#");
+ print("Disable CW for everything")
+ print(ss.Initiate("#43#"));
print_properties(cs)
- print "Enable CW for Voice"
- print ss.Initiate("*43*11#")
+ print("Enable CW for Voice")
+ print(ss.Initiate("*43*11#"))
print_properties(cs)
diff --git a/test/test-stk-menu b/test/test-stk-menu
index 916a527..7108542 100755
--- a/test/test-stk-menu
+++ b/test/test-stk-menu
@@ -22,20 +22,20 @@ class StkAgent(dbus.service.Object):
@dbus.service.method("org.ofono.SimToolkitAgent",
in_signature="", out_signature="")
def Release(self):
- print "Release"
+ print("Release")
if self.exit_on_release:
mainloop.quit()
@dbus.service.method("org.ofono.SimToolkitAgent",
in_signature="sya(sy)n", out_signature="y")
def RequestSelection(self, title, icon, items, default):
- print "Title: (%s)" % (title)
+ print("Title: (%s)" % (title))
index = 0;
for item in items:
- print "%d. %s" % (index, item[0])
+ print("%d. %s" % (index, item[0]))
index += 1
- print "\nDefault: %d" % (default)
+ print("\nDefault: %d" % (default))
select = raw_input("Enter Selection (t, b):")
if select == 'b':
@@ -48,16 +48,16 @@ class StkAgent(dbus.service.Object):
@dbus.service.method("org.ofono.SimToolkitAgent",
in_signature="syb", out_signature="")
def DisplayText(self, title, icon, urgent):
- print "DisplayText (%s, %s)" % (title, urgent)
+ print("DisplayText (%s, %s)" % (title, urgent))
@dbus.service.method("org.ofono.SimToolkitAgent",
in_signature="sysyyb", out_signature="s")
def RequestInput(self, title, icon, default, min_chars, max_chars,
hide_typing):
- print "Title: (%s)" % (title)
- print "Default: (%s)" % (default)
- print "Enter characters, min: %d, max: %d:" % (min_chars,
- max_chars)
+ print("Title: (%s)" % (title))
+ print("Default: (%s)" % (default))
+ print("Enter characters, min: %d, max: %d:" % (min_chars,
+ max_chars))
userin = raw_input("");
return userin
@@ -66,10 +66,10 @@ class StkAgent(dbus.service.Object):
in_signature="sysyyb", out_signature="s")
def RequestDigits(self, title, icon, default, min_chars, max_chars,
hide_typing):
- print "Title: (%s)" % (title)
- print "Default: (%s)" % (default)
- print "Enter digits, min: %d, max: %d:" % (min_chars,
- max_chars)
+ print("Title: (%s)" % (title))
+ print("Default: (%s)" % (default))
+ print("Enter digits, min: %d, max: %d:" % (min_chars,
+ max_chars))
userin = raw_input("'t' terminates, 'b' goes back:");
if userin == 'b':
@@ -82,7 +82,7 @@ class StkAgent(dbus.service.Object):
@dbus.service.method("org.ofono.SimToolkitAgent",
in_signature="sy", out_signature="s")
def RequestKey(self, title, icon):
- print "Title: (%s)" % (title)
+ print("Title: (%s)" % (title))
key = raw_input("Enter Key (t, b):")
if key == 'b':
@@ -95,7 +95,7 @@ class StkAgent(dbus.service.Object):
@dbus.service.method("org.ofono.SimToolkitAgent",
in_signature="sy", out_signature="s")
def RequestDigit(self, title, icon):
- print "Title: (%s)" % (title)
+ print("Title: (%s)" % (title))
key = raw_input("Enter Digit (t, b):")
if key == 'b':
@@ -108,7 +108,7 @@ class StkAgent(dbus.service.Object):
@dbus.service.method("org.ofono.SimToolkitAgent",
in_signature="sy", out_signature="b")
def RequestConfirmation(self, title, icon):
- print "Title: (%s)" % (title)
+ print("Title: (%s)" % (title))
key = raw_input("Enter Confirmation (t, b, y, n):")
if key == 'b':
@@ -123,7 +123,7 @@ class StkAgent(dbus.service.Object):
@dbus.service.method("org.ofono.SimToolkitAgent",
in_signature="sy", out_signature="b")
def ConfirmCallSetup(self, info, icon):
- print "Information: (%s)" % (info)
+ print("Information: (%s)" % (info))
key = raw_input("Enter Confirmation (t, y, n):")
if key == 't':
@@ -136,7 +136,7 @@ class StkAgent(dbus.service.Object):
@dbus.service.method("org.ofono.SimToolkitAgent",
in_signature="", out_signature="")
def Cancel(self):
- print "Cancel"
+ print("Cancel")
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -157,15 +157,15 @@ if __name__ == '__main__':
properties = stk.GetProperties()
if "MainMenuTitle" in properties:
- print "Main Menu:"
- print "%s" % (properties["MainMenuTitle"])
- print "\n"
+ print("Main Menu:")
+ print("%s" % (properties["MainMenuTitle"]))
+ print("\n")
if "MainMenu" in properties:
- print "Items:"
+ print("Items:")
index = 0
for item in properties["MainMenu"]:
- print "%d. %s" % (index, item[0])
+ print("%d. %s" % (index, item[0]))
index += 1
path = "/test/agent"
@@ -173,7 +173,7 @@ if __name__ == '__main__':
select = int(raw_input("Enter Selection: "))
stk.SelectItem(select, path)
- print "Agent registered for session"
+ print("Agent registered for session")
mainloop = gobject.MainLoop()
mainloop.run()
diff --git a/test/test-ussd b/test/test-ussd
index d4c1e27..d62cb62 100755
--- a/test/test-ussd
+++ b/test/test-ussd
@@ -10,17 +10,17 @@ import dbus.mainloop.glib
state = None
def ussd_notification_received(content):
- print("Network sent a Notification: " + content)
+ print(("Network sent a Notification: " + content))
def ussd_request_received(content):
- print("Network sent a Request: " + content)
+ print(("Network sent a Request: " + content))
ss.Cancel()
def ussd_property_changed(name, value):
global state
if name != "State":
return
- print("USSD session state is " + value)
+ print(("USSD session state is " + value))
state = str(value)
def stdin_handler(fd, condition):
@@ -28,16 +28,16 @@ def stdin_handler(fd, condition):
if not s:
ss.Cancel()
elif state == "user-response":
- print ss.Respond(s, timeout = 100)
+ print(ss.Respond(s, timeout = 100))
elif state == "idle":
- print ss.Initiate(s, timeout = 100)
+ print(ss.Initiate(s, timeout = 100))
else:
- print "Invalid state", state
+ print("Invalid state", state)
return True
if __name__ == "__main__":
if (len(sys.argv) < 2):
- print "Usage: %s <ussd-string>" % (sys.argv[0])
+ print("Usage: %s <ussd-string>" % (sys.argv[0]))
sys.exit(1)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -59,7 +59,7 @@ if __name__ == "__main__":
ss.connect_to_signal("RequestReceived", ussd_request_received)
ss.connect_to_signal("PropertyChanged", ussd_property_changed)
- print ss.Initiate(sys.argv[1], timeout=100)
+ print(ss.Initiate(sys.argv[1], timeout=100))
gobject.io_add_watch(sys.stdin, gobject.IO_IN, stdin_handler)
diff --git a/test/test-voicecall b/test/test-voicecall
index 3b0d432..beb80de 100755
--- a/test/test-voicecall
+++ b/test/test-voicecall
@@ -7,44 +7,44 @@ import dbus.mainloop.glib
import sys
def hangup_all():
- print "Hanging up"
+ print("Hanging up")
vcmanager.HangupAll()
def print_calls():
calls = vcmanager.GetCalls()
if (len(calls) != 0):
- print "No calls available"
+ print("No calls available")
else:
for path, properties in calls:
- print " [ %s ]" % (path)
+ print(" [ %s ]" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
val = str(properties[key])
- print " %s = %s" % (key, val)
- print
+ print(" %s = %s" % (key, val))
+ print()
def voicecalls_call_added(path, properties):
- print " Voice Call [ %s ] Added" % (path)
+ print(" Voice Call [ %s ] Added" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
val = str(properties[key])
- print " %s = %s" % (key, val)
- print
+ print(" %s = %s" % (key, val))
+ print()
def voicecalls_call_removed(path):
- print " Voice Call [ %s ] Removed" % (path)
+ print(" Voice Call [ %s ] Removed" % (path))
def voicecall_property_changed(name, value):
- print "Voicecall property: '%s' changed to '%s'" % (name, value)
+ print("Voicecall property: '%s' changed to '%s'" % (name, value))
def voicecall_disconnect_reason(reason):
- print "Voicecall disconnect reason: '%s'" % (reason)
+ print("Voicecall disconnect reason: '%s'" % (reason))
if __name__ == "__main__":
global vcmanager
if (len(sys.argv) < 2):
- print "Usage: %s [modem] <number>" % (sys.argv[0])
+ print("Usage: %s [modem] <number>" % (sys.argv[0]))
sys.exit(1)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -62,7 +62,7 @@ if __name__ == "__main__":
number = sys.argv[2]
else:
number = sys.argv[1]
- print "Using modem %s" % modem
+ print("Using modem %s" % modem)
vcmanager = dbus.Interface(bus.get_object('org.ofono', modem),
'org.ofono.VoiceCallManager')
@@ -73,17 +73,17 @@ if __name__ == "__main__":
print_calls()
- print "Dialing %s..." % number
+ print("Dialing %s..." % number)
obj = vcmanager.Dial(number, "")
- print "Dialing in progress, got obj: %s" % (obj)
+ print("Dialing in progress, got obj: %s" % (obj))
call = dbus.Interface(bus.get_object('org.ofono', obj),
'org.ofono.VoiceCall')
properties = call.GetProperties()
- print "State: %s, Number: %s" %\
- (properties['State'], properties['LineIdentification'])
+ print("State: %s, Number: %s" %\
+ (properties['State'], properties['LineIdentification']))
call.connect_to_signal("PropertyChanged", voicecall_property_changed)
call.connect_to_signal("DisconnectReason", voicecall_disconnect_reason)
diff --git a/test/unlock-pin b/test/unlock-pin
index d77841a..10b6626 100755
--- a/test/unlock-pin
+++ b/test/unlock-pin
@@ -17,10 +17,10 @@ elif len(sys.argv) == 3:
pin_type = sys.argv[1]
pin = sys.argv[2]
else:
- print "%s [PATH] pin_type pin" % (sys.argv[0])
+ print("%s [PATH] pin_type pin" % (sys.argv[0]))
sys.exit(0)
-print "Unlock %s %s for modem %s..." % (pin_type, pin, path)
+print("Unlock %s %s for modem %s..." % (pin_type, pin, path))
simmanager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.SimManager')
--
1.7.3.2
10 years, 4 months
[PATCH 1/2] huaweimodem: Add support for radio settings
by Lucas De Marchi
From: Marcel Holtmann <marcel.holtmann(a)intel.com>
---
Makefile.am | 3 +-
drivers/huaweimodem/huaweimodem.c | 2 +
drivers/huaweimodem/huaweimodem.h | 3 +
drivers/huaweimodem/radio-settings.c | 212 ++++++++++++++++++++++++++++++++++
4 files changed, 219 insertions(+), 1 deletions(-)
create mode 100644 drivers/huaweimodem/radio-settings.c
diff --git a/Makefile.am b/Makefile.am
index a4c47e8..5d39c23 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -180,7 +180,8 @@ builtin_sources += drivers/atmodem/atutil.h \
drivers/huaweimodem/huaweimodem.c \
drivers/huaweimodem/voicecall.c \
drivers/huaweimodem/audio-settings.c \
- drivers/huaweimodem/gprs-context.c
+ drivers/huaweimodem/gprs-context.c \
+ drivers/huaweimodem/radio-settings.c
builtin_modules += calypsomodem
builtin_sources += drivers/atmodem/atutil.h \
diff --git a/drivers/huaweimodem/huaweimodem.c b/drivers/huaweimodem/huaweimodem.c
index c8b6522..8097a9c 100644
--- a/drivers/huaweimodem/huaweimodem.c
+++ b/drivers/huaweimodem/huaweimodem.c
@@ -36,6 +36,7 @@ static int huaweimodem_init(void)
{
huawei_voicecall_init();
huawei_audio_settings_init();
+ huawei_radio_settings_init();
huawei_gprs_context_init();
return 0;
@@ -44,6 +45,7 @@ static int huaweimodem_init(void)
static void huaweimodem_exit(void)
{
huawei_gprs_context_exit();
+ huawei_radio_settings_exit();
huawei_audio_settings_exit();
huawei_voicecall_exit();
}
diff --git a/drivers/huaweimodem/huaweimodem.h b/drivers/huaweimodem/huaweimodem.h
index 03d52ef..596aa08 100644
--- a/drivers/huaweimodem/huaweimodem.h
+++ b/drivers/huaweimodem/huaweimodem.h
@@ -27,5 +27,8 @@ extern void huawei_voicecall_exit();
extern void huawei_audio_settings_init();
extern void huawei_audio_settings_exit();
+extern void huawei_radio_settings_init();
+extern void huawei_radio_settings_exit();
+
extern void huawei_gprs_context_init();
extern void huawei_gprs_context_exit();
diff --git a/drivers/huaweimodem/radio-settings.c b/drivers/huaweimodem/radio-settings.c
new file mode 100644
index 0000000..7f0b223
--- /dev/null
+++ b/drivers/huaweimodem/radio-settings.c
@@ -0,0 +1,212 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2010 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define _GNU_SOURCE
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include <glib.h>
+
+#include <ofono/log.h>
+#include <ofono/modem.h>
+#include <ofono/radio-settings.h>
+
+#include "gatchat.h"
+#include "gatresult.h"
+
+#include "huaweimodem.h"
+
+static const char *none_prefix[] = { NULL };
+static const char *xrat_prefix[] = { "^SYSCFG:", NULL };
+
+struct radio_settings_data {
+ GAtChat *chat;
+};
+
+static void xrat_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
+ enum ofono_radio_access_mode mode;
+ struct ofono_error error;
+ GAtResultIter iter;
+ int value;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok) {
+ cb(&error, -1, cbd->data);
+ return;
+ }
+
+ g_at_result_iter_init(&iter, result);
+
+ if (g_at_result_iter_next(&iter, "^SYSCFG:") == FALSE)
+ goto error;
+
+ if (g_at_result_iter_next_number(&iter, &value) == FALSE)
+ goto error;
+
+ switch (value) {
+ case 2:
+ mode = OFONO_RADIO_ACCESS_MODE_ANY;
+ break;
+ case 13:
+ mode = OFONO_RADIO_ACCESS_MODE_GSM;
+ break;
+ case 14:
+ mode = OFONO_RADIO_ACCESS_MODE_UMTS;
+ break;
+ default:
+ CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
+ return;
+ }
+
+ cb(&error, mode, cbd->data);
+
+ return;
+
+error:
+ CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
+}
+
+static void huawei_query_rat_mode(struct ofono_radio_settings *rs,
+ ofono_radio_settings_rat_mode_query_cb_t cb,
+ void *data)
+{
+ struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
+ struct cb_data *cbd = cb_data_new(cb, data);
+
+ if (g_at_chat_send(rsd->chat, "AT^SYSCFG?", xrat_prefix,
+ xrat_query_cb, cbd, g_free) == 0) {
+ CALLBACK_WITH_FAILURE(cb, -1, data);
+ g_free(cbd);
+ }
+}
+
+static void xrat_modify_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_radio_settings_rat_mode_set_cb_t cb = cbd->cb;
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+ cb(&error, cbd->data);
+}
+
+static void huawei_set_rat_mode(struct ofono_radio_settings *rs,
+ enum ofono_radio_access_mode mode,
+ ofono_radio_settings_rat_mode_set_cb_t cb,
+ void *data)
+{
+ struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
+ struct cb_data *cbd = cb_data_new(cb, data);
+ char buf[40];
+ int value = 2;
+
+ switch (mode) {
+ case OFONO_RADIO_ACCESS_MODE_ANY:
+ value = 2;
+ break;
+ case OFONO_RADIO_ACCESS_MODE_GSM:
+ value = 13;
+ break;
+ case OFONO_RADIO_ACCESS_MODE_UMTS:
+ value = 14;
+ break;
+ case OFONO_RADIO_ACCESS_MODE_LTE:
+ goto error;
+ }
+
+ snprintf(buf, sizeof(buf), "AT^SYSCFG=%u,0,3FFFFFFF,2,4", value);
+
+ if (g_at_chat_send(rsd->chat, buf, none_prefix,
+ xrat_modify_cb, cbd, g_free) > 0)
+ return;
+
+error:
+ CALLBACK_WITH_FAILURE(cb, data);
+ g_free(cbd);
+}
+
+static void xrat_support_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_radio_settings *rs = user_data;
+
+ if (!ok)
+ return;
+
+ ofono_radio_settings_register(rs);
+}
+
+static int huawei_radio_settings_probe(struct ofono_radio_settings *rs,
+ unsigned int vendor, void *data)
+{
+ GAtChat *chat = data;
+ struct radio_settings_data *rsd;
+
+ rsd = g_try_new0(struct radio_settings_data, 1);
+ if (rsd == NULL)
+ return -ENOMEM;
+
+ rsd->chat = g_at_chat_clone(chat);
+
+ ofono_radio_settings_set_data(rs, rsd);
+
+ g_at_chat_send(rsd->chat, "AT^SYSCFG=?", xrat_prefix,
+ xrat_support_cb, rs, NULL);
+
+ return 0;
+}
+
+static void huawei_radio_settings_remove(struct ofono_radio_settings *rs)
+{
+ struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
+
+ ofono_radio_settings_set_data(rs, NULL);
+
+ g_at_chat_unref(rsd->chat);
+ g_free(rsd);
+}
+
+static struct ofono_radio_settings_driver driver = {
+ .name = "huaweimodem",
+ .probe = huawei_radio_settings_probe,
+ .remove = huawei_radio_settings_remove,
+ .query_rat_mode = huawei_query_rat_mode,
+ .set_rat_mode = huawei_set_rat_mode
+};
+
+void huawei_radio_settings_init()
+{
+ ofono_radio_settings_driver_register(&driver);
+}
+
+void huawei_radio_settings_exit()
+{
+ ofono_radio_settings_driver_unregister(&driver);
+}
--
1.7.3.2
10 years, 4 months
RE: [RFC] AGPS Support
by Sjur BRENDELAND
Hi Bastian,
> Bastian, Waldo wrote:
>
> Please find attached a proposal for both a DBUS and Modem API for AGPS
> support. There are some minor changes compared to the proposal from
> May 14, 2010.
>
...
> void SendLCSFrame(string frametype, string framedata)
>
> Send a LCS position protocol frame to the Mobile
> Network. The LCS frame typically represents a
> Position Response.
>
> Valid frametypes are:
> rrlp_measure_position_response
> rrc_measurement_report
>
> The raw frame data is formatted as the concatenated
> sequence of the two digit hexadecimal representation
> of each of its octets. Example: "00FC2345"
....
> struct ofono_lcs_frame {
> enum ofono_lcs_frame_type lcs_frame_type;
> int frame_length; /* size of raw_frame in bytes */
> unsigned char* raw_frame;
> };
The 27.007 Spec specifies positioning request/responses for AT where
Positioning data are coded in XML data structures.
I think the oFono interface should not use binary data, but rather be aligned with 27.007
and present decoded data as DBUS typed signals and methods with the same information
content as specified in the XML data for AT+CPOS, AT+CPOSR.
In this way the vanilla AT driver could handle the CPOS, CPOR AT-commands
and code/decode between XML and explicit data structures, which in turn
oFono Core could code/decode as DBUS data types.
Regards,
Sjur Brændeland
10 years, 4 months
[PATCH] stk: Add busy error for the display text command
by Lucas, GuillaumeX
From: Guillaume Lucas <guillaumex.lucas(a)intel.com>
According to the sequence 1.2 of the ETSI TS 102 384 a busy
screen error should be returns for the display text proactive
command when the ME is not able to display the text.
---
doc/stk-api.txt | 1 +
src/stk.c | 15 +++++++++++++++
src/stkagent.c | 12 ++++++++++--
src/stkagent.h | 1 +
4 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/doc/stk-api.txt b/doc/stk-api.txt
index b9ca592..79daee6 100644
--- a/doc/stk-api.txt
+++ b/doc/stk-api.txt
@@ -116,6 +116,7 @@ Methods byte RequestSelection(string title, byte icon_id,
cleared prior to the display of this text.
Possible Errors: [service].Error.SimToolkit.GoBack
+ [service].Error.SimToolkit.Busy
Implementation notes:
diff --git a/src/stk.c b/src/stk.c
index a4abb7d..7b39f7e 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1203,6 +1203,9 @@ static void display_text_cb(enum stk_agent_result result, void *user_data)
{
struct ofono_stk *stk = user_data;
gboolean confirm;
+ struct stk_response rsp;
+ static unsigned char screen_busy_result[] = { 0x01 };
+ static struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
stk->respond_on_exit = FALSE;
@@ -1250,6 +1253,15 @@ static void display_text_cb(enum stk_agent_result result, void *user_data)
STK_RESULT_TYPE_NO_RESPONSE : STK_RESULT_TYPE_SUCCESS);
break;
+ case STK_AGENT_RESULT_BUSY:
+ memset(&rsp, 0, sizeof(rsp));
+ rsp.result.type = STK_RESULT_TYPE_TERMINAL_BUSY;
+ rsp.result.additional_len = sizeof(screen_busy_result);
+ rsp.result.additional = screen_busy_result;
+ if (stk_respond(stk, &rsp, stk_command_cb))
+ stk_command_cb(&error, stk);
+ break;
+
case STK_AGENT_RESULT_TERMINATE:
default:
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
@@ -1366,6 +1378,7 @@ static void request_confirmation_cb(enum stk_agent_result result,
break;
case STK_AGENT_RESULT_TERMINATE:
+ default:
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
break;
}
@@ -1408,6 +1421,7 @@ static void request_key_cb(enum stk_agent_result result, char *string,
break;
case STK_AGENT_RESULT_TERMINATE:
+ default:
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
break;
}
@@ -1505,6 +1519,7 @@ static void request_string_cb(enum stk_agent_result result, char *string,
break;
case STK_AGENT_RESULT_TERMINATE:
+ default:
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
break;
}
diff --git a/src/stkagent.c b/src/stkagent.c
index 8315040..874b6dd 100644
--- a/src/stkagent.c
+++ b/src/stkagent.c
@@ -41,6 +41,7 @@
enum allowed_error {
ALLOWED_ERROR_GO_BACK = 0x1,
ALLOWED_ERROR_TERMINATE = 0x2,
+ ALLOWED_ERROR_BUSY = 0x4,
};
struct stk_agent {
@@ -62,6 +63,7 @@ struct stk_agent {
#define ERROR_PREFIX OFONO_SERVICE ".Error"
#define GOBACK_ERROR ERROR_PREFIX ".GoBack"
#define TERMINATE_ERROR ERROR_PREFIX ".EndSession"
+#define BUSY_ERROR ERROR_PREFIX ".Busy"
static void stk_agent_send_noreply(struct stk_agent *agent, const char *method)
{
@@ -194,6 +196,12 @@ static int check_error(struct stk_agent *agent, DBusMessage *reply,
goto out;
}
+ if ((allowed_errors & ALLOWED_ERROR_BUSY) &&
+ g_str_equal(err.name, BUSY_ERROR)) {
+ *out_result = STK_AGENT_RESULT_BUSY;
+ goto out;
+ }
+
result = -EINVAL;
out:
@@ -376,8 +384,8 @@ static void display_text_cb(DBusPendingCall *call, void *data)
gboolean remove_agent;
if (check_error(agent, reply,
- ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
- &result) == -EINVAL) {
+ ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE |
+ ALLOWED_ERROR_BUSY, &result) == -EINVAL) {
remove_agent = TRUE;
goto error;
}
diff --git a/src/stkagent.h b/src/stkagent.h
index c8e1886..517bcfe 100644
--- a/src/stkagent.h
+++ b/src/stkagent.h
@@ -26,6 +26,7 @@ enum stk_agent_result {
STK_AGENT_RESULT_BACK,
STK_AGENT_RESULT_TERMINATE,
STK_AGENT_RESULT_TIMEOUT,
+ STK_AGENT_RESULT_BUSY,
};
struct stk_menu_item {
--
1.7.0.4
---------------------------------------------------------------------
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.
10 years, 4 months
Need clarification in querying the pin status
by mamata l
Hi,
I need clarification for querying the pin status when enabling/disabling pin
fails and the maximum number of attempts of wrong password are reached in
the modem.
I am trying to enable pin with the wrong password, and trying to get the pin
status. I observe that the maximum number of attempts for wrong password
have reached and the modem has reached to puk state and also the modem
de-registers from network.
In this case when i tried to get the properties using "GetProperties", the
properties from the ofono core are received without querying the information
from the modem. The "PinRequired" received is "none" .
Could you please provide some info how to get the sim pin state when sim is
blocked on puk at run-time and is there any way for app to know the number
of attempts remaining.
Thanks,
Mamata
10 years, 4 months
[PATCH] stk: Add busy error for the display text command
by Lucas, GuillaumeX
From: Guillaume Lucas <guillaumex.lucas(a)intel.com>
According to the sequence 1.2 of the ETSI TS 102 384 a busy
screen error type must be returned for the display text
proactive command when the message is not urgent and if the
ME is not able to display the text.
---
doc/stk-api.txt | 1 +
src/stk.c | 7 +++++++
src/stkagent.c | 12 ++++++++++--
src/stkagent.h | 1 +
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/doc/stk-api.txt b/doc/stk-api.txt
index b9ca592..79daee6 100644
--- a/doc/stk-api.txt
+++ b/doc/stk-api.txt
@@ -116,6 +116,7 @@ Methods byte RequestSelection(string title, byte icon_id,
cleared prior to the display of this text.
Possible Errors: [service].Error.SimToolkit.GoBack
+ [service].Error.SimToolkit.Busy
Implementation notes:
diff --git a/src/stk.c b/src/stk.c
index ac2e646..e6b78a4 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1250,6 +1250,10 @@ static void display_text_cb(enum stk_agent_result result, void *user_data)
STK_RESULT_TYPE_NO_RESPONSE : STK_RESULT_TYPE_SUCCESS);
break;
+ case STK_AGENT_RESULT_BUSY:
+ send_simple_response(stk, STK_RESULT_TYPE_TERMINAL_BUSY);
+ break;
+
case STK_AGENT_RESULT_TERMINATE:
default:
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
@@ -1363,6 +1367,7 @@ static void request_confirmation_cb(enum stk_agent_result result,
break;
case STK_AGENT_RESULT_TERMINATE:
+ default:
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
break;
}
@@ -1405,6 +1410,7 @@ static void request_key_cb(enum stk_agent_result result, char *string,
break;
case STK_AGENT_RESULT_TERMINATE:
+ default:
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
break;
}
@@ -1502,6 +1508,7 @@ static void request_string_cb(enum stk_agent_result result, char *string,
break;
case STK_AGENT_RESULT_TERMINATE:
+ default:
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
break;
}
diff --git a/src/stkagent.c b/src/stkagent.c
index 5cf83e4..6e8aff6 100644
--- a/src/stkagent.c
+++ b/src/stkagent.c
@@ -41,6 +41,7 @@
enum allowed_error {
ALLOWED_ERROR_GO_BACK = 0x1,
ALLOWED_ERROR_TERMINATE = 0x2,
+ ALLOWED_ERROR_BUSY = 0x4,
};
struct stk_agent {
@@ -62,6 +63,7 @@ struct stk_agent {
#define ERROR_PREFIX OFONO_SERVICE ".Error"
#define GOBACK_ERROR ERROR_PREFIX ".GoBack"
#define TERMINATE_ERROR ERROR_PREFIX ".EndSession"
+#define BUSY_ERROR ERROR_PREFIX ".Busy"
static void stk_agent_send_noreply(struct stk_agent *agent, const char *method)
{
@@ -194,6 +196,12 @@ static int check_error(struct stk_agent *agent, DBusMessage *reply,
goto out;
}
+ if ((allowed_errors & ALLOWED_ERROR_BUSY) &&
+ g_str_equal(err.name, BUSY_ERROR)) {
+ *out_result = STK_AGENT_RESULT_BUSY;
+ goto out;
+ }
+
result = -EINVAL;
out:
@@ -376,8 +384,8 @@ static void display_text_cb(DBusPendingCall *call, void *data)
gboolean remove_agent;
if (check_error(agent, reply,
- ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
- &result) == -EINVAL) {
+ ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE |
+ ALLOWED_ERROR_BUSY, &result) == -EINVAL) {
remove_agent = TRUE;
goto error;
}
diff --git a/src/stkagent.h b/src/stkagent.h
index c8e1886..517bcfe 100644
--- a/src/stkagent.h
+++ b/src/stkagent.h
@@ -26,6 +26,7 @@ enum stk_agent_result {
STK_AGENT_RESULT_BACK,
STK_AGENT_RESULT_TERMINATE,
STK_AGENT_RESULT_TIMEOUT,
+ STK_AGENT_RESULT_BUSY,
};
struct stk_menu_item {
--
1.7.0.4
---------------------------------------------------------------------
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.
10 years, 4 months
ConnectionContext creation for LTE PDN Connection.
by Sjur BRENDELAND
Hi all,
We have started to investigate LTE impact on oFono,
specifically how to integrate LTE and initial PDN connection,
and we have some questions regarding this.
This raises some questions about the handling of
ConnectionContexts.
When a terminal attach to LTE network it would
normally do an implicit context activation request
associated to attach request (+CGATT=1).
When the context activation is completed this will
result in an event notifying about the activated PDN
connection according to
27.007 10.1.19 Packet Domain event reporting +CGEREP.
+CGEV: ME PDN ACT <cid>
At this point we have a "connection context" in the modem.
The question is then, how should we model this in oFono?
Should we assume/require that a Connection Context
already is created by ConnMan and pre-exists in
oFono (possibly with a flag indicating that this
represents the initial PDN, or perhaps just taking
the "internet" ConnectionContext)?
Or should oFono automatically create a Connection Context?
Furthermore, should oFono automatically proceed and
set Active=true, bind the connection to a network interface
and set network interface in state UP, or should the
ConnectionContext initially set Active=false,
waiting for ConnMan to activate it?
Regards,
Sjur
10 years, 4 months