Skip to content

Commit 80fc146

Browse files
Veijo Pesonenadbridge
authored andcommitted
Makes mbedgt-network-wifi case to skip channel number check
2.4GHz and 5GHz channels might be using the same SSID. Wifi scan might also fail occasionally to find secure- and unsecure channels on same scan so lets not assume that we'll find both.
1 parent 584f54f commit 80fc146

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

TESTS/network/wifi/wifi_scan.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,18 @@ void wifi_scan(void)
4848
const char *ssid = ap[i].get_ssid();
4949
nsapi_security_t security = ap[i].get_security();
5050
int8_t rssi = ap[i].get_rssi();
51-
uint8_t ch = ap[i].get_channel();
5251
TEST_ASSERT_INT8_WITHIN(-10, -100, rssi);
5352
if (strcmp(MBED_CONF_APP_WIFI_SECURE_SSID, ssid) == 0) {
5453
secure_found = true;
5554
TEST_ASSERT_EQUAL_INT(get_security(), security);
56-
if (MBED_CONF_APP_WIFI_CH_SECURE) {
57-
TEST_ASSERT_EQUAL_INT(MBED_CONF_APP_WIFI_CH_SECURE, ch);
58-
}
5955
}
6056
if (strcmp(MBED_CONF_APP_WIFI_UNSECURE_SSID, ssid) == 0) {
6157
unsecure_found = true;
6258
TEST_ASSERT_EQUAL_INT(NSAPI_SECURITY_NONE, security);
63-
if (MBED_CONF_APP_WIFI_CH_UNSECURE) {
64-
TEST_ASSERT_EQUAL_INT(MBED_CONF_APP_WIFI_CH_UNSECURE, ch);
65-
}
6659
}
6760
}
68-
TEST_ASSERT_TRUE(secure_found);
69-
TEST_ASSERT_TRUE(unsecure_found);
61+
// Finding one SSID is enough
62+
TEST_ASSERT_TRUE(secure_found || unsecure_found);
7063
}
7164

7265
#endif // defined(MBED_CONF_APP_WIFI_SECURE_SSID) && defined(MBED_CONF_APP_WIFI_UNSECURE_SSID)

0 commit comments

Comments
 (0)