diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/third_party_driver/ethernet/connect_w5500.c b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/third_party_driver/ethernet/connect_w5500.c index 34682a2bd..67e250bd9 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/third_party_driver/ethernet/connect_w5500.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/third_party_driver/ethernet/connect_w5500.c @@ -335,6 +335,9 @@ 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); + while (getSn_SR(client_sock) == SOCK_CLOSED) { + wiz_client_op(client_sock, send_buf, strlen(send_buf), ip, port, SEND_DATA); + } int ret = wiz_client_op(client_sock, send_buf, strlen(send_buf), ip, port, SEND_DATA); if (ret < 0) { @@ -344,8 +347,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); - KPrintf("received msg: %s\n", recv_buf); if (ret > 0) { + KPrintf("received msg: %s\n", recv_buf); break; } }