mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 04:32:37 +01:00
auto-t: make AdHoc APIs behave like others
The AdHoc functionality in iwd.py was not consistent at all with how all the other classes worked (my bad). Instead we can create a very simple AdHocDevice class which inherits all the DBus magic in the IWDDBusAbstract class.
This commit is contained in:
parent
2a8d7d4835
commit
29eb08ead2
@ -206,6 +206,20 @@ class SignalAgent(dbus.service.Object):
|
||||
def handle_new_level(self, path, level):
|
||||
pass
|
||||
|
||||
class AdHocDevice(IWDDBusAbstract):
|
||||
'''
|
||||
Class represents an AdHoc device object: net.connman.iwd.AdHoc
|
||||
'''
|
||||
_iface_name = IWD_ADHOC_INTERFACE
|
||||
|
||||
@property
|
||||
def started(self):
|
||||
return self._properties['Started']
|
||||
|
||||
@property
|
||||
def connected_peers(self):
|
||||
return self._properties['ConnectedPeers']
|
||||
|
||||
|
||||
class Device(IWDDBusAbstract):
|
||||
'''
|
||||
@ -506,6 +520,8 @@ class Device(IWDDBusAbstract):
|
||||
error_handler=self._failure)
|
||||
self._wait_for_async_op()
|
||||
|
||||
return AdHocDevice(self.device_path)
|
||||
|
||||
def stop_adhoc(self):
|
||||
self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'station')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user