RC
Dependents: WizFi250_AP_HelloWorld
Fork of WizFi250Interface by
Diff: WizFi250/WizFi250_at.cpp
- Revision:
- 5:8a0702aa91e3
- Parent:
- 4:085e7efeae47
- Child:
- 7:ba28fe711055
--- a/WizFi250/WizFi250_at.cpp Fri Nov 14 15:10:33 2014 +0900 +++ b/WizFi250/WizFi250_at.cpp Fri Nov 14 15:14:56 2014 +0900 @@ -122,7 +122,7 @@ clearFlags(); _state.res = res; - INFO("command: '%s'", cmd) + WIZ_INFO("%s", cmd) for (i=0; i< strlen(cmd); i++) { putUart(cmd[i]); @@ -153,7 +153,7 @@ } if (_state.failure || t.read_ms() > timeout) { - WARN("failure of timeout[%d]ms\r\n",t.read_ms()); + WIZ_WARN("failure of timeout[%d]ms\r\n",t.read_ms()); _state.res = RES_NULL; return -1; } @@ -162,7 +162,7 @@ t.stop(); } - INFO("ok\r\n"); + WIZ_INFO("[OK]\r\n"); _state.res = RES_NULL; return 0; @@ -174,9 +174,6 @@ resp = sendCommand("AT"); - DBG("%s",_state.dummyBuf); - memset(_state.dummyBuf,0,sizeof(_state.dummyBuf)); - return resp; //return sendCommand("AT"); @@ -191,7 +188,6 @@ sprintf(cmd,"AT+MECHO=%d",flg); status = sendCommand(cmd); - DBG("%s",_state.dbgRespBuf); return status; } @@ -272,8 +268,11 @@ { sendCommand("AT+WJOIN", RES_WJOIN, CFG_TIMEOUT); - DBG("IP : %s",_state.ip); - DBG("Gateway : %s",_state.gateway); + if( sendCommand("AT+WJOIN", RES_WJOIN, CFG_JOIN_TIMEOUT) ) return -1; + + WIZ_INFO("IP : %s",_state.ip); + WIZ_INFO("Gateway : %s",_state.gateway); + WIZ_INFO("WizFi250 is successfully join to AP"); return 0; } @@ -298,7 +297,7 @@ sprintf(cmd,"AT+SCON=%s,%s,%s,%d,%d,%s",openType, socketType, remoteIp, remotePort, localPort, dataMode); resp = sendCommand(cmd, RES_CONNECT, 5000 ); - DBG("Create CID : %s",_state.dummyBuf); + WIZ_DBG("Create CID : %s",_state.dummyBuf); return resp; } @@ -327,7 +326,7 @@ resp = sendCommand(cmd, RES_SSEND, 2000, 1); unlockUart(); if(resp){ - DBG("Fail cmdSSEND") + WIZ_DBG("Fail cmdSSEND") return -1; } @@ -345,14 +344,14 @@ if (_state.ok) break; if (_state.failure || t.read_ms() > Timeout) { - WARN("failure or timeout\r\n"); + WIZ_WARN("failure or timeout\r\n"); return -1; } } t.stop(); } - //INFO("data: '%s' size : %d\r\n",data, sendSize); + //WIZ_INFO("data: '%s' size : %d\r\n",data, sendSize); return i; } @@ -375,7 +374,7 @@ sprintf(cmd,"AT+FDNS=%s,1000",host); resp = sendCommand(cmd, RES_FDNS, CFG_TIMEOUT); - DBG("%s",_state.resolv); + WIZ_DBG("%s",_state.resolv); return resp; }