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: mbed-os-example-wifi-DISCO_IOTBOARD_MQTT MQTT
Revision 33:12f0df4d51d7, committed 2017-09-26
- Comitter:
- mbed_official
- Date:
- Tue Sep 26 08:30:04 2017 +0100
- Parent:
- 32:bca3f5f442b3
- Child:
- 34:297e06ef6c8f
- Commit message:
- User strlen() instead of sizeof for calculating string length
HTTP protocol considers character values 0-31 and 127 to be US-ASCII
control characters and are not allowed if request headers.
Fixes #31
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-wifi
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.mbedignore Tue Sep 26 08:30:04 2017 +0100 @@ -0,0 +1,2 @@ +wifi-x-nucleo-idw01m1/* +esp8266-driver/*
--- a/README.md Fri Sep 08 10:15:04 2017 +0100
+++ b/README.md Tue Sep 26 08:30:04 2017 +0100
@@ -41,7 +41,7 @@
Edit ```mbed_app.json``` to include correct WiFi shield, SSID and Password:
```
- "config": {
+ "config": {
"wifi-shield": {
"help": "Options are WIFI_ESP8266, WIFI_IDW01M1",
"value": "WIFI_IDW01M1"
@@ -57,10 +57,13 @@
},
```
+ For built-in WiFi, ignore the value of `wifi-shield`
+
3. Copy the respective _ignore_ file to `.mbedignore`
* Copy `esp8266-mbedignore` when using ESP8266 module.
* Copy `idw01m1-mbedignore` when using [X-NUCLEO-IDW01M1](https://developer.mbed.org/components/X-NUCLEO-IDW01M1/) expansion board.
-
+ * For built-in WiFi, keep the default `.mbedignore`
+
4. Compile and generate binary
For example, for `GCC`:
--- a/main.cpp Fri Sep 08 10:15:04 2017 +0100
+++ b/main.cpp Tue Sep 26 08:30:04 2017 +0100
@@ -28,16 +28,7 @@
#include "RTWInterface.h"
RTWInterface wifi;
-#else
-#if MBED_CONF_APP_WIFI_SHIELD == WIFI_ESP8266
-#if !TARGET_FF_MORPHO
-#error [NOT_SUPPORTED] Only Morpho form factor devices are supported for this shield at this time
-#endif // !TARGET_FF_MORPHO
-#else
-#if !TARGET_FF_ARDUINO
-#error [NOT_SUPPORTED] Only Arduino form factor devices are supported for this shield at this time
-#endif // !TARGET_FF_ARDUINO
-#endif // MBED_CONF_APP_WIFI_SHIELD != WIFI_ESP8266
+#else // External WiFi modules
#if MBED_CONF_APP_WIFI_SHIELD == WIFI_ESP8266
#include "ESP8266Interface.h"
@@ -47,7 +38,7 @@
SpwfSAInterface wifi(MBED_CONF_APP_WIFI_TX, MBED_CONF_APP_WIFI_RX);
#endif // MBED_CONF_APP_WIFI_SHIELD == WIFI_IDW01M1
-#endif // TARGET_UBLOX_EVK_ODIN_W2
+#endif
const char *sec2str(nsapi_security_t sec)
{
@@ -110,7 +101,7 @@
// Send a simple http request
char sbuffer[] = "GET / HTTP/1.1\r\nHost: www.arm.com\r\n\r\n";
- nsapi_size_t size = sizeof sbuffer;
+ nsapi_size_t size = strlen(sbuffer);
response = 0;
while(size)
{