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
Fork of HTTPClient_WiFi_HelloWorld by
Revision 3:837766adc429, committed 2015-01-23
- Comitter:
- MACRUM
- Date:
- Fri Jan 23 09:56:32 2015 +0000
- Parent:
- 2:270e2d0bb85a
- Child:
- 4:1cb3225666d2
- Commit message:
- Initial release
Changed in this revision
--- a/EthernetInterface.lib Thu Aug 30 15:42:06 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/EthernetInterface/#a0ee3ae75cfa
--- a/HTTPClient.lib Thu Aug 30 15:42:06 2012 +0000 +++ b/HTTPClient.lib Fri Jan 23 09:56:32 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/donatien/code/HTTPClient/#1f743885e7de +http://mbed.org/users/donatien/code/HTTPClient/#3c7789c521df
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PowerControl.lib Fri Jan 23 09:56:32 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/JST2011/code/PowerControl/#d0fa2aeb02a4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SNICInterface_mod.lib Fri Jan 23 09:56:32 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/ban4jp/code/SNICInterface_PullReq/#62ba69ff80d2
--- a/main.cpp Thu Aug 30 15:42:06 2012 +0000
+++ b/main.cpp Fri Jan 23 09:56:32 2015 +0000
@@ -1,20 +1,49 @@
#include "mbed.h"
-#include "EthernetInterface.h"
+#include "SNIC_WifiInterface.h"
#include "HTTPClient.h"
-EthernetInterface eth;
+#if defined(TARGET_LPC1768)
+#include "PowerControl/EthernetPowerControl.h"
+#endif
+
+#define DEMO_AP_SSID "SSID"
+#define DEMO_AP_SECURITY_TYPE e_SEC_WPA2_AES
+#define DEMO_AP_SECUTIRY_KEY "PASSWORD"
+
+C_SNIC_WifiInterface wifi( p9, p10, NC, NC, p30 );
+
HTTPClient http;
char str[512];
int main()
{
- eth.init(); //Use DHCP
+#if defined(TARGET_LPC1768)
+ PHY_PowerDown();
+#endif
+
+ wifi.init(); //Use DHCP
- eth.connect();
+ wait(0.5);
+ int s = wifi.disconnect();
+ if( s != 0 ) {
+ return -1;
+ }
+
+ 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);
+ wifi.setIPConfig( true );
+ wait(0.5);
+ printf("IP Address is %s\n", wifi.getIPAddress());
//GET data
printf("\nTrying to fetch page...\n");
- int ret = http.get("http://mbed.org/media/uploads/donatien/hello.txt", str, 128);
+ int ret = http.get("http://developer.mbed.org/media/uploads/donatien/hello.txt", str, 128);
if (!ret)
{
printf("Page fetched successfully - read %d characters\n", strlen(str));
@@ -72,7 +101,7 @@
printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode());
}
- eth.disconnect();
+ wifi.disconnect();
while(1) {
}
--- a/mbed-rtos.lib Thu Aug 30 15:42:06 2012 +0000 +++ b/mbed-rtos.lib Fri Jan 23 09:56:32 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#9654a71f5a90 +http://mbed.org/users/mbed_official/code/mbed-rtos/#34e80e862021
--- a/mbed.bld Thu Aug 30 15:42:06 2012 +0000 +++ b/mbed.bld Fri Jan 23 09:56:32 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/976df7c37ad5 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/6213f644d804 \ No newline at end of file

Murata TypeYD