test: actually send username and password when connecting

This commit is contained in:
Dan Williams
2009-11-29 22:45:03 -08:00
parent 01db3f1c2f
commit 3890009bcc

View File

@@ -229,7 +229,12 @@ def gsm_connect(proxy, apn, user, password):
# Modem.Simple interface
simple = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM_SIMPLE)
try:
simple.Connect({'apn': apn, 'number':"*99#"}, timeout=120)
opts = {'apn': apn, 'number':"*99#"}
if user is not None:
opts['username'] = user
if password is not None:
opts['password'] = password
simple.Connect(opts, timeout=120)
print "\nConnected!"
except Exception, e:
print "Error connecting: %s" % e