Skip to content

Commit 7fd538c

Browse files
author
Daniel Campora
committed
cc3200: Raise an exception if trying to scan for networks in AP mode.
1 parent f522849 commit 7fd538c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cc3200/mods/modwlan.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,11 @@ STATIC mp_obj_t wlan_scan(mp_obj_t self_in) {
946946
MP_QSTR_security, MP_QSTR_channel, MP_QSTR_rssi
947947
};
948948

949+
// check for correct wlan mode
950+
if (wlan_obj.mode != ROLE_STA && wlan_obj.mode != ROLE_P2P) {
951+
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_request_not_possible));
952+
}
953+
949954
Sl_WlanNetworkEntry_t wlanEntry;
950955
mp_obj_t nets = mp_obj_new_list(0, NULL);
951956
uint8_t _index = 0;

0 commit comments

Comments
 (0)