File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,25 @@ using namespace utest::v1;
25
25
26
26
#if defined(MBED_CONF_APP_WIFI_UNSECURE_SSID)
27
27
28
+ #define SSID_MAX_LEN 32
29
+
28
30
void wifi_connect (void )
29
31
{
30
32
WiFiInterface *wifi = get_interface ();
31
33
32
- TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->set_credentials (MBED_CONF_APP_WIFI_UNSECURE_SSID, NULL ));
34
+ char ssid[SSID_MAX_LEN+1 ] = MBED_CONF_APP_WIFI_UNSECURE_SSID;
35
+
36
+ TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->set_credentials (ssid, NULL ));
37
+ TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->connect ());
38
+ TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->disconnect ());
39
+
40
+ TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->set_credentials (ssid, " " ));
33
41
TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->connect ());
34
42
TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->disconnect ());
35
43
36
- TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->set_credentials (MBED_CONF_APP_WIFI_UNSECURE_SSID, " " ));
44
+ // Driver is expected to cache the credentials
45
+ memset (ssid, 0 , SSID_MAX_LEN+1 );
46
+
37
47
TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->connect ());
38
48
TEST_ASSERT_EQUAL_INT (NSAPI_ERROR_OK, wifi->disconnect ());
39
49
}
You can’t perform that action at this time.
0 commit comments