| # Copyright (c) 2013, Jouni Malinen <j@w1.fi> |
| # This software may be distributed under the terms of the BSD license. |
| # See README for more details. |
| wpas_ctrl = '/var/run/wpa_supplicant' |
| if os.path.isdir(wpas_ctrl): |
| ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)] |
| print "Could not find wpa_supplicant: ", error |
| print "No wpa_supplicant control interface found" |
| print "Testing wpa_supplicant control interface connection" |
| print "Connected to wpa_supplicant" |
| print wpas.request('PING') |
| print "Could not open event monitor connection" |
| print wpas.request('SCAN') |
| if 'CTRL-EVENT-SCAN-RESULTS' in ev: |
| print wpas.request('SCAN_RESULTS') |
| if __name__ == "__main__": |