Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix #22

Merged
merged 1 commit into from
Mar 8, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,331 changes: 574 additions & 757 deletions examples/Serial2Ethernet/EWARM54/Serial2Ethernet.dep

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<Windows>


<Wnd0>
<Wnd2>
<Tabs>
<Tab>
<Identity>TabID-12191-6165</Identity>
Expand All @@ -36,7 +36,7 @@
</Tab>
</Tabs>

<SelectedTab>0</SelectedTab></Wnd0><Wnd1>
<SelectedTab>0</SelectedTab></Wnd2><Wnd3>
<Tabs>
<Tab>
<Identity>TabID-11020-10486</Identity>
Expand All @@ -46,7 +46,7 @@
</Tab>
</Tabs>

<SelectedTab>0</SelectedTab></Wnd1></Windows>
<SelectedTab>0</SelectedTab></Wnd3></Windows>
<Editor>


Expand All @@ -59,7 +59,7 @@



<Top><Row0><Sizes><Toolbar-0156cb80><key>iaridepm.enu1</key></Toolbar-0156cb80></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>542</Bottom><Right>364</Right><x>-2</x><y>-2</y><xscreen>219</xscreen><yscreen>266</yscreen><sizeHorzCX>211799</sizeHorzCX><sizeHorzCY>341902</sizeHorzCY><sizeVertCX>353965</sizeVertCX><sizeVertCY>699229</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>191</Bottom><Right>1036</Right><x>-2</x><y>-2</y><xscreen>1038</xscreen><yscreen>193</yscreen><sizeHorzCX>1003868</sizeHorzCX><sizeHorzCY>248072</sizeHorzCY><sizeVertCX>211799</sizeVertCX><sizeVertCY>341902</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
<Top><Row0><Sizes><Toolbar-0146cb38><key>iaridepm.enu1</key></Toolbar-0146cb38></Sizes></Row0></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>542</Bottom><Right>364</Right><x>-2</x><y>-2</y><xscreen>219</xscreen><yscreen>266</yscreen><sizeHorzCX>211799</sizeHorzCX><sizeHorzCY>341902</sizeHorzCY><sizeVertCX>353965</sizeVertCX><sizeVertCY>699229</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>191</Bottom><Right>1036</Right><x>-2</x><y>-2</y><xscreen>1038</xscreen><yscreen>193</yscreen><sizeHorzCX>1003868</sizeHorzCX><sizeHorzCY>248072</sizeHorzCY><sizeVertCX>211799</sizeVertCX><sizeVertCY>341902</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

Expand Down
2 changes: 1 addition & 1 deletion examples/Serial2Ethernet/src/wizconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define DEFAULT_DNS_ADDR "168.126.63.1"

//------------------------------ Etc ------------------------------
#define WIZ_LOG_LEVEL 0 // 0: No print, 1: Error, 2: Error+Log, 3: Error+Log+Debug
#define WIZ_LOG_LEVEL 3//0 // 0: No print, 1: Error, 2: Error+Log, 3: Error+Log+Debug
//#define PRINT_TIME_LOG

#endif
Expand Down
61 changes: 32 additions & 29 deletions library/appmod/atcmd/atcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static void hdl_nsend(void);
static void hdl_nrecv(void);
static void hdl_nsock(void);
static void hdl_nopt(void);
#if 0
#if 0 // for wlan
static void hdl_wset(void);
static void hdl_wstat(void);
static void hdl_wscan(void);
Expand Down Expand Up @@ -110,6 +110,12 @@ void atc_init(void)
sockwatch_open(5, atc_async_cb);
sockwatch_open(6, atc_async_cb);
sockwatch_open(7, atc_async_cb);

printf("\r\n\r\n\r\n[W,0]\r\n");

// ToDo

printf("[S,0]\r\n");
}

/**
Expand Down Expand Up @@ -139,9 +145,7 @@ void atc_run(void)

atci.sendbuf[atci.worklen++] = recv_char;
if(atci.worklen >= atci.sendlen) { // �Է��� �Ϸ�Ǹ�
uint8 *ip = (atci.sendflag[0] == VAL_ENABLE) ? atci.sendip : NULL;
uint16 *port = (atci.sendflag[1] == VAL_ENABLE) ? &atci.sendport : NULL;
act_nsend(atci.sendsock, atci.sendbuf, atci.worklen, ip, port);
act_nsend(atci.sendsock, atci.sendbuf, atci.worklen, atci.sendip, &atci.sendport);
atci.sendsock = VAL_NONE;
}
return;
Expand Down Expand Up @@ -416,6 +420,9 @@ void cmd_resp_dump(int8 idval, int8 *dump)
} else {
if(idval == VAL_NONE) printf("[D,,%d]\r\n%s\r\n", len, dump);
else printf("[D,%d,%d]\r\n%s\r\n", idval, len, dump);
DBG("going to free");
MEM_FREE(dump);
DBG("free done");
}
}

Expand Down Expand Up @@ -615,7 +622,7 @@ static void hdl_nmac(void)

static void hdl_nopen(void)
{
int8 type=0, save=0;
int8 type=0;
uint8 DstIP[4], *dip = NULL;
uint16 SrcPort, DstPort = 0;

Expand Down Expand Up @@ -644,22 +651,15 @@ static void hdl_nopen(void)
CHK_ARG_LEN(atci.tcmd.arg3, 0, 3);
CHK_ARG_LEN(atci.tcmd.arg4, 0, 4);
}
} //else { // 'S' ������å�̳� �ƴϸ� ���� Ȯ�� ��å�̳�
// CHK_ARG_LEN(atci.tcmd.arg3, 0, 3);
// CHK_ARG_LEN(atci.tcmd.arg4, 0, 4);
//}

if(atci.tcmd.arg5[0] == 0) {
atci.tcmd.arg5[0] = 'O';
atci.tcmd.arg5[1] = 0;
} else if(CMP_CHAR_3(atci.tcmd.arg5, 'O', 'S', 'A')) {
RESP_CDR(RET_WRONG_ARG, 5);
} else { // 'S' ������å�̳� �ƴϸ� ���� Ȯ�� ��å�̳�
CHK_ARG_LEN(atci.tcmd.arg3, 0, 3);
CHK_ARG_LEN(atci.tcmd.arg4, 0, 4);
}

CHK_ARG_LEN(atci.tcmd.arg5, 0, 5);
type = atci.tcmd.arg1[0];
save = atci.tcmd.arg5[0];
CMD_CLEAR();
act_nopen_a(type, save, SrcPort, dip, DstPort);
act_nopen_a(type, SrcPort, dip, DstPort);
}
else CRITICAL_ERRA("wrong sign(%d)", atci.tcmd.sign);
}
Expand Down Expand Up @@ -688,6 +688,8 @@ static void hdl_nsend(void)
{
int8 num = -1;
int32 ret;
uint8 *dip = NULL;
uint16 *dport = NULL;

if(atci.tcmd.sign == CMD_SIGN_NONE) RESP_CR(RET_WRONG_SIGN);
if(atci.tcmd.sign == CMD_SIGN_QUEST) RESP_CR(RET_WRONG_SIGN);
Expand All @@ -700,21 +702,22 @@ static void hdl_nsend(void)
RESP_CDR(RET_RANGE_OUT, 1);
}
if(str_check(isdigit, atci.tcmd.arg2) != RET_OK ||
(atci.sendlen = atoi((char*)atci.tcmd.arg2)) < 1 ||
atci.sendlen > WORK_BUF_SIZE) RESP_CDR(RET_WRONG_ARG, 2);
if(atci.tcmd.arg3[0] == 0) atci.sendflag[0] = VAL_DISABLE;
else if(ip_check(atci.tcmd.arg3, atci.sendip) == RET_OK)
atci.sendflag[0] = VAL_ENABLE;
else RESP_CDR(RET_WRONG_ARG, 3);

if(atci.tcmd.arg4[0] == 0) atci.sendflag[1] = VAL_DISABLE;
else if(port_check(atci.tcmd.arg4, &atci.sendport) == RET_OK)
atci.sendflag[1] = VAL_ENABLE;
else RESP_CDR(RET_WRONG_ARG, 4);
(atci.sendlen = atoi((char*)atci.tcmd.arg2)) < 1 ||
atci.sendlen > WORK_BUF_SIZE) RESP_CDR(RET_RANGE_OUT, 2);

if(atci.tcmd.arg3[0]) {
if(ip_check(atci.tcmd.arg3, atci.sendip) == RET_OK) dip = atci.sendip;
else RESP_CDR(RET_WRONG_ARG, 3);
}
if(atci.tcmd.arg4[0]) {
if(port_check(atci.tcmd.arg4, &atci.sendport)==RET_OK) dport = &atci.sendport;
else RESP_CDR(RET_WRONG_ARG, 4);
}

CHK_ARG_LEN(atci.tcmd.arg5, 0, 5);
CHK_ARG_LEN(atci.tcmd.arg6, 0, 6);
CMD_CLEAR();
ret = act_nsend_chk(num, &atci.sendlen, atci.sendip, &atci.sendport);
ret = act_nsend_chk(num, &atci.sendlen, dip, dport);
if(ret != RET_OK) return;

atci.sendsock = num; // ��ȿ�� �˻簡 �Ϸ�Ǹ� SEND���� ��ȯ
Expand Down
Loading