cmd handler stuff

This commit is contained in:
2020-11-16 13:51:16 +01:00
parent c9fa80f77f
commit 8c72ff1f16

View File

@ -32,6 +32,7 @@ void cmdHandlerEngine(void *handle) {
int32_t resultSend;
int16_t receivedOctets;
int32_t resultRecv;
uint8_t resultDisconnect;
if (isNetworkAvailable()) {
switch (state) {
@ -111,6 +112,20 @@ void cmdHandlerEngine(void *handle) {
}
break;
case 5:
coloredMsg(LOG_YELLOW, "che, client closing, close our end too");
resultDisconnect = disconnect(CMD_SOCK);
coloredMsg(LOG_YELLOW, "che, disconnect returns 0x%02x", resultDisconnect);
state = 6;
break;
case 6:
coloredMsg(LOG_YELLOW, "che, waiting after disconnect");
sockState = getSn_SR(CMD_SOCK);
coloredMsg(LOG_YELLOW, "che, sockState is 0x%02x", sockState);
break;
case 255:
coloredMsg(LOG_YELLOW, "che, error state, will stop here");
schDel(cmdHandlerEngine, NULL);