Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: tests/blocking/network/JoinNetworkTest.cpp
- Revision:
- 22:26420b641605
- Parent:
- 12:3dd3a1be40c1
--- a/tests/blocking/network/JoinNetworkTest.cpp Tue Aug 26 23:57:16 2014 +0000
+++ b/tests/blocking/network/JoinNetworkTest.cpp Thu Oct 23 15:17:15 2014 -0700
@@ -43,8 +43,13 @@
const char *ssid = (argc > 0) ? argv[0] : NULL;
const char *password = (argc > 1) ? argv[1] : NULL;
-
- if(!WICONNECT_FAILED(result, wiconnect->join(ssid, password, Callback(joinCompleteCallback))))
+
+ // if we're changing the ssid, then we need to leave the current network we're connected to first
+ if(ssid != NULL && WICONNECT_FAILED(result, wiconnect->leave()))
+ {
+ LOG_WICONNECT_ERROR(result, "Failed to disconnect from the network first");
+ }
+ else if(!WICONNECT_FAILED(result, wiconnect->join(ssid, password, Callback(joinCompleteCallback))))
{
LOG_INFO("Joining network");
}
@@ -73,7 +78,8 @@
LOG_INFO("Successfully joined network");
}
else
- {
- LOG_WICONNECT_ERROR(result, "Errors occurred while joining network");
+ {
+ NetworkJoinResult joinResult = (NetworkJoinResult)(uint32_t)arg1;
+ LOG_WICONNECT_ERROR(result, "Errors occurred while joining network. Join result: %s", Wiconnect::networkJoinResultToStr(joinResult));
}
}