Fixing w5500.
This commit is contained in:
parent
19cbf66e21
commit
57f690188d
|
@ -315,7 +315,7 @@ void wiz_client_op_test(int argc, char *argv[]) {
|
||||||
KPrintf("wiz_client_op <ip> <port> <msg>\n");
|
KPrintf("wiz_client_op <ip> <port> <msg>\n");
|
||||||
}
|
}
|
||||||
uint8_t client_sock = 2;
|
uint8_t client_sock = 2;
|
||||||
uint8_t ip[4] = {192, 168, 31, 127};
|
uint8_t ip[4];
|
||||||
uint32_t port = atoi(argv[2]);
|
uint32_t port = atoi(argv[2]);
|
||||||
uint32_t tmp_ip[4];
|
uint32_t tmp_ip[4];
|
||||||
sscanf(argv[1], "%d.%d.%d.%d", &tmp_ip[0], &tmp_ip[1], &tmp_ip[2],
|
sscanf(argv[1], "%d.%d.%d.%d", &tmp_ip[0], &tmp_ip[1], &tmp_ip[2],
|
||||||
|
@ -331,7 +331,7 @@ void wiz_client_op_test(int argc, char *argv[]) {
|
||||||
memset(recv_buf, '\0', g_wiznet_buf_size);
|
memset(recv_buf, '\0', g_wiznet_buf_size);
|
||||||
memcpy(send_buf, argv[3], strlen(argv[3]));
|
memcpy(send_buf, argv[3], strlen(argv[3]));
|
||||||
KPrintf("[W5500 Client] BUFFER: %s\n", send_buf);
|
KPrintf("[W5500 Client] BUFFER: %s\n", send_buf);
|
||||||
int ret = wiz_client_op(client_sock, send_buf, g_wiznet_buf_size, ip, port,
|
int ret = wiz_client_op(client_sock, send_buf, strlen(send_buf), ip, port,
|
||||||
SEND_DATA);
|
SEND_DATA);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
KPrintf("[W5500] Client Op Failed.\n");
|
KPrintf("[W5500] Client Op Failed.\n");
|
||||||
|
@ -340,8 +340,8 @@ void wiz_client_op_test(int argc, char *argv[]) {
|
||||||
// waiting for a responding.
|
// waiting for a responding.
|
||||||
ret = wiz_client_op(client_sock, recv_buf, g_wiznet_buf_size, ip, port,
|
ret = wiz_client_op(client_sock, recv_buf, g_wiznet_buf_size, ip, port,
|
||||||
RECV_DATA);
|
RECV_DATA);
|
||||||
if (ret > 0) {
|
|
||||||
KPrintf("received msg: %s\n", recv_buf);
|
KPrintf("received msg: %s\n", recv_buf);
|
||||||
|
if (ret > 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue