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:
- 100:80ef4bc31b7a
- Parent:
- 99:05398b3184f8
- Child:
- 102:9748f290a1a5
--- a/source/ATCmdManager.cpp Mon Apr 22 11:11:41 2019 +0000 +++ b/source/ATCmdManager.cpp Mon Apr 22 18:34:31 2019 +0000 @@ -229,6 +229,15 @@ at_resp = AT_RESP_NONE; break; } + case AT_EVENT: + { + // AT Event state + printf("\n [ATCMD MAN] AT EVENT RECEIVED!!\r\n"); + respStr = (char *) resp_data->buffer; + sendAtEvent(respStr); + at_resp = AT_RESP_NONE; + break; + } case AT_COMMAND_FAILED: { // AT_HTTP_RESP response state @@ -241,14 +250,14 @@ at_resp = AT_RESP_NONE; break; } - //default: - // UNKNOWN response state + default: + //UNKNOWN response state //_smutex.lock(); - //printf("\n [ATCMD MAN] UNKNOWN RESPONSE RECEIVED!!\r\n"); - //sendAtConfirmationFreeMpool(ERROR_RESP); //_parser.send(OK_RESP); + printf("\n [ATCMD MAN] UNKNOWN RESPONSE RECEIVED!!\r\n"); + sendAtConfirmationFreeMpool(ERROR_RESP); //_parser.send(OK_RESP); //_smutex.unlock(); - //at_resp = AT_RESP_NONE; - //break; + at_resp = AT_RESP_NONE; + break; } } @@ -1058,6 +1067,7 @@ if(evt.status == osEventMessage){ at_resp_message_t *resp = (at_resp_message_t*)evt.value.p; setNextResponse(resp->at_resp); + printf("[ATCMD MAN] dequeued AT CMD : at_resp = %d\n", resp->at_resp); #ifndef USE_MALLOC_FOR_COMMAND_MEMORY_POOL _wiFi2ATmPool->free(resp); resp = NULL; @@ -1093,7 +1103,7 @@ if(evt.status == osEventMessage){ resp_data = (at_data_msg_t*)evt.value.p; setNextResponse(resp_data->at_resp); - printf("[ATCMD MAN] dequeued data size = %d : at_resr = %d\n", resp_data->dataLen, resp_data->at_resp); + printf("[ATCMD MAN] dequeued data size = %d : at_resp = %d\n", resp_data->dataLen, resp_data->at_resp); _event_queue.call_in(10, &print_heap_and_isr_stack_info); //print_heap_and_isr_stack_info(); } @@ -1145,6 +1155,8 @@ break; } _smutex.unlock(); + _wiFi2ATDatamPool->free(resp_data); + resp_data = NULL; } @@ -1162,6 +1174,9 @@ outputEDMdata((const uint8_t *) buf, len, CONNECT_MSG_ID, EVENT_MSG_TYPE, WIFI_CHANNEL); break; } + _wiFi2ATDatamPool->free(resp_data); + resp_data = NULL; + }