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: FatFileSystemCpp mbed PowerControl USBHostLite
Diff: wifi.cpp
- Revision:
- 9:8839ecc02e0e
- Parent:
- 8:ae5319de2c33
- Child:
- 10:fdf9ca254549
--- a/wifi.cpp Thu Apr 23 19:07:30 2015 +0000 +++ b/wifi.cpp Wed Apr 29 08:01:37 2015 +0000 @@ -6,11 +6,12 @@ Wifi::Wifi (PinName tx, PinName rx, PinName reset, PinName status, const char * ssid, const char * phrase) : wifi_(tx, rx, reset, status, ssid, phrase, WPA) { - //wifi_.baudr(9600); //default baudrate, will be changed asap wifi_.init(); // use DHCP - while (!wifi_.connect()); // join the network + while (!wifi_.connect()) + ; printf("IP Address is %s\n\r", wifi_.getIPAddress()); wifi_.setProtocol(TCP); + /* set different baudrate, higher values tends to be unstable */ wifi_.baudr(BAUDR); } @@ -19,7 +20,7 @@ * many times (char) 0xAA (int) count 3*(short) acc 3*(float)gyro * (int) -1 (int) -1 */ -int Wifi::sendFile(const char *fname, int i) +int Wifi::sendFile(const char *fname, int swimmer_id) { char buffer[BUFFER_SIZE+1]; int temp; @@ -33,7 +34,7 @@ temp = -1; toBytes(buffer, &temp, sizeof(int)); toBytes(buffer+sizeof(int), &temp, sizeof(int)); - temp = i; + temp = swimmer_id; toBytes(buffer+sizeof(int)*2, &temp, sizeof(int)); bufferSend(buffer, 3*sizeof(int));