auto-t: add connect API for the hidden networks

In addition, add dbus exception for the service set overlap
This commit is contained in:
Tim Kourt 2018-06-27 16:33:15 -07:00 committed by Denis Kenzior
parent 395a70d652
commit e9fef6ba52
1 changed files with 18 additions and 0 deletions

View File

@ -52,6 +52,7 @@ class NoAgentEx(dbus.DBusException): pass
class NotConnectedEx(dbus.DBusException): pass
class NotConfiguredEx(dbus.DBusException): pass
class NotImplementedEx(dbus.DBusException): pass
class ServiceSetOverlapEx(dbus.DBusException): pass
class CanceledEx(dbus.DBusException):
_dbus_error_name = 'net.connman.iwd.Error.Canceled'
@ -70,6 +71,7 @@ _dbus_ex_to_py = {
'NotConnected' : NotConnectedEx,
'NotConfigured' : NotConfiguredEx,
'NotImplemented' : NotImplementedEx,
'ServiceSetOverlap' : ServiceSetOverlapEx,
}
@ -366,6 +368,22 @@ class Device(IWDDBusAbstract):
error_handler=self._failure)
self._wait_for_async_op()
def connect_hidden_network(self, name):
'''Connect to a hidden network
Possible exception: BusyEx
FailedEx
InvalidArgsEx
NotConfiguredEx
NotConnectedEx
NotFoundEx
ServiceSetOverlapEx
'''
self._iface.ConnectHiddenNetwork(name, dbus_interface=self._iface_name,
reply_handler=self._success,
error_handler=self._failure)
self._wait_for_async_op()
def __str__(self, prefix = ''):
return prefix + 'Device: ' + self.device_path + '\n'\
+ prefix + '\tName:\t\t' + self.name + '\n'\