A quick example of a simple WiFi application using the WiFi and network-socket APIs that is provided as a part of mbed-os.
Dependencies: WizFi310Interface_Draft
Fork of mbed-os-example-mbed5-wifi by
Revision 50:31005695f3a3, committed 2017-12-19
- Comitter:
- kaizen
- Date:
- Tue Dec 19 17:00:27 2017 +0900
- Parent:
- 49:3df367a86ec7
- Commit message:
- This is mbed-os-example-wifi using WizFi310
Changed in this revision
--- a/WizFi310Interface_Draft.lib Mon Dec 18 23:46:25 2017 +0000 +++ b/WizFi310Interface_Draft.lib Tue Dec 19 17:00:27 2017 +0900 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/kaizen/code/WizFi310Interface_Draft/#d0e3f515f99d +https://os.mbed.com/users/kaizen/code/WizFi310Interface_Draft/#8e468bb83e1e
--- a/main.cpp Mon Dec 18 23:46:25 2017 +0000 +++ b/main.cpp Tue Dec 19 17:00:27 2017 +0900 @@ -123,7 +123,7 @@ } // Recieve a simple http response and print out the response line - char rbuffer[64]; + char rbuffer[512]; response = socket.recv(rbuffer, sizeof rbuffer); if (response < 0) { printf("Error receiving data: %d\n", response); @@ -141,11 +141,11 @@ printf("WiFi example\n\n"); - //count = scan_demo(&wifi); - //if (count == 0) { - // printf("No WIFI APNs found - can't continue further.\n"); - // return -1; - //} + count = scan_demo(&wifi); + if (count == 0) { + printf("No WIFI APNs found - can't continue further.\n"); + return -1; + } printf("\nConnecting to %s...\n", MBED_CONF_APP_WIFI_SSID); int ret = wifi.connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
--- a/mbed_app.json Mon Dec 18 23:46:25 2017 +0000 +++ b/mbed_app.json Tue Dec 19 17:00:27 2017 +0900 @@ -25,7 +25,9 @@ "*": { "platform.stdio-convert-newlines": true, "platform.stdio-baud-rate": 115200, - "platform.default-serial-baud-rate": 115200 + "platform.default-serial-baud-rate": 115200, + "drivers.uart-serial-rxbuf-size":1024, + "drivers.uart-serial-txbuf-size":1024 }, "UBLOX_EVK_ODIN_W2": { "target.device_has": ["EMAC"]