Commit 0f25e038 authored by iabdalkader's avatar iabdalkader Committed by Damien George

extmod/network_ninaw10: Disable active connections before connecting.

parent c6d26bc5
......@@ -173,6 +173,11 @@ STATIC mp_obj_t network_ninaw10_connect(mp_uint_t n_args, const mp_obj_t *pos_ar
mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Key can't be empty!"));
}
// Disconnect active connections first.
if (nina_isconnected()) {
nina_disconnect();
}
if (self->itf == MOD_NETWORK_STA_IF) {
// Initialize WiFi in Station mode.
if (nina_connect(ssid, security, key, 0) != 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment