this is using the mbed os version 5-13-1
source/WiFiManager.cpp@87:99b37d26ff2a, 2019-03-29 (annotated)
- Committer:
- ocomeni
- Date:
- Fri Mar 29 22:18:33 2019 +0000
- Revision:
- 87:99b37d26ff2a
- Parent:
- 86:04fc2fcda7ec
- Child:
- 88:7ffa053be662
http/https request and response implemented
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ocomeni | 78:07bb86e3ce14 | 1 | #include "WiFiManager.h" |
| ocomeni | 78:07bb86e3ce14 | 2 | #include "common_config.h" |
| ocomeni | 78:07bb86e3ce14 | 3 | |
| ocomeni | 78:07bb86e3ce14 | 4 | |
| ocomeni | 79:a2187bbfa407 | 5 | WiFiManager::WiFiManager(wifi_config_t wifi_config, WiFiInterface *wifi, |
| ocomeni | 80:e8f0e92e3ac9 | 6 | MemoryPool<wifi_cmd_message_t, 16> *aT2WiFimPool, |
| ocomeni | 80:e8f0e92e3ac9 | 7 | Queue<wifi_cmd_message_t, 16> *aT2WiFiCmdQueue, |
| ocomeni | 81:637a87eb8170 | 8 | MemoryPool<at_resp_message_t, 16> *wiFi2ATmPool, |
| ocomeni | 81:637a87eb8170 | 9 | Queue<at_resp_message_t, 16> *wiFi2ATCmdQueue, |
| ocomeni | 87:99b37d26ff2a | 10 | MemoryPool<wifi_data_msg_t, PQDSZ> *aT2WiFiDatamPool, |
| ocomeni | 87:99b37d26ff2a | 11 | Queue<wifi_data_msg_t, PQDSZ> *aT2WiFiDataQueue, |
| ocomeni | 87:99b37d26ff2a | 12 | MemoryPool<at_data_msg_t, PQDSZ> *wiFi2ATDatamPool, |
| ocomeni | 87:99b37d26ff2a | 13 | Queue<at_data_msg_t, PQDSZ> *wiFi2ATDataQueue) |
| ocomeni | 78:07bb86e3ce14 | 14 | : |
| ocomeni | 81:637a87eb8170 | 15 | wifi_config(wifi_config), |
| ocomeni | 81:637a87eb8170 | 16 | network(wifi), |
| ocomeni | 81:637a87eb8170 | 17 | _aT2WiFimPool(aT2WiFimPool), |
| ocomeni | 81:637a87eb8170 | 18 | _aT2WiFiCmdQueue(aT2WiFiCmdQueue), |
| ocomeni | 81:637a87eb8170 | 19 | |
| ocomeni | 81:637a87eb8170 | 20 | _wiFi2ATmPool(wiFi2ATmPool), |
| ocomeni | 81:637a87eb8170 | 21 | _wiFi2ATCmdQueue(wiFi2ATCmdQueue), |
| ocomeni | 81:637a87eb8170 | 22 | |
| ocomeni | 81:637a87eb8170 | 23 | _aT2WiFiDatamPool(aT2WiFiDatamPool), |
| ocomeni | 81:637a87eb8170 | 24 | _aT2WiFiDataQueue(aT2WiFiDataQueue), |
| ocomeni | 81:637a87eb8170 | 25 | |
| ocomeni | 81:637a87eb8170 | 26 | _wiFi2ATDatamPool(wiFi2ATDatamPool), |
| ocomeni | 81:637a87eb8170 | 27 | _wiFi2ATDataQueue(wiFi2ATDataQueue) |
| ocomeni | 78:07bb86e3ce14 | 28 | |
| ocomeni | 78:07bb86e3ce14 | 29 | { |
| ocomeni | 79:a2187bbfa407 | 30 | lastScanCount = 0; |
| ocomeni | 79:a2187bbfa407 | 31 | wifiCmd = WIFI_CMD_NONE; |
| ocomeni | 81:637a87eb8170 | 32 | internet_config.connectionScheme = ALWAYS_CONNECTED; // set default connection scheme |
| ocomeni | 81:637a87eb8170 | 33 | is_connected = false; |
| ocomeni | 84:7c7add00f4bf | 34 | chunkNum = 0; |
| ocomeni | 78:07bb86e3ce14 | 35 | } |
| ocomeni | 78:07bb86e3ce14 | 36 | |
| ocomeni | 78:07bb86e3ce14 | 37 | WiFiManager::~WiFiManager() |
| ocomeni | 78:07bb86e3ce14 | 38 | { |
| ocomeni | 78:07bb86e3ce14 | 39 | } |
| ocomeni | 79:a2187bbfa407 | 40 | |
| ocomeni | 81:637a87eb8170 | 41 | bool WiFiManager::queueATresponse(at_cmd_resp_t resp){ |
| ocomeni | 81:637a87eb8170 | 42 | at_resp_message_t *atResp = _wiFi2ATmPool->alloc(); |
| ocomeni | 81:637a87eb8170 | 43 | atResp->at_resp = resp; |
| ocomeni | 81:637a87eb8170 | 44 | _wiFi2ATCmdQueue->put(atResp); |
| ocomeni | 81:637a87eb8170 | 45 | return true; |
| ocomeni | 81:637a87eb8170 | 46 | } |
| ocomeni | 81:637a87eb8170 | 47 | |
| ocomeni | 81:637a87eb8170 | 48 | |
| ocomeni | 81:637a87eb8170 | 49 | bool WiFiManager::queueWiFiDataResponse(at_data_msg_t at_resp){ |
| ocomeni | 81:637a87eb8170 | 50 | at_data_msg_t *atData = _wiFi2ATDatamPool->alloc(); |
| ocomeni | 81:637a87eb8170 | 51 | atData->at_resp = at_resp.at_resp; |
| ocomeni | 81:637a87eb8170 | 52 | atData->dataLen = at_resp.dataLen; |
| ocomeni | 81:637a87eb8170 | 53 | memcpy(atData->buffer, at_resp.buffer, at_resp.dataLen); |
| ocomeni | 81:637a87eb8170 | 54 | _wiFi2ATDataQueue->put(atData); |
| ocomeni | 87:99b37d26ff2a | 55 | printf("[WIFI MAN] queued data size = %d : at_resp = %d\n", at_resp.dataLen, at_resp.at_resp); |
| ocomeni | 81:637a87eb8170 | 56 | return true; |
| ocomeni | 81:637a87eb8170 | 57 | } |
| ocomeni | 81:637a87eb8170 | 58 | |
| ocomeni | 79:a2187bbfa407 | 59 | |
| ocomeni | 79:a2187bbfa407 | 60 | |
| ocomeni | 79:a2187bbfa407 | 61 | void WiFiManager::runMain(){ |
| ocomeni | 81:637a87eb8170 | 62 | nsapi_error_t error; |
| ocomeni | 87:99b37d26ff2a | 63 | printf("\r\n [WIFI MAN] Thread Id = %d\r\n", Thread::gettid()); |
| ocomeni | 79:a2187bbfa407 | 64 | while(true){ |
| ocomeni | 79:a2187bbfa407 | 65 | dequeueWiFiCommands(); |
| ocomeni | 81:637a87eb8170 | 66 | dequeueATdataResponse(); |
| ocomeni | 79:a2187bbfa407 | 67 | switch(wifiCmd){ |
| ocomeni | 79:a2187bbfa407 | 68 | case WIFI_CMD_NONE: |
| ocomeni | 79:a2187bbfa407 | 69 | // IDLE STATE |
| ocomeni | 79:a2187bbfa407 | 70 | break; |
| ocomeni | 79:a2187bbfa407 | 71 | case WIFI_CMD_SCAN: |
| ocomeni | 79:a2187bbfa407 | 72 | error = scanNetworks(); |
| ocomeni | 79:a2187bbfa407 | 73 | wifiCmd = WIFI_CMD_NONE; |
| ocomeni | 81:637a87eb8170 | 74 | queueATresponse(AT_SCAN_RESP); |
| ocomeni | 81:637a87eb8170 | 75 | break; |
| ocomeni | 81:637a87eb8170 | 76 | case WIFI_CMD_DETAILED_SCAN: |
| ocomeni | 81:637a87eb8170 | 77 | nsapi_size_or_error_t cnt_err; |
| ocomeni | 81:637a87eb8170 | 78 | cnt_err = getAvailableAPs(lastScanCount); |
| ocomeni | 81:637a87eb8170 | 79 | wifiCmd = WIFI_CMD_NONE; |
| ocomeni | 81:637a87eb8170 | 80 | queueATresponse(AT_DETAILED_SCAN_RESP); |
| ocomeni | 79:a2187bbfa407 | 81 | break; |
| ocomeni | 79:a2187bbfa407 | 82 | case WIFI_CMD_CONNECT: |
| ocomeni | 81:637a87eb8170 | 83 | error = connect(); |
| ocomeni | 81:637a87eb8170 | 84 | wifiCmd = WIFI_CMD_NONE; |
| ocomeni | 81:637a87eb8170 | 85 | queueATresponse(AT_CONNECT_RESP); |
| ocomeni | 79:a2187bbfa407 | 86 | break; |
| ocomeni | 79:a2187bbfa407 | 87 | case WIFI_CMD_DISCONNECT: |
| ocomeni | 81:637a87eb8170 | 88 | error = disconnect(); |
| ocomeni | 81:637a87eb8170 | 89 | wifiCmd = WIFI_CMD_NONE; |
| ocomeni | 81:637a87eb8170 | 90 | queueATresponse(AT_DISCONNECT_RESP); |
| ocomeni | 81:637a87eb8170 | 91 | break; |
| ocomeni | 81:637a87eb8170 | 92 | case WIFI_CMD_CONFIG: |
| ocomeni | 81:637a87eb8170 | 93 | set_WIFI_CONFIG(); |
| ocomeni | 81:637a87eb8170 | 94 | wifiCmd = WIFI_CMD_NONE; |
| ocomeni | 81:637a87eb8170 | 95 | queueATresponse(AT_CONFIG_RESP); |
| ocomeni | 82:10072c1794d3 | 96 | break; |
| ocomeni | 81:637a87eb8170 | 97 | case WIFI_CMD_INTERNET_CONFIG: |
| ocomeni | 81:637a87eb8170 | 98 | set_internet_config(); |
| ocomeni | 81:637a87eb8170 | 99 | wifiCmd = WIFI_CMD_NONE; |
| ocomeni | 81:637a87eb8170 | 100 | queueATresponse(AT_INTERNET_CONFIG_RESP); |
| ocomeni | 79:a2187bbfa407 | 101 | break; |
| ocomeni | 79:a2187bbfa407 | 102 | case WIFI_CMD_SEND_HTTPS_REQ: |
| ocomeni | 84:7c7add00f4bf | 103 | createHttpsRequest(); |
| ocomeni | 84:7c7add00f4bf | 104 | wifiCmd = WIFI_CMD_NONE; |
| ocomeni | 79:a2187bbfa407 | 105 | break; |
| ocomeni | 79:a2187bbfa407 | 106 | case WIFI_CMD_SEND_HTTP_REQ: |
| ocomeni | 79:a2187bbfa407 | 107 | break; |
| ocomeni | 79:a2187bbfa407 | 108 | default: |
| ocomeni | 79:a2187bbfa407 | 109 | break; |
| ocomeni | 79:a2187bbfa407 | 110 | } |
| ocomeni | 79:a2187bbfa407 | 111 | wait_ms(100); // |
| ocomeni | 79:a2187bbfa407 | 112 | } |
| ocomeni | 79:a2187bbfa407 | 113 | |
| ocomeni | 78:07bb86e3ce14 | 114 | } |
| ocomeni | 79:a2187bbfa407 | 115 | |
| ocomeni | 79:a2187bbfa407 | 116 | bool WiFiManager::dequeueWiFiCommands(){ |
| ocomeni | 81:637a87eb8170 | 117 | if(wifiCmd != WIFI_CMD_NONE) return false; // busy |
| ocomeni | 81:637a87eb8170 | 118 | osEvent evt = _aT2WiFiCmdQueue->get(0); |
| ocomeni | 79:a2187bbfa407 | 119 | if(evt.status == osEventMessage){ |
| ocomeni | 79:a2187bbfa407 | 120 | wifi_cmd_message_t *cmd = (wifi_cmd_message_t*)evt.value.p; |
| ocomeni | 79:a2187bbfa407 | 121 | setNextCommand(cmd->wifi_cmd); |
| ocomeni | 79:a2187bbfa407 | 122 | _aT2WiFimPool->free(cmd); |
| ocomeni | 79:a2187bbfa407 | 123 | } |
| ocomeni | 79:a2187bbfa407 | 124 | return true; |
| ocomeni | 79:a2187bbfa407 | 125 | } |
| ocomeni | 79:a2187bbfa407 | 126 | |
| ocomeni | 79:a2187bbfa407 | 127 | |
| ocomeni | 81:637a87eb8170 | 128 | bool WiFiManager::dequeueATdataResponse(){ |
| ocomeni | 81:637a87eb8170 | 129 | if(wifiCmd != WIFI_CMD_NONE) return false; // busy |
| ocomeni | 81:637a87eb8170 | 130 | osEvent evt = _aT2WiFiDataQueue->get(0); |
| ocomeni | 81:637a87eb8170 | 131 | if(evt.status == osEventMessage){ |
| ocomeni | 81:637a87eb8170 | 132 | data_msg = (wifi_data_msg_t*)evt.value.p; |
| ocomeni | 81:637a87eb8170 | 133 | setNextCommand(data_msg->wifi_cmd); |
| ocomeni | 81:637a87eb8170 | 134 | //_wiFi2ATDatamPool->free(data_msg); |
| ocomeni | 81:637a87eb8170 | 135 | } |
| ocomeni | 81:637a87eb8170 | 136 | return true; |
| ocomeni | 81:637a87eb8170 | 137 | } |
| ocomeni | 81:637a87eb8170 | 138 | |
| ocomeni | 81:637a87eb8170 | 139 | |
| ocomeni | 79:a2187bbfa407 | 140 | bool WiFiManager::setNextCommand(wifi_cmd_t cmd) |
| ocomeni | 78:07bb86e3ce14 | 141 | { |
| ocomeni | 79:a2187bbfa407 | 142 | printf("\n [WIFI-MAN] About to set next WiFi manager command \n"); |
| ocomeni | 79:a2187bbfa407 | 143 | if(wifiCmd == WIFI_CMD_NONE){ |
| ocomeni | 79:a2187bbfa407 | 144 | wifiCmd = cmd; |
| ocomeni | 79:a2187bbfa407 | 145 | return true; // success |
| ocomeni | 79:a2187bbfa407 | 146 | } |
| ocomeni | 79:a2187bbfa407 | 147 | return false; // wiFiManager busy |
| ocomeni | 78:07bb86e3ce14 | 148 | } |
| ocomeni | 79:a2187bbfa407 | 149 | |
| ocomeni | 81:637a87eb8170 | 150 | const char * WiFiManager::sec2str(nsapi_security_t sec) |
| ocomeni | 81:637a87eb8170 | 151 | { |
| ocomeni | 81:637a87eb8170 | 152 | switch (sec) { |
| ocomeni | 81:637a87eb8170 | 153 | case NSAPI_SECURITY_NONE: |
| ocomeni | 81:637a87eb8170 | 154 | return "None"; |
| ocomeni | 81:637a87eb8170 | 155 | case NSAPI_SECURITY_WEP: |
| ocomeni | 81:637a87eb8170 | 156 | return "WEP"; |
| ocomeni | 81:637a87eb8170 | 157 | case NSAPI_SECURITY_WPA: |
| ocomeni | 81:637a87eb8170 | 158 | return "WPA"; |
| ocomeni | 81:637a87eb8170 | 159 | case NSAPI_SECURITY_WPA2: |
| ocomeni | 81:637a87eb8170 | 160 | return "WPA2"; |
| ocomeni | 81:637a87eb8170 | 161 | case NSAPI_SECURITY_WPA_WPA2: |
| ocomeni | 81:637a87eb8170 | 162 | return "WPA/WPA2"; |
| ocomeni | 81:637a87eb8170 | 163 | case NSAPI_SECURITY_UNKNOWN: |
| ocomeni | 81:637a87eb8170 | 164 | default: |
| ocomeni | 81:637a87eb8170 | 165 | return "Unknown"; |
| ocomeni | 81:637a87eb8170 | 166 | } |
| ocomeni | 81:637a87eb8170 | 167 | } |
| ocomeni | 81:637a87eb8170 | 168 | |
| ocomeni | 79:a2187bbfa407 | 169 | |
| ocomeni | 79:a2187bbfa407 | 170 | nsapi_size_or_error_t WiFiManager::scanNetworks() |
| ocomeni | 79:a2187bbfa407 | 171 | { |
| ocomeni | 79:a2187bbfa407 | 172 | nsapi_error_t error; |
| ocomeni | 79:a2187bbfa407 | 173 | printf("\n [WIFI-MAN] About to start scan for WiFi networks\n"); |
| ocomeni | 79:a2187bbfa407 | 174 | lastScanCount = network->scan(NULL, 0); |
| ocomeni | 79:a2187bbfa407 | 175 | printf("\n [WIFI-MAN] Scan for WiFi networks completed - \n"); |
| ocomeni | 79:a2187bbfa407 | 176 | return lastScanCount; |
| ocomeni | 79:a2187bbfa407 | 177 | } |
| ocomeni | 79:a2187bbfa407 | 178 | |
| ocomeni | 79:a2187bbfa407 | 179 | |
| ocomeni | 81:637a87eb8170 | 180 | //nsapi_size_or_error_t WiFiManager::getAvailableAPs(WiFiAccessPoint * res, |
| ocomeni | 81:637a87eb8170 | 181 | // nsapi_size_t ncount) |
| ocomeni | 81:637a87eb8170 | 182 | nsapi_size_or_error_t WiFiManager::getAvailableAPs(nsapi_size_t ncount) |
| ocomeni | 79:a2187bbfa407 | 183 | { |
| ocomeni | 81:637a87eb8170 | 184 | WiFiAccessPoint *ap; |
| ocomeni | 81:637a87eb8170 | 185 | nsapi_size_or_error_t count; |
| ocomeni | 81:637a87eb8170 | 186 | count = ncount; |
| ocomeni | 81:637a87eb8170 | 187 | //count = wiFiManager->scanNetworks(); |
| ocomeni | 81:637a87eb8170 | 188 | if (count <= 0) { |
| ocomeni | 81:637a87eb8170 | 189 | //_smutex.lock(); |
| ocomeni | 81:637a87eb8170 | 190 | printf("[WIFI-MAN] scan() failed with return value: %d\n", count); |
| ocomeni | 81:637a87eb8170 | 191 | //_smutex.unlock(); |
| ocomeni | 81:637a87eb8170 | 192 | return; |
| ocomeni | 81:637a87eb8170 | 193 | } |
| ocomeni | 81:637a87eb8170 | 194 | /* Limit number of network arbitrary to 15 */ |
| ocomeni | 81:637a87eb8170 | 195 | count = count < 15 ? count : 15; |
| ocomeni | 81:637a87eb8170 | 196 | ap = new WiFiAccessPoint[count]; |
| ocomeni | 81:637a87eb8170 | 197 | count = network->scan(ap, count); |
| ocomeni | 81:637a87eb8170 | 198 | if (count <= 0) { |
| ocomeni | 81:637a87eb8170 | 199 | printf("[WIFI-MAN] scan() failed with return value: %d\n", count); |
| ocomeni | 81:637a87eb8170 | 200 | return; |
| ocomeni | 81:637a87eb8170 | 201 | } |
| ocomeni | 81:637a87eb8170 | 202 | |
| ocomeni | 81:637a87eb8170 | 203 | for (int i = 0; i < count; i++) { |
| ocomeni | 81:637a87eb8170 | 204 | printf("[WIFI-MAN]: %s secured: %s BSSID: %hhX:%hhX:%hhX:%hhx:%hhx:%hhx RSSI: %hhd Ch: %hhd\n", ap[i].get_ssid(), |
| ocomeni | 81:637a87eb8170 | 205 | sec2str(ap[i].get_security()), ap[i].get_bssid()[0], ap[i].get_bssid()[1], ap[i].get_bssid()[2], |
| ocomeni | 81:637a87eb8170 | 206 | ap[i].get_bssid()[3], ap[i].get_bssid()[4], ap[i].get_bssid()[5], ap[i].get_rssi(), ap[i].get_channel()); |
| ocomeni | 81:637a87eb8170 | 207 | } |
| ocomeni | 81:637a87eb8170 | 208 | printf("[WIFI-MAN] %d networks available.\n", count); |
| ocomeni | 81:637a87eb8170 | 209 | |
| ocomeni | 81:637a87eb8170 | 210 | delete[] ap; |
| ocomeni | 79:a2187bbfa407 | 211 | return count; |
| ocomeni | 79:a2187bbfa407 | 212 | } |
| ocomeni | 79:a2187bbfa407 | 213 | |
| ocomeni | 79:a2187bbfa407 | 214 | |
| ocomeni | 81:637a87eb8170 | 215 | void WiFiManager::set_WIFI_CONFIG() |
| ocomeni | 81:637a87eb8170 | 216 | { |
| ocomeni | 81:637a87eb8170 | 217 | wifi_config_t *wifi_cfg= (wifi_config_t *) data_msg->buffer; |
| ocomeni | 82:10072c1794d3 | 218 | if(wifi_cfg->ssid[0] != NULL)set_WIFI_SSID(wifi_cfg->ssid); |
| ocomeni | 82:10072c1794d3 | 219 | if(wifi_cfg->pass[0] != NULL)set_WIFI_PASSWORD(wifi_cfg->pass); |
| ocomeni | 82:10072c1794d3 | 220 | if(wifi_cfg->security != NSAPI_SECURITY_UNKNOWN)set_WIFI_SECURITY(wifi_cfg->security); |
| ocomeni | 81:637a87eb8170 | 221 | free_DataMsg(); |
| ocomeni | 81:637a87eb8170 | 222 | } |
| ocomeni | 81:637a87eb8170 | 223 | |
| ocomeni | 78:07bb86e3ce14 | 224 | void WiFiManager::set_WIFI_SSID(char * wifi_ssid) |
| ocomeni | 78:07bb86e3ce14 | 225 | { |
| ocomeni | 78:07bb86e3ce14 | 226 | strcpy(wifi_config.ssid, wifi_ssid); |
| ocomeni | 82:10072c1794d3 | 227 | printf("[WIFI-MAN] wifi_ssid set to %s\n", wifi_config.ssid); |
| ocomeni | 82:10072c1794d3 | 228 | |
| ocomeni | 78:07bb86e3ce14 | 229 | } |
| ocomeni | 79:a2187bbfa407 | 230 | |
| ocomeni | 79:a2187bbfa407 | 231 | |
| ocomeni | 78:07bb86e3ce14 | 232 | void WiFiManager::set_WIFI_PASSWORD(char * wifi_pass) |
| ocomeni | 78:07bb86e3ce14 | 233 | { |
| ocomeni | 78:07bb86e3ce14 | 234 | strcpy(wifi_config.pass, wifi_pass); |
| ocomeni | 82:10072c1794d3 | 235 | printf("[WIFI-MAN] wifi_pass set to %s\n", wifi_config.pass); |
| ocomeni | 78:07bb86e3ce14 | 236 | } |
| ocomeni | 79:a2187bbfa407 | 237 | |
| ocomeni | 79:a2187bbfa407 | 238 | |
| ocomeni | 78:07bb86e3ce14 | 239 | void WiFiManager::set_WIFI_SECURITY(nsapi_security_t wifi_security) |
| ocomeni | 78:07bb86e3ce14 | 240 | { |
| ocomeni | 78:07bb86e3ce14 | 241 | wifi_config.security = wifi_security; |
| ocomeni | 82:10072c1794d3 | 242 | printf("[WIFI-MAN] wifi_security set to %s\n", sec2str(wifi_config.security)); |
| ocomeni | 78:07bb86e3ce14 | 243 | } |
| ocomeni | 79:a2187bbfa407 | 244 | |
| ocomeni | 79:a2187bbfa407 | 245 | |
| ocomeni | 81:637a87eb8170 | 246 | |
| ocomeni | 81:637a87eb8170 | 247 | void WiFiManager::set_internet_config() |
| ocomeni | 81:637a87eb8170 | 248 | { |
| ocomeni | 81:637a87eb8170 | 249 | internet_config_t *internet_cfg = (internet_config_t *) data_msg->buffer; |
| ocomeni | 81:637a87eb8170 | 250 | internet_config.peer_id = internet_cfg->peer_id; |
| ocomeni | 84:7c7add00f4bf | 251 | strncpy(internet_config.url,internet_cfg->url, strlen(internet_cfg->url)+1); |
| ocomeni | 81:637a87eb8170 | 252 | internet_config.connectionScheme = internet_cfg->connectionScheme; |
| ocomeni | 81:637a87eb8170 | 253 | free_DataMsg(); |
| ocomeni | 81:637a87eb8170 | 254 | printf("[WIFI MAN] Internet configuration setup completed\n"); |
| ocomeni | 81:637a87eb8170 | 255 | printf("peer_id = %1d, url = %s, connScheme = %1d\n", internet_config.peer_id, |
| ocomeni | 84:7c7add00f4bf | 256 | internet_config.url, |
| ocomeni | 81:637a87eb8170 | 257 | internet_config.connectionScheme); |
| ocomeni | 81:637a87eb8170 | 258 | } |
| ocomeni | 81:637a87eb8170 | 259 | |
| ocomeni | 81:637a87eb8170 | 260 | void WiFiManager::free_DataMsg() |
| ocomeni | 81:637a87eb8170 | 261 | { |
| ocomeni | 81:637a87eb8170 | 262 | // free memory after processing |
| ocomeni | 81:637a87eb8170 | 263 | _aT2WiFiDatamPool->free(data_msg); |
| ocomeni | 81:637a87eb8170 | 264 | } |
| ocomeni | 81:637a87eb8170 | 265 | |
| ocomeni | 81:637a87eb8170 | 266 | |
| ocomeni | 81:637a87eb8170 | 267 | void WiFiManager::status_callback(nsapi_event_t status, intptr_t param) |
| ocomeni | 81:637a87eb8170 | 268 | { |
| ocomeni | 81:637a87eb8170 | 269 | //if (status == NSAPI_EVENT_CONNECTION_STATUS_CHANGE) { |
| ocomeni | 81:637a87eb8170 | 270 | //} |
| ocomeni | 81:637a87eb8170 | 271 | switch(param) { |
| ocomeni | 81:637a87eb8170 | 272 | case NSAPI_STATUS_LOCAL_UP: |
| ocomeni | 81:637a87eb8170 | 273 | printf("[WIFI-MAN] Local IP address set!\r\n"); |
| ocomeni | 81:637a87eb8170 | 274 | printf("[WIFI-MAN] IP address: %s\n", network->get_ip_address()); |
| ocomeni | 81:637a87eb8170 | 275 | break; |
| ocomeni | 81:637a87eb8170 | 276 | case NSAPI_STATUS_GLOBAL_UP: |
| ocomeni | 81:637a87eb8170 | 277 | printf("Global IP address set!\r\n"); |
| ocomeni | 81:637a87eb8170 | 278 | printf("[WIFI-MAN] IP address: %s\n", network->get_ip_address()); |
| ocomeni | 81:637a87eb8170 | 279 | printf("[WIFI-MAN] Connected to the network %s\n", wifi_config.ssid); |
| ocomeni | 81:637a87eb8170 | 280 | is_connected = true; |
| ocomeni | 81:637a87eb8170 | 281 | break; |
| ocomeni | 81:637a87eb8170 | 282 | case NSAPI_STATUS_DISCONNECTED: |
| ocomeni | 81:637a87eb8170 | 283 | printf("No connection to network!\r\n"); |
| ocomeni | 81:637a87eb8170 | 284 | printf("\n [WIFI-MAN] No connection to network!\n"); |
| ocomeni | 81:637a87eb8170 | 285 | is_connected = false; |
| ocomeni | 81:637a87eb8170 | 286 | //queueATresponse(AT_DISCONNECT_RESP); |
| ocomeni | 81:637a87eb8170 | 287 | // attempt reconnection if always connected scheme is set |
| ocomeni | 81:637a87eb8170 | 288 | if(internet_config.connectionScheme == ALWAYS_CONNECTED) |
| ocomeni | 81:637a87eb8170 | 289 | { |
| ocomeni | 81:637a87eb8170 | 290 | nsapi_error_t error; |
| ocomeni | 81:637a87eb8170 | 291 | error = scanNetworks(); |
| ocomeni | 81:637a87eb8170 | 292 | queueATresponse(WIFI_RECONNECT_INFO); |
| ocomeni | 81:637a87eb8170 | 293 | } |
| ocomeni | 81:637a87eb8170 | 294 | break; |
| ocomeni | 81:637a87eb8170 | 295 | case NSAPI_STATUS_CONNECTING: |
| ocomeni | 81:637a87eb8170 | 296 | printf("Connecting to network!\r\n"); |
| ocomeni | 81:637a87eb8170 | 297 | break; |
| ocomeni | 81:637a87eb8170 | 298 | default: |
| ocomeni | 81:637a87eb8170 | 299 | printf("Not supported"); |
| ocomeni | 81:637a87eb8170 | 300 | break; |
| ocomeni | 81:637a87eb8170 | 301 | } |
| ocomeni | 81:637a87eb8170 | 302 | } |
| ocomeni | 81:637a87eb8170 | 303 | |
| ocomeni | 81:637a87eb8170 | 304 | |
| ocomeni | 81:637a87eb8170 | 305 | |
| ocomeni | 79:a2187bbfa407 | 306 | // NSAPI_STATUS_LOCAL_UP = 0, /*!< local IP address set */ |
| ocomeni | 79:a2187bbfa407 | 307 | // NSAPI_STATUS_GLOBAL_UP = 1, /*!< global IP address set */ |
| ocomeni | 79:a2187bbfa407 | 308 | // NSAPI_STATUS_DISCONNECTED = 2, /*!< no connection to network */ |
| ocomeni | 79:a2187bbfa407 | 309 | // NSAPI_STATUS_CONNECTING = 3, /*!< connecting to network */ |
| ocomeni | 79:a2187bbfa407 | 310 | // NSAPI_STATUS_ERROR_UNSUPPORTED = NSAPI_ERROR_UNSUPPORTED |
| ocomeni | 79:a2187bbfa407 | 311 | |
| ocomeni | 79:a2187bbfa407 | 312 | nsapi_error_t WiFiManager::connect() |
| ocomeni | 79:a2187bbfa407 | 313 | { |
| ocomeni | 79:a2187bbfa407 | 314 | nsapi_error_t error; |
| ocomeni | 81:637a87eb8170 | 315 | printf("\n [WIFI-MAN] About to connect to WiFi network\n"); |
| ocomeni | 81:637a87eb8170 | 316 | network->attach(callback(this, &WiFiManager::status_callback)); |
| ocomeni | 79:a2187bbfa407 | 317 | error = network->set_blocking(false); |
| ocomeni | 79:a2187bbfa407 | 318 | if(error) |
| ocomeni | 79:a2187bbfa407 | 319 | { |
| ocomeni | 79:a2187bbfa407 | 320 | printf("\n [WIFI-MAN] Could not set non-blocking mode for Wifi -- aborting!! - \n"); |
| ocomeni | 79:a2187bbfa407 | 321 | return error; |
| ocomeni | 79:a2187bbfa407 | 322 | } |
| ocomeni | 81:637a87eb8170 | 323 | printf("[WIFI-MAN] Connecting to network %s\n", wifi_config.ssid); |
| ocomeni | 79:a2187bbfa407 | 324 | error = network->connect(wifi_config.ssid, |
| ocomeni | 79:a2187bbfa407 | 325 | wifi_config.pass, |
| ocomeni | 79:a2187bbfa407 | 326 | wifi_config.security); |
| ocomeni | 81:637a87eb8170 | 327 | return error; |
| ocomeni | 79:a2187bbfa407 | 328 | } |
| ocomeni | 79:a2187bbfa407 | 329 | |
| ocomeni | 79:a2187bbfa407 | 330 | |
| ocomeni | 79:a2187bbfa407 | 331 | nsapi_error_t WiFiManager::disconnect() |
| ocomeni | 78:07bb86e3ce14 | 332 | { |
| ocomeni | 79:a2187bbfa407 | 333 | nsapi_error_t error; |
| ocomeni | 79:a2187bbfa407 | 334 | error = network->disconnect(); |
| ocomeni | 79:a2187bbfa407 | 335 | return error; |
| ocomeni | 78:07bb86e3ce14 | 336 | } |
| ocomeni | 79:a2187bbfa407 | 337 | |
| ocomeni | 79:a2187bbfa407 | 338 | |
| ocomeni | 79:a2187bbfa407 | 339 | |
| ocomeni | 84:7c7add00f4bf | 340 | void WiFiManager::return_response(HttpResponse* res) { |
| ocomeni | 84:7c7add00f4bf | 341 | |
| ocomeni | 84:7c7add00f4bf | 342 | //queueWiFiDataResponse(at_data_msg_t at_data_resp); |
| ocomeni | 87:99b37d26ff2a | 343 | |
| ocomeni | 84:7c7add00f4bf | 344 | at_data_msg_t at_data_resp; |
| ocomeni | 87:99b37d26ff2a | 345 | int numChars = 0; |
| ocomeni | 87:99b37d26ff2a | 346 | // create message pointer for response header generation |
| ocomeni | 87:99b37d26ff2a | 347 | char * msgPtr = (char *)at_data_resp.buffer; |
| ocomeni | 87:99b37d26ff2a | 348 | // do status line |
| ocomeni | 87:99b37d26ff2a | 349 | numChars = sprintf(msgPtr, "HTTP/1.1 %d %s\r\n", res->get_status_code(), res->get_status_message().c_str()); |
| ocomeni | 87:99b37d26ff2a | 350 | msgPtr += numChars; |
| ocomeni | 84:7c7add00f4bf | 351 | //at_data_resp = &at_data; |
| ocomeni | 87:99b37d26ff2a | 352 | at_data_resp.dataLen = sizeof(*res); // start with minimum size of response |
| ocomeni | 84:7c7add00f4bf | 353 | for (size_t ix = 0; ix < res->get_headers_length(); ix++) { |
| ocomeni | 87:99b37d26ff2a | 354 | numChars = sprintf(msgPtr, "%s: %s\r\n", |
| ocomeni | 87:99b37d26ff2a | 355 | res->get_headers_fields()[ix]->c_str(), |
| ocomeni | 87:99b37d26ff2a | 356 | res->get_headers_values()[ix]->c_str()); |
| ocomeni | 87:99b37d26ff2a | 357 | msgPtr += numChars; |
| ocomeni | 84:7c7add00f4bf | 358 | } |
| ocomeni | 87:99b37d26ff2a | 359 | numChars = sprintf(msgPtr, "\r\n\r\n"); |
| ocomeni | 87:99b37d26ff2a | 360 | msgPtr += numChars; |
| ocomeni | 87:99b37d26ff2a | 361 | strncpy(msgPtr, res->get_body_as_string().c_str(), res->get_body_length()+1); |
| ocomeni | 87:99b37d26ff2a | 362 | // print out generated header |
| ocomeni | 87:99b37d26ff2a | 363 | printf("generated response:\n"); |
| ocomeni | 87:99b37d26ff2a | 364 | printf("%s\r\n", (char *)at_data_resp.buffer); |
| ocomeni | 87:99b37d26ff2a | 365 | //printf("\nBody (%lu bytes):\n\n%s\n", res->get_body_length(), res->get_body_as_string().c_str()); |
| ocomeni | 87:99b37d26ff2a | 366 | at_data_resp.dataLen = (msgPtr - (char *)at_data_resp.buffer) + res->get_body_length(); |
| ocomeni | 84:7c7add00f4bf | 367 | //printf("WIFI MAN]: wifi_cfg.security = %s\n", sec2str(wifi_cfg.security)); |
| ocomeni | 84:7c7add00f4bf | 368 | // package and send on wifi data queue |
| ocomeni | 84:7c7add00f4bf | 369 | |
| ocomeni | 84:7c7add00f4bf | 370 | at_data_resp.at_resp = AT_HTTPS_RESP; |
| ocomeni | 84:7c7add00f4bf | 371 | //at_data_resp.at_data_resp = sizeof(wifi_config_t); |
| ocomeni | 87:99b37d26ff2a | 372 | //memcpy(at_data_resp.buffer, res, at_data_resp.dataLen); |
| ocomeni | 84:7c7add00f4bf | 373 | queueWiFiDataResponse(at_data_resp); |
| ocomeni | 87:99b37d26ff2a | 374 | |
| ocomeni | 87:99b37d26ff2a | 375 | delete res; |
| ocomeni | 79:a2187bbfa407 | 376 | |
| ocomeni | 84:7c7add00f4bf | 377 | } |
| ocomeni | 87:99b37d26ff2a | 378 | #define TRY_PRINTF |
| ocomeni | 84:7c7add00f4bf | 379 | |
| ocomeni | 84:7c7add00f4bf | 380 | void WiFiManager::body_callback(const char *at, uint32_t length) { |
| ocomeni | 84:7c7add00f4bf | 381 | |
| ocomeni | 84:7c7add00f4bf | 382 | printf("\n Chunked response: Chunk %d : Total Bytes = %d\n", chunkNum , length); |
| ocomeni | 84:7c7add00f4bf | 383 | //device->printf("\n Try Print Header as string:\n\n "); |
| ocomeni | 84:7c7add00f4bf | 384 | //device->printf("recv %d [%.*s]\n", length, strstr((char *)at, "\r\n")-(char *)at, (char *)at); |
| ocomeni | 84:7c7add00f4bf | 385 | //if(false) |
| ocomeni | 84:7c7add00f4bf | 386 | //if(chunkNum < 2) |
| ocomeni | 84:7c7add00f4bf | 387 | //for(int i=0; i < length; i++){ |
| ocomeni | 84:7c7add00f4bf | 388 | // |
| ocomeni | 84:7c7add00f4bf | 389 | //putc((uint8_t)at[i]); |
| ocomeni | 84:7c7add00f4bf | 390 | //int resp = write( (const uint8_t *)at, (int) length, &completed, SERIAL_EVENT_TX_COMPLETE); |
| ocomeni | 84:7c7add00f4bf | 391 | //} |
| ocomeni | 84:7c7add00f4bf | 392 | //if(false) |
| ocomeni | 84:7c7add00f4bf | 393 | if(chunkNum < 2) |
| ocomeni | 84:7c7add00f4bf | 394 | for (size_t ix = 0; ix < length; ix++) { |
| ocomeni | 84:7c7add00f4bf | 395 | printf("%02X: ", (uint8_t)at[ix]); |
| ocomeni | 84:7c7add00f4bf | 396 | if((ix % 32) == 0 and ix) |
| ocomeni | 84:7c7add00f4bf | 397 | printf("\n"); |
| ocomeni | 84:7c7add00f4bf | 398 | } |
| ocomeni | 87:99b37d26ff2a | 399 | #ifdef TRY_PRINTF |
| ocomeni | 87:99b37d26ff2a | 400 | printf("%s\n", at); |
| ocomeni | 87:99b37d26ff2a | 401 | #endif |
| ocomeni | 87:99b37d26ff2a | 402 | |
| ocomeni | 84:7c7add00f4bf | 403 | printf("\n\n"); |
| ocomeni | 84:7c7add00f4bf | 404 | chunkNum++; |
| ocomeni | 84:7c7add00f4bf | 405 | } |
| ocomeni | 84:7c7add00f4bf | 406 | |
| ocomeni | 84:7c7add00f4bf | 407 | void WiFiManager::createHttpsRequest() |
| ocomeni | 79:a2187bbfa407 | 408 | { |
| ocomeni | 87:99b37d26ff2a | 409 | // reset chunk #; |
| ocomeni | 87:99b37d26ff2a | 410 | chunkNum = 0; |
| ocomeni | 84:7c7add00f4bf | 411 | printf("\n[WIFI MAN] Http Request received:"); |
| ocomeni | 84:7c7add00f4bf | 412 | http_req_cfg = (http_request_t *) data_msg->buffer; |
| ocomeni | 85:9f896e1e041c | 413 | printf("\n[WIFI MAN] uri = %s", http_req_cfg->request_URI.c_str()); |
| ocomeni | 87:99b37d26ff2a | 414 | printf("\n[WIFI MAN] internet cfg url = %s", internet_config.url); |
| ocomeni | 87:99b37d26ff2a | 415 | char full_url[100]; |
| ocomeni | 87:99b37d26ff2a | 416 | strncpy(full_url,internet_config.url, strlen(internet_config.url)+1); |
| ocomeni | 87:99b37d26ff2a | 417 | printf("\n[WIFI MAN] server url = %s\n", full_url); |
| ocomeni | 87:99b37d26ff2a | 418 | //strncat(internet_config.url, http_req_cfg->request_URI.c_str(), http_req_cfg->request_URI.size()); |
| ocomeni | 87:99b37d26ff2a | 419 | strncat(full_url, http_req_cfg->request_URI.c_str(), http_req_cfg->request_URI.size()); |
| ocomeni | 87:99b37d26ff2a | 420 | //printf("\n[WIFI MAN] server url = %s\n", internet_config.url); |
| ocomeni | 87:99b37d26ff2a | 421 | printf("\n[WIFI MAN] server url+uri = %s\n", full_url); |
| ocomeni | 87:99b37d26ff2a | 422 | printf("\n[WIFI MAN] Host = %s\n", http_req_cfg->hostName.c_str()); |
| ocomeni | 87:99b37d26ff2a | 423 | printf("\n[WIFI MAN] Accept = %s\n", http_req_cfg->AcceptVal.c_str()); |
| ocomeni | 87:99b37d26ff2a | 424 | printf("\n[WIFI MAN] Content-Type = %s\n", http_req_cfg->contentType.c_str()); |
| ocomeni | 86:04fc2fcda7ec | 425 | printf("\n[WIFI MAN] contentLenstr = %s\n", http_req_cfg->contentLen.c_str()); |
| ocomeni | 84:7c7add00f4bf | 426 | //printf("\n[WIFI MAN] server url = %s\n", internet_config.url.c_str()); |
| ocomeni | 84:7c7add00f4bf | 427 | //const char* url = internet_config.url; |
| ocomeni | 84:7c7add00f4bf | 428 | |
| ocomeni | 87:99b37d26ff2a | 429 | print_memory_info(); |
| ocomeni | 86:04fc2fcda7ec | 430 | // http_request = new HttpRequest(network, |
| ocomeni | 87:99b37d26ff2a | 431 | // http_request = new HttpRequest(network, |
| ocomeni | 84:7c7add00f4bf | 432 | int bodyLen; |
| ocomeni | 84:7c7add00f4bf | 433 | sscanf(http_req_cfg->contentLen.c_str(), "%d", &bodyLen); |
| ocomeni | 86:04fc2fcda7ec | 434 | printf("contenLenstr = %s bodyLen = %d\n", http_req_cfg->contentLen.c_str(), bodyLen); |
| ocomeni | 87:99b37d26ff2a | 435 | if(strstr(internet_config.url, "http:")!=NULL) // http request |
| ocomeni | 87:99b37d26ff2a | 436 | { |
| ocomeni | 87:99b37d26ff2a | 437 | http_request = new HttpRequest(network, |
| ocomeni | 87:99b37d26ff2a | 438 | //SSL_CA_PEM, |
| ocomeni | 87:99b37d26ff2a | 439 | http_req_cfg->method, |
| ocomeni | 87:99b37d26ff2a | 440 | internet_config.url, |
| ocomeni | 87:99b37d26ff2a | 441 | callback(this, &WiFiManager::body_callback)); |
| ocomeni | 87:99b37d26ff2a | 442 | setHttpHeader("Host", http_req_cfg->hostName); |
| ocomeni | 87:99b37d26ff2a | 443 | setHttpHeader("Accept", http_req_cfg->AcceptVal); |
| ocomeni | 87:99b37d26ff2a | 444 | setHttpHeader("Content-Type", http_req_cfg->contentType); |
| ocomeni | 87:99b37d26ff2a | 445 | setHttpHeader("Content-Length", http_req_cfg->contentLen); |
| ocomeni | 87:99b37d26ff2a | 446 | http_response = http_request->send(http_req_cfg->body, bodyLen); |
| ocomeni | 87:99b37d26ff2a | 447 | free_DataMsg(); |
| ocomeni | 87:99b37d26ff2a | 448 | if (!http_response) { |
| ocomeni | 87:99b37d26ff2a | 449 | char buf[100]; |
| ocomeni | 87:99b37d26ff2a | 450 | mbedtls_strerror(http_request->get_error(), buf, 100); |
| ocomeni | 87:99b37d26ff2a | 451 | printf("HttpRequest failed (error code %s)\n", buf); |
| ocomeni | 87:99b37d26ff2a | 452 | //printf("HttpsRequest failed (error code %d)\n", https_request->get_error()); |
| ocomeni | 87:99b37d26ff2a | 453 | delete http_request; // free the memory |
| ocomeni | 87:99b37d26ff2a | 454 | return; |
| ocomeni | 87:99b37d26ff2a | 455 | } |
| ocomeni | 87:99b37d26ff2a | 456 | printf("\n----- HTTP POST response -----\n"); |
| ocomeni | 84:7c7add00f4bf | 457 | } |
| ocomeni | 87:99b37d26ff2a | 458 | else |
| ocomeni | 87:99b37d26ff2a | 459 | { |
| ocomeni | 87:99b37d26ff2a | 460 | https_request = new HttpsRequest(network, |
| ocomeni | 87:99b37d26ff2a | 461 | SSL_CA_PEM, |
| ocomeni | 87:99b37d26ff2a | 462 | http_req_cfg->method, |
| ocomeni | 87:99b37d26ff2a | 463 | internet_config.url, |
| ocomeni | 87:99b37d26ff2a | 464 | callback(this, &WiFiManager::body_callback)); |
| ocomeni | 87:99b37d26ff2a | 465 | |
| ocomeni | 87:99b37d26ff2a | 466 | setHttpsHeader("Host", http_req_cfg->hostName); |
| ocomeni | 87:99b37d26ff2a | 467 | setHttpsHeader("Accept", http_req_cfg->AcceptVal); |
| ocomeni | 87:99b37d26ff2a | 468 | setHttpsHeader("Content-Type", http_req_cfg->contentType); |
| ocomeni | 87:99b37d26ff2a | 469 | setHttpsHeader("Content-Length", http_req_cfg->contentLen); |
| ocomeni | 87:99b37d26ff2a | 470 | http_response = https_request->send(http_req_cfg->body, bodyLen); |
| ocomeni | 87:99b37d26ff2a | 471 | free_DataMsg(); |
| ocomeni | 87:99b37d26ff2a | 472 | if (!http_response) { |
| ocomeni | 87:99b37d26ff2a | 473 | char buf[100]; |
| ocomeni | 87:99b37d26ff2a | 474 | mbedtls_strerror(https_request->get_error(), buf, 100); |
| ocomeni | 87:99b37d26ff2a | 475 | printf("HttpRequest failed (error code %s)\n", buf); |
| ocomeni | 87:99b37d26ff2a | 476 | //printf("HttpsRequest failed (error code %d)\n", https_request->get_error()); |
| ocomeni | 87:99b37d26ff2a | 477 | delete https_request; // free the memory |
| ocomeni | 87:99b37d26ff2a | 478 | return; |
| ocomeni | 87:99b37d26ff2a | 479 | } |
| ocomeni | 87:99b37d26ff2a | 480 | printf("\n----- HTTPS POST response -----\r\n"); |
| ocomeni | 87:99b37d26ff2a | 481 | } |
| ocomeni | 84:7c7add00f4bf | 482 | return_response(http_response); |
| ocomeni | 79:a2187bbfa407 | 483 | } |
| ocomeni | 79:a2187bbfa407 | 484 | |
| ocomeni | 79:a2187bbfa407 | 485 | void WiFiManager::createHttpRequest(http_method method, |
| ocomeni | 79:a2187bbfa407 | 486 | const char* url, |
| ocomeni | 79:a2187bbfa407 | 487 | Callback<void(const char *at, uint32_t length)> body_callback) |
| ocomeni | 79:a2187bbfa407 | 488 | { |
| ocomeni | 84:7c7add00f4bf | 489 | http_request = new HttpRequest(network, |
| ocomeni | 84:7c7add00f4bf | 490 | method, url, body_callback);; |
| ocomeni | 79:a2187bbfa407 | 491 | } |
| ocomeni | 79:a2187bbfa407 | 492 | |
| ocomeni | 79:a2187bbfa407 | 493 | void WiFiManager::setHttpHeader(string key, string value) |
| ocomeni | 79:a2187bbfa407 | 494 | { |
| ocomeni | 79:a2187bbfa407 | 495 | http_request->set_header(key, value); |
| ocomeni | 79:a2187bbfa407 | 496 | } |
| ocomeni | 79:a2187bbfa407 | 497 | |
| ocomeni | 79:a2187bbfa407 | 498 | void WiFiManager::setHttpsHeader(string key, string value) |
| ocomeni | 79:a2187bbfa407 | 499 | { |
| ocomeni | 79:a2187bbfa407 | 500 | https_request->set_header(key, value); |
| ocomeni | 79:a2187bbfa407 | 501 | } |
| ocomeni | 79:a2187bbfa407 | 502 | |
| ocomeni | 79:a2187bbfa407 | 503 | void WiFiManager::sendHttpsRequest(const char * body, int bodyLen) |
| ocomeni | 78:07bb86e3ce14 | 504 | { |
| ocomeni | 78:07bb86e3ce14 | 505 | } |
| ocomeni | 79:a2187bbfa407 | 506 | |
| ocomeni | 79:a2187bbfa407 | 507 | void WiFiManager::sendHttpRequest(const char * body, int bodyLen) |
| ocomeni | 78:07bb86e3ce14 | 508 | { |
| ocomeni | 78:07bb86e3ce14 | 509 | } |
| ocomeni | 79:a2187bbfa407 | 510 |