Remote Writing IoT Data to Influx-DB over HTTP-API.
Fork of AvnetATT_shape_hackathon by
Revision 32:8ba73eab6c72, committed 2016-07-21
- Comitter:
- fkellermavnet
- Date:
- Thu Jul 21 01:51:59 2016 +0000
- Parent:
- 31:d7c386d2e95a
- Child:
- 33:eaf45dab650a
- Commit message:
- replaced incorrect usage of string data() with correct c_str().
Changed in this revision
wnc_control.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/wnc_control.cpp Wed Jul 20 15:46:26 2016 +0000 +++ b/wnc_control.cpp Thu Jul 21 01:51:59 2016 +0000 @@ -55,7 +55,7 @@ } } while (WNC_MDM_ERR != WNC_OK); - pc.printf("My Server IP: %s\r\n", MyServerIpAddress.data()); + pc.printf("My Server IP: %s\r\n", MyServerIpAddress.c_str()); } void sockopen_mdm(void) @@ -197,7 +197,7 @@ if (res >= 0) { pc.puts("["); - pc.puts(wncStr.data()); + pc.puts(wncStr.c_str()); pc.puts("]\n\r"); if (res > 0) { @@ -230,7 +230,7 @@ string cmd_str("AT%PDNSET=1,"); cmd_str += MY_APN_STR; cmd_str += ",IP"; - send_wnc_cmd(cmd_str.data(), &pRespStr, 2*WNC_TIMEOUT_MS); // Set APN, cmd seems to take a little longer sometimes + send_wnc_cmd(cmd_str.c_str(), &pRespStr, 2*WNC_TIMEOUT_MS); // Set APN, cmd seems to take a little longer sometimes send_wnc_cmd("AT@INTERNET=1", &pRespStr, WNC_TIMEOUT_MS); // Internet services enabled send_wnc_cmd("AT@SOCKDIAL=1", &pRespStr, WNC_TIMEOUT_MS); } @@ -243,7 +243,7 @@ cmd_str += ipStr; cmd_str += "\","; cmd_str += port; - send_wnc_cmd(cmd_str.data(), &pRespStr, WNC_TIMEOUT_MS); + send_wnc_cmd(cmd_str.c_str(), &pRespStr, WNC_TIMEOUT_MS); } void at_sockclose_wnc(void) @@ -258,7 +258,7 @@ string str(s); str = "AT@DNSRESVDON=\"" + str; str += "\"\r\n"; - if (send_wnc_cmd(str.data(), &pRespStr, WNC_TIMEOUT_MS) == 0) + if (send_wnc_cmd(str.c_str(), &pRespStr, WNC_TIMEOUT_MS) == 0) { size_t pos_start = pRespStr->find(":\"") + 2; if (pos_start != string::npos) @@ -311,7 +311,7 @@ cmd_str += num2str; } cmd_str += "\""; - send_wnc_cmd(cmd_str.data(), &pRespStr, WNC_TIMEOUT_MS); + send_wnc_cmd(cmd_str.c_str(), &pRespStr, WNC_TIMEOUT_MS); } else pc.puts("sockwrite Err, string to long\r\n"); @@ -336,7 +336,7 @@ // between each retry. wait_ms(10); - send_wnc_cmd(cmd_str.data(), &pRespStr, WNC_TIMEOUT_MS); + send_wnc_cmd(cmd_str.c_str(), &pRespStr, WNC_TIMEOUT_MS); size_t pos_start = pRespStr->find("\"") + 1; size_t pos_end = pRespStr->rfind("\"") - 1; i = pos_end - pos_start + 1; @@ -348,7 +348,7 @@ while (pos_start < pos_end) { byte = pRespStr->substr(pos_start, 2); - *pS += (char)strtol(byte.data(), NULL, 16); + *pS += (char)strtol(byte.c_str(), NULL, 16); pos_start += 2; } return i;