Fixing w5500.

This commit is contained in:
TXuian 2022-12-10 13:18:45 +08:00
parent 19cbf66e21
commit 57f690188d
1 changed files with 3 additions and 3 deletions

View File

@ -315,7 +315,7 @@ void wiz_client_op_test(int argc, char *argv[]) {
KPrintf("wiz_client_op <ip> <port> <msg>\n");
}
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 tmp_ip[4];
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);
memcpy(send_buf, argv[3], strlen(argv[3]));
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);
if (ret < 0) {
KPrintf("[W5500] Client Op Failed.\n");
@ -340,8 +340,8 @@ void wiz_client_op_test(int argc, char *argv[]) {
// waiting for a responding.
ret = wiz_client_op(client_sock, recv_buf, g_wiznet_buf_size, ip, port,
RECV_DATA);
if (ret > 0) {
KPrintf("received msg: %s\n", recv_buf);
if (ret > 0) {
break;
}
}