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
- Revision:
- 92:ec9550034276
- Parent:
- 91:d6b6319ad681
- Child:
- 93:06e755a80187
--- a/source/WiFiManager.cpp Sun Apr 07 17:31:56 2019 +0000 +++ b/source/WiFiManager.cpp Sat Apr 13 14:17:29 2019 +0000 @@ -41,7 +41,11 @@ } bool WiFiManager::queueATresponse(at_cmd_resp_t resp){ +#ifndef USE_MALLOC_FOR_COMMAND_MEMORY_POOL at_resp_message_t *atResp = _wiFi2ATmPool->alloc(); +#else + at_resp_message_t *atResp = (at_resp_message_t *) malloc(sizeof(at_resp_message_t)); +#endif if(atResp == NULL) return false; // queue full; atResp->at_resp = resp; _wiFi2ATCmdQueue->put(atResp); @@ -154,7 +158,11 @@ if(evt.status == osEventMessage){ wifi_cmd_message_t *cmd = (wifi_cmd_message_t*)evt.value.p; setNextCommand(cmd->wifi_cmd); +#ifndef USE_MALLOC_FOR_COMMAND_MEMORY_POOL _aT2WiFimPool->free(cmd); +#else + free(cmd); +#endif } return true; } @@ -174,11 +182,12 @@ bool WiFiManager::setNextCommand(wifi_cmd_t cmd) { - printf("\n [WIFI-MAN] About to set next WiFi manager command \n"); + printf("\n [WIFI-MAN] About to set next WiFi manager command to %d\n", cmd); if(wifiCmd == WIFI_CMD_NONE){ wifiCmd = cmd; return true; // success } + printf("\n [WIFI-MAN] Busy : current state = %d \n", wifiCmd); return false; // wiFiManager busy } @@ -268,7 +277,7 @@ void WiFiManager::set_WIFI_PASSWORD(char * wifi_pass) { strcpy(wifi_config.pass, wifi_pass); - printf("[WIFI-MAN] wifi_pass set to %s\n", wifi_config.pass); + printf("[WIFI-MAN] wifi_pass set to %s\n", "****************"); https_connection_active = false; // reset whenever any of the security credentials change delete socket; }