aboutsummaryrefslogtreecommitdiffstats
path: root/wpaspy
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2016-03-04 09:20:39 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-05 15:44:51 (GMT)
commit13073011b98ab0a7e8c273c5bfdb6b7d75a4f8ca (patch)
tree02f6f139176104d4447abf82afbaa181e8992067 /wpaspy
parent4d48d44ca2225875c5d4735a41649a405dec6c1f (diff)
downloadhostap-13073011b98ab0a7e8c273c5bfdb6b7d75a4f8ca.zip
hostap-13073011b98ab0a7e8c273c5bfdb6b7d75a4f8ca.tar.gz
hostap-13073011b98ab0a7e8c273c5bfdb6b7d75a4f8ca.tar.bz2
wpaspy: Add support for TERMINATE command
This can be used to terminate the wpa_supplicant/hostapd process. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Diffstat (limited to 'wpaspy')
-rw-r--r--wpaspy/wpaspy.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/wpaspy/wpaspy.py b/wpaspy/wpaspy.py
index 861bee6..809b4ce 100644
--- a/wpaspy/wpaspy.py
+++ b/wpaspy/wpaspy.py
@@ -109,6 +109,16 @@ class Ctrl:
return None
raise Exception("DETACH failed")
+ def terminate(self):
+ if self.attached:
+ try:
+ self.detach()
+ except Exception, e:
+ # Need to ignore this to allow the socket to be closed
+ self.attached = False
+ self.request("TERMINATE")
+ self.close()
+
def pending(self, timeout=0):
[r, w, e] = select.select([self.s], [], [], timeout)
if r: