Okundu Omeni
/
wifi-https-ble-sm-uart-atcmd-5-13-1
this is using the mbed os version 5-13-1
Diff: source/ATCmdManager.cpp
- Revision:
- 85:9f896e1e041c
- Parent:
- 84:7c7add00f4bf
- Child:
- 86:04fc2fcda7ec
--- a/source/ATCmdManager.cpp Thu Mar 28 22:13:06 2019 +0000 +++ b/source/ATCmdManager.cpp Thu Mar 28 23:03:33 2019 +0000 @@ -245,12 +245,14 @@ // package and send on wifi data queue wifi_data_msg_t data_msg; data_msg.wifi_cmd = WIFI_CMD_SEND_HTTPS_REQ; - data_msg.dataLen = sizeof(http_req) + http_req.request_URI.length() + - http_req.http_version.length() + - http_req.hostName.length() + - http_req.AcceptVal.length() + - http_req.contentType.length() + - http_req.contentLen.length(); + data_msg.dataLen = sizeof(http_req.method) + + sizeof(http_req.body) + + http_req.request_URI.capacity() + + http_req.http_version.capacity() + + http_req.hostName.capacity() + + http_req.AcceptVal.capacity() + + http_req.contentType.capacity() + + http_req.contentLen.capacity(); memcpy(data_msg.buffer,&http_req, data_msg.dataLen); // queue next data request queueWiFiDataRequest(data_msg); @@ -568,16 +570,12 @@ void ATCmdManager::_oob_setupInternetConnection() { - ////print_memory_info(); - char str[200]; // = (char *) malloc(200); - char url[60]; // = (char *) malloc(60); + char str[200]; + char url[60]; int n; - //internet_config_t *internet_config = (internet_config_t *) malloc(sizeof(internet_config_t)); internet_config_t internet_config; + //_smutex.lock(); printf("sizeof internet_config_t = %d\n", sizeof(internet_config_t)); - //internet_config->url; - //internet_config->url; - //_smutex.lock(); n = ReadBytes((uint8_t *)str, 199); str[n]=NULL; printf("\n read string = %s , n = %d\n", str, n); @@ -588,28 +586,15 @@ printf("\n read string = %s , n = %d -- strlen(url) = %d\n", internet_config.url, n, strlen(url)); if(n>0) { - //printf("before assign - still ok\n"); - //internet_config.url.append(url); - //printf("after assign - still ok\n"); - //print_all_thread_info(); - //print_memory_info(); - //internet_config->url->assign(url); - ////print_memory_info(); printf("peer_id = %1d, url = %s, connScheme = %1d\n", internet_config.peer_id, internet_config.url, ///->c_str(), internet_config.connectionScheme); - //print_memory_info(); // package and send on wifi data queue wifi_data_msg_t data_msg; // = (wifi_data_msg_t *) malloc(sizeof(wifi_data_msg_t)); data_msg.wifi_cmd = WIFI_CMD_INTERNET_CONFIG; data_msg.dataLen = sizeof(internet_config_t); // + strlen(internet_config.url); printf("\n url size = %d url str = %s\n",strlen(internet_config.url), internet_config.url ); memcpy(data_msg.buffer,&internet_config, data_msg.dataLen); - //print_memory_info(); - //free(internet_config->url); - //free(internet_config); - //free(str); - //free(url); // queue next data request queueWiFiDataRequest(data_msg); print_memory_info();