From e19dfe1c320869de392070d97c98b55942f121d4 Mon Sep 17 00:00:00 2001 From: danicampora Date: Wed, 14 Oct 2015 09:45:37 +0200 Subject: [PATCH] cc3200: In scan results rename 'auth' field to 'sec'. As defined by the new API, since 'auth' is actually a tuple composed by the security type and the key. --- cc3200/mods/modwlan.c | 2 +- cc3200/qstrdefsport.h | 1 + tests/wipy/wlan/wlan.py | 5 +++++ tests/wipy/wlan/wlan.py.exp | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cc3200/mods/modwlan.c b/cc3200/mods/modwlan.c index 98568adea7..8db89b376a 100644 --- a/cc3200/mods/modwlan.c +++ b/cc3200/mods/modwlan.c @@ -857,7 +857,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wlan_init_obj, 1, wlan_init); STATIC mp_obj_t wlan_scan(mp_obj_t self_in) { STATIC const qstr wlan_scan_info_fields[] = { - MP_QSTR_ssid, MP_QSTR_bssid, MP_QSTR_auth, MP_QSTR_channel, MP_QSTR_rssi + MP_QSTR_ssid, MP_QSTR_bssid, MP_QSTR_sec, MP_QSTR_channel, MP_QSTR_rssi }; // check for correct wlan mode diff --git a/cc3200/qstrdefsport.h b/cc3200/qstrdefsport.h index a293e69a0b..1b0413075d 100644 --- a/cc3200/qstrdefsport.h +++ b/cc3200/qstrdefsport.h @@ -293,6 +293,7 @@ Q(scan) Q(connect) Q(isconnected) Q(disconnect) +Q(sec) Q(channel) Q(rssi) Q(ifconfig) diff --git a/tests/wipy/wlan/wlan.py b/tests/wipy/wlan/wlan.py index 3d04c98664..9e18f0c4c2 100644 --- a/tests/wipy/wlan/wlan.py +++ b/tests/wipy/wlan/wlan.py @@ -44,6 +44,11 @@ scan_r = wifi.scan() print(len(scan_r) > 3) for net in scan_r: if net.ssid == testconfig.wlan_ssid: + # test that the scan results contains the desired params + print(len(net.bssid) == 6) + print(net.channel == None) + print(net.sec == testconfig.wlan_auth[0]) + print(net.rssi < 0) print('Network found') break diff --git a/tests/wipy/wlan/wlan.py.exp b/tests/wipy/wlan/wlan.py.exp index 6d27bb31c0..41253eab7c 100644 --- a/tests/wipy/wlan/wlan.py.exp +++ b/tests/wipy/wlan/wlan.py.exp @@ -11,6 +11,10 @@ True True True True +True +True +True +True Network found True True