drivers/ninaw10: Fix isconnected to return False when inactive.

If isconnected is called before active, it returns -1, which causes
mp_obj_new_bool return True, indicating the module is connected.
This commit is contained in:
iabdalkader 2022-04-18 21:04:36 +02:00 committed by Damien George
parent 03c61916bc
commit 52c2580a40
1 changed files with 1 additions and 5 deletions

View File

@ -469,11 +469,7 @@ int nina_disconnect(void) {
}
int nina_isconnected(void) {
int status = nina_connection_status();
if (status == -1) {
return -1;
}
return status == NINA_STATUS_CONNECTED;
return nina_connection_status() == NINA_STATUS_CONNECTED;
}
int nina_connected_sta(uint32_t *sta_ip) {