From c0eb482c86f05a0a66b6fe3a2f433c23a6b0f6d7 Mon Sep 17 00:00:00 2001 From: David Lin Date: Mon, 29 Jun 2020 19:38:05 +0800 Subject: [PATCH 1/4] Update HAL_UDP_lwip.c tcp -> udp --- .../port/TencentOS_tiny/HAL_UDP_lwip.c | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/components/connectivity/qcloud-iot-hub-sdk/port/TencentOS_tiny/HAL_UDP_lwip.c b/components/connectivity/qcloud-iot-hub-sdk/port/TencentOS_tiny/HAL_UDP_lwip.c index e56de9eb..730a8a13 100644 --- a/components/connectivity/qcloud-iot-hub-sdk/port/TencentOS_tiny/HAL_UDP_lwip.c +++ b/components/connectivity/qcloud-iot-hub-sdk/port/TencentOS_tiny/HAL_UDP_lwip.c @@ -47,27 +47,27 @@ uintptr_t HAL_UDP_Connect(const char *host, unsigned short port) hints.ai_family = AF_INET; hints.ai_protocol = IPPROTO_UDP; - Log_d("establish tcp connection with server(host=%s port=%s)", host, port_str); + Log_d("establish udp connection with server(host=%s port=%s)", host, port_str); if (getaddrinfo(host, port_str, &hints, &addr_list) != 0) { - Log_e("getaddrinfo error,errno:%s",strerror(errno)); + Log_e("getaddrinfo error,errno:%s",strerror(errno)); return 0; } for (cur = addr_list; cur != NULL; cur = cur->ai_next) { - fd = socket(cur->ai_family, cur->ai_socktype, cur->ai_protocol); - if (fd < 0) { - ret = 0; - continue; - } + fd = socket(cur->ai_family, cur->ai_socktype, cur->ai_protocol); + if (fd < 0) { + ret = 0; + continue; + } - if (0 == connect(fd, cur->ai_addr, cur->ai_addrlen)) { - ret = fd + LWIP_SOCKET_FD_SHIFT; - break; - } + if (0 == connect(fd, cur->ai_addr, cur->ai_addrlen)) { + ret = fd + LWIP_SOCKET_FD_SHIFT; + break; + } - close(fd); - ret = 0; + close(fd); + ret = 0; } if (0 == ret) { From d56e861801b6c3b44fec1aaead025fa1b95773fa Mon Sep 17 00:00:00 2001 From: David Lin Date: Mon, 29 Jun 2020 19:55:23 +0800 Subject: [PATCH 2/4] Update HAL_UDP_win.c tcp -> udp --- .../3rdparty/platform/os/windows/HAL_UDP_win.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/windows/HAL_UDP_win.c b/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/windows/HAL_UDP_win.c index 39ff2634..02e1672e 100644 --- a/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/windows/HAL_UDP_win.c +++ b/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/windows/HAL_UDP_win.c @@ -46,7 +46,7 @@ uintptr_t HAL_UDP_Connect(const char *host, unsigned short port) hints.ai_family = AF_INET; hints.ai_protocol = IPPROTO_UDP; - Log_d("establish tcp connection with server(host=%s port=%s)", host, port_str); + Log_d("establish udp connection with server(host=%s port=%s)", host, port_str); if (getaddrinfo(host, port_str, &hints, &addr_list) != 0) { Log_e("getaddrinfo error,errno:%s", strerror(errno)); From 7e4241438c151b245d0c122b196251f76b9b144a Mon Sep 17 00:00:00 2001 From: David Lin Date: Mon, 29 Jun 2020 19:59:21 +0800 Subject: [PATCH 3/4] Update HAL_UDP_lwip.c tcp -> udp --- .../3rdparty/platform/os/freertos/HAL_UDP_lwip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/freertos/HAL_UDP_lwip.c b/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/freertos/HAL_UDP_lwip.c index d82aed2d..38f2c740 100644 --- a/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/freertos/HAL_UDP_lwip.c +++ b/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/freertos/HAL_UDP_lwip.c @@ -46,7 +46,7 @@ uintptr_t HAL_UDP_Connect(const char *host, unsigned short port) hints.ai_family = AF_INET; hints.ai_protocol = IPPROTO_UDP; - Log_d("establish tcp connection with server(host=%s port=%s)", host, port_str); + Log_d("establish udp connection with server(host=%s port=%s)", host, port_str); if (getaddrinfo(host, port_str, &hints, &addr_list) != 0) { Log_e("getaddrinfo error,errno:%s", strerror(errno)); From 1160dc263eb1428564b82bd35ab7d519c5d83c69 Mon Sep 17 00:00:00 2001 From: David Lin Date: Mon, 29 Jun 2020 19:59:41 +0800 Subject: [PATCH 4/4] Update HAL_UDP_linux.c tcp -> udp --- .../3rdparty/platform/os/linux/HAL_UDP_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/linux/HAL_UDP_linux.c b/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/linux/HAL_UDP_linux.c index 2d22cc46..eeced583 100644 --- a/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/linux/HAL_UDP_linux.c +++ b/components/connectivity/qcloud-iot-hub-sdk/3rdparty/platform/os/linux/HAL_UDP_linux.c @@ -47,7 +47,7 @@ uintptr_t HAL_UDP_Connect(const char *host, unsigned short port) hints.ai_family = AF_INET; hints.ai_protocol = IPPROTO_UDP; - Log_d("establish tcp connection with server(host=%s port=%s)", host, port_str); + Log_d("establish udp connection with server(host=%s port=%s)", host, port_str); if (getaddrinfo(host, port_str, &hints, &addr_list) != 0) { Log_e("getaddrinfo error,errno:%s", strerror(errno));