Okundu Omeni
/
wifi-https-ble-sm-uart-atcmd-5-13-1
this is using the mbed os version 5-13-1
Diff: source/WiFiManager.cpp
- Branch:
- PassingRegression
- Revision:
- 106:e1f04c3d0647
- Parent:
- 105:e5ce023eee93
- Child:
- 107:f1a83fd41b17
--- a/source/WiFiManager.cpp Mon May 06 09:06:36 2019 +0000 +++ b/source/WiFiManager.cpp Mon May 06 10:24:53 2019 +0000 @@ -984,6 +984,8 @@ //#define DONT_USE_TLS_SOCKET bool WiFiManager::createHttpsRequest() { + int starttime; + int stoptime; // reset chunk #; chunkNum = 0; #ifdef MIX_HDR_AND_BODY @@ -1056,6 +1058,7 @@ mbed_stats_heap_t heap_stats; mbed_stats_heap_get(&heap_stats); dbg_printf(LOG, "Heap size: %lu / %lu bytes\r\n", heap_stats.current_size, heap_stats.reserved_size); + starttime = Kernel::get_ms_count(); #ifndef DONT_USE_TLS_SOCKET if(https_connection_active == false){ bool tlsResult; @@ -1063,6 +1066,8 @@ #ifdef ENABLE_MBED_TRACE mbed_trace_free(); // free trace memory #endif + stoptime = Kernel::get_ms_count(); + dbg_printf(LOG, "\r\nTLS connection time : %d ms\r\n", (stoptime - starttime)); if(tlsResult == false){ delete socket; dbg_printf(LOG, "TLS Socket connection failed - deleting data msg\r\n"); @@ -1086,6 +1091,9 @@ // Pass in `socket`, instead of `network` as first argument, and omit the `SSL_CA_PEM` argument //HttpsRequest* get_req = new HttpsRequest(socket, HTTP_GET, "https://httpbin.org/status/418"); //_wmutex.lock(); + stoptime = Kernel::get_ms_count(); + dbg_printf(LOG, "\r\nTLS connection time : %d ms\r\n", (stoptime - starttime)); + starttime = Kernel::get_ms_count(); https_request = new HttpsRequest(socket, http_req_cfg->method, full_url, @@ -1163,6 +1171,8 @@ dbg_printf(LOG, "deleted https_request\r\n"); https_request = NULL; http_result = RESPONSE_OK; + stoptime = Kernel::get_ms_count(); + dbg_printf(LOG, "\r\nhttp request to response time : %d ms\r\n", (stoptime - starttime)); return true; }