A library for talking to Multi-Tech's Cellular SocketModem Devices.
Dependents: M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more
Revision 150:95093b517872, committed 2014-08-28
- Comitter:
- mfiore
- Date:
- Thu Aug 28 20:16:59 2014 +0000
- Parent:
- 146:efc4db23a564
- Child:
- 151:483208276759
- Commit message:
- wifi: fix parsing of "show connection"; resolves issue where program can get stuck in state where flag says socket is open but it's really closed
Changed in this revision
wifi/Wifi.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/wifi/Wifi.cpp Mon Jan 20 15:33:54 2014 +0000 +++ b/wifi/Wifi.cpp Thu Aug 28 20:16:59 2014 +0000 @@ -363,7 +363,9 @@ return socketOpened; } std::string response = sendCommand("show connection", 2000, "\n"); - int start = response.find("f"); + // response to "show connection" always starts with 8 + // http://ww1.microchip.com/downloads/en/DeviceDoc/rn-wiflycr-ug-v1.2r.pdf + int start = response.find("8"); if(start != string::npos && response.size() >= (start + 3)) { if(response[start + 3] == '1') { socketOpened = true;