fixed wrong output info in udp_through_module

Note that this is an udp module, 
so the output information which contained 'TCP' should be replaced with 'UDP'.
This commit is contained in:
David Lin
2020-02-14 22:49:17 +08:00
committed by GitHub
parent 59e403891a
commit 5a49fa8f93

View File

@@ -24,7 +24,7 @@ void udp_test0(void)
while (1) { while (1) {
tos_sal_module_sendto(socket_id_0, "47.107.78.107", "1234", tos_sal_module_sendto(socket_id_0, "47.107.78.107", "1234",
(const void*)"This is TCP Test!\r\n", strlen("This is UDP Test!\r\n")); (const void*)"This is UDP Test!\r\n", strlen("This is UDP Test!\r\n"));
recv_len = tos_sal_module_recvfrom(socket_id_0, recv_data_0, sizeof(recv_data_0)); recv_len = tos_sal_module_recvfrom(socket_id_0, recv_data_0, sizeof(recv_data_0));
if (recv_len < 0) { if (recv_len < 0) {
@@ -78,16 +78,16 @@ void application_entry(void *arg)
socket_id_0 = tos_sal_module_connect("47.107.78.107", "1234", TOS_SAL_PROTO_UDP); socket_id_0 = tos_sal_module_connect("47.107.78.107", "1234", TOS_SAL_PROTO_UDP);
if (socket_id_0 == -1) { if (socket_id_0 == -1) {
printf("TCP0 connect failed\r\n"); printf("UDP0 connect failed\r\n");
} else { } else {
printf("TCP0 connect success! fd: %d\n", socket_id_0); printf("UDP0 connect success! fd: %d\n", socket_id_0);
} }
socket_id_1 = tos_sal_module_connect("47.107.78.107", "4321", TOS_SAL_PROTO_UDP); socket_id_1 = tos_sal_module_connect("47.107.78.107", "4321", TOS_SAL_PROTO_UDP);
if (socket_id_1 == -1) { if (socket_id_1 == -1) {
printf("TCP1 connect failed\r\n"); printf("UDP1 connect failed\r\n");
} else { } else {
printf("TCP1 connect success! fd: %d\n", socket_id_1); printf("UDP1 connect success! fd: %d\n", socket_id_1);
} }
osThreadCreate(osThread(udp_test0), NULL); osThreadCreate(osThread(udp_test0), NULL);