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.
Dependencies: HTTPClient PowerControl SNICInterface mbed-rtos mbed-src
Fork of HTTPClient_WiFi_HelloWorld by
Revision 10:87bc3840d0a5, committed 2015-08-15
- Comitter:
- sunsmile2015
- Date:
- Sat Aug 15 04:02:17 2015 +0000
- Parent:
- 9:c1d57368ac9e
- Commit message:
- debug version
Changed in this revision
--- a/SNICInterface.lib Tue May 12 04:59:24 2015 +0000 +++ b/SNICInterface.lib Sat Aug 15 04:02:17 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/teams/murata/code/SNICInterface/#b53ccb9989c4 +https://developer.mbed.org/users/sunsmile2015/code/SNICInterface/#8b879474d7e1
--- a/main.cpp Tue May 12 04:59:24 2015 +0000
+++ b/main.cpp Sat Aug 15 04:02:17 2015 +0000
@@ -6,9 +6,9 @@
#include "PowerControl/EthernetPowerControl.h"
#endif
-#define DEMO_AP_SSID "toyowata-nad11"
+#define DEMO_AP_SSID "Eric 5S"
#define DEMO_AP_SECURITY_TYPE e_SEC_WPA2_AES
-#define DEMO_AP_SECUTIRY_KEY "mbed.org"
+#define DEMO_AP_SECUTIRY_KEY "liaoduck"
#if defined(TARGET_LPC1768)
C_SNIC_WifiInterface wifi( p9, p10, NC, NC, p30 );
@@ -25,11 +25,13 @@
int main()
{
+ int ret = -1;
#if defined(TARGET_LPC1768)
PHY_PowerDown();
#endif
pc.printf("WiFi init...\n");
+
wifi.init();
wait(0.5);
@@ -40,17 +42,21 @@
wait(0.3);
// Connect AP
- wifi.connect( DEMO_AP_SSID
- , strlen(DEMO_AP_SSID)
- , DEMO_AP_SECURITY_TYPE
- , DEMO_AP_SECUTIRY_KEY
- , strlen(DEMO_AP_SECUTIRY_KEY) );
- wait(0.5);
+ while(ret != 0) {
+ pc.printf("WiFi connectng...\n");
+ ret = wifi.connect( DEMO_AP_SSID
+ , strlen(DEMO_AP_SSID)
+ , DEMO_AP_SECURITY_TYPE
+ , DEMO_AP_SECUTIRY_KEY
+ , strlen(DEMO_AP_SECUTIRY_KEY) );
+ wait(1);
+ //pc.printf("ret is %d\n", ret);
+ };
wifi.setIPConfig( true ); //Use DHCP
wait(0.5);
pc.printf("IP Address is %s\n", wifi.getIPAddress());
- int ret = 0;
+
#if 0
// disabled this test, since the library doesn't support HTTPS connection
//GET data
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-src.lib Sat Aug 15 04:02:17 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/mbed_official/code/mbed-src/#813dcc80987e
--- a/mbed.bld Tue May 12 04:59:24 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/8ab26030e058 \ No newline at end of file
