Skip to content

Commit 2616003

Browse files
committed
v3.2.3
1.增加从MQTT后台同步NTP时间的功能接口 2.增加网关子设备OTA示例 3.优化Log/HAL_Printf对字符串指针的处理 4.修复AT socket部分bug
1 parent 5381d0e commit 2616003

File tree

77 files changed

+2038
-390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2038
-390
lines changed

docs/C-SDK_API及可变参数说明.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ MQTT构造时候除了提供设备信息,还需要提供一个回调函数,
141141
| 序号 | 函数名 | 说明 |
142142
| ---- | ---------------------------- | ------------------------------------------------- |
143143
| 1 | IOT_Get_SysTime | 获取 IoT hub 后台系统时间,目前仅支持 MQTT 通道对时功能 |
144+
| 2 | IOT_Sync_NTPTime | 同步 IoT hub 后台时间戳并通过 NTP 算法设置设备系统时间,目前仅支持 MQTT 通道对时功能 |
144145

145146
### 网关功能接口
146147
关于网关功能介绍,可以参考SDK docs/IoT_Hub/网关功能文档
@@ -189,4 +190,4 @@ MQTT构造时候除了提供设备信息,还需要提供一个回调函数,
189190
| 序号 | 函数名 | 说明 |
190191
| ---- | ---------------------------- | -------------------------- |
191192
| 1 | IOT_Subscribe_Config | 向云平台订阅远程配置 topic |
192-
| 2 | IOT_Get_Config | 向云平台获取设备配置 |
193+
| 2 | IOT_Get_Config | 向云平台获取设备配置 |

docs/IoT_Hub/mqtt_sample_快速入门.md

+15
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,19 @@ INF|2019-09-12 21:28:21|mqtt_sample.c|on_message_callback(195): Receive Message
127127
可以登录物联网通信控制台, 点击左边导航栏中的**云日志**, 查看刚才上报的消息
128128
![](https://main.qcloudimg.com/raw/f589691c7e007b59a5426ede6dc17ddb.png)
129129

130+
#### 7. 观察 NTP 时间日志
131+
如下日志信息显示 NTP 对时,设备 publish 获取 NTP 时间的报文,云平台记录接收到设备获取 NTP 时间报文的时间戳 ntptime1,记录给设备回复时的时间戳 ntptime2,将 ntptime1 和 ntptime2 回复给设备,设备接收到云平台的回复报文,通过算法计算出设备上真实的时间,并调用系统时间设置函数设置时间,通过例子程序日志可以看出时间被正确设置。
132+
windows / linux 平台已经适配时间设置,其他平台需要适配系统时间设置,执行例程时 windows 需要以管理员身份运行程序,linux 需要以超级用户身份运行程序。
133+
```
134+
sudo ./output/release/bin/mqtt_sample
135+
DBG|2020-10-22 10:48:26|mqtt_client_publish.c|qcloud_iot_mqtt_publish(340): publish packetID=0|topicName=$sys/
136+
operation/S3EUVBRJLB/test_device|payload={"type": "get", "resource": ["time"]}
137+
DBG|2020-10-22 10:48:27|system_mqtt.c|_system_mqtt_message_callback(47): Recv Msg Topic:$sys/operation/result/
138+
S3EUVBRJLB/test_device, payload:{"type":"get","time":1603334906,"ntptime1":1603334906594,"ntptime2":1603334906594}
139+
INF|2020-10-22 10:48:26|system_mqtt.c|IOT_Sync_NTPTime(294): set systime ms success, timestamp 1603334906644 ms
140+
INF|2020-10-22 10:48:26|mqtt_sample.c|main(325): sync ntp time success!
141+
142+
```
143+
`HAL_Timer_freertos.c HAL_Timer_rtthread.c HAL_Timer_nonos.c` 文件中提供了 `timestamp_to_date` 函数将时间戳转换为年、月、日、时、分、秒、毫秒方便嵌入式设备设置 RTC 时钟。
144+
`HAL_Timer_set_systime_sec` 设置系统时间函数在 32bit 平台使用; `HAL_Timer_set_systime_ms` 设置系统时间函数在 64bit 平台使用。
130145

docs/IoT_Hub/ota_mqtt_subdev_sample网关子设备升级.md

+267
Large diffs are not rendered by default.

docs/IoT_Hub/ota_sample_固件升级.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ INF|2020-03-04 16:50:37|ota_mqtt_sample.c|process_ota(389): wait for ota upgrade
8484
```
8585
INF|2020-03-04 16:50:38|ota_mqtt_sample.c|process_ota(389): wait for ota upgrade command...
8686
DBG|2020-03-04 16:50:39|ota_mqtt.c|_otamqtt_upgrage_cb(103): topic=$ota/update/S3EUVBRJLB/test_device
87-
INF|2020-03-04 16:50:39|ota_mqtt.c|_otamqtt_upgrage_cb(104): len=454, topic_msg={"file_size":175436,"md5sum":"ad4615b866c13afb8b293a679bfa5dc4","type":"update_firmware","url":"https://ota-1255858890.cos.ap-guangzhou.myqcloud.com/100008768029_S3EUVBRJLB_1.3.0?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDdO8ldrUa0Uts4H5Gzx6FZ9nfedjpiCd7%26q-sign-time%3D1583311839%3B1583398239%26q-key-time%3D1583311839%3B1583398239%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D1215yt303628f88f31c9a7734ead8a7fa32ed1b3%00","version":"1.3.0"}
87+
INF|2020-03-04 16:50:39|ota_mqtt.c|_otamqtt_upgrage_cb(104): len=454, topic_msg={"file_size":175436,"md5sum":"ad4615b866c13afb8b293a679bfa5dc4","type":"update_firmware","url":"https://ota-1255858890.cos.ap-guangzhou.myqcloud.com/","version":"1.3.0"}
8888
8989
INF|2020-03-04 16:50:39|ota_mqtt_sample.c|process_ota(389): wait for ota upgrade command...
9090
ERR|2020-03-04 16:50:39|ota_mqtt_sample.c|_get_local_fw_info(251): open file ./FW_S3EUVBRJLBtest_device.json failed

include/exports/qcloud_iot_export_gateway.h

+5-6
Original file line numberDiff line numberDiff line change
@@ -185,23 +185,23 @@ void *IOT_Gateway_Get_Mqtt_Client(void *handle);
185185

186186
/* The structure of subdevice bindinfo */
187187
typedef struct _SubdevBindInfo {
188-
char product_id[MAX_SIZE_OF_PRODUCT_ID + 1];
189-
char device_name[MAX_SIZE_OF_DEVICE_NAME + 1];
188+
char product_id[MAX_SIZE_OF_PRODUCT_ID + 1];
189+
char device_name[MAX_SIZE_OF_DEVICE_NAME + 1];
190190
struct _SubdevBindInfo *next;
191191
} SubdevBindInfo;
192192

193193
/* The structure of subdevice bindlist */
194194
typedef struct _SubdevBindList {
195195
SubdevBindInfo *bindlist_head;
196-
int bind_num;
196+
int bind_num;
197197
} SubdevBindList;
198198

199199
/**
200200
* @brief get sub-device bind list from cloud platform
201201
*
202202
* @param client handle to gateway client
203203
* @param param gateway parameters
204-
* @param subdev_bindlist output subdev bind list
204+
* @param subdev_bindlist output subdev bind list
205205
*
206206
* @return QCLOUD_RET_SUCCESS for success, or err code for failure
207207
*/
@@ -210,14 +210,13 @@ int IOT_Gateway_Subdev_GetBindList(void *client, GatewayParam *param, SubdevBind
210210
/**
211211
* @brief destory sub dev bind list
212212
*
213-
* @param subdev_bindlist input subdev bind list pointer, ref IOT_Gateway_Subdev_GetBindList
213+
* @param subdev_bindlist input subdev bind list pointer, ref IOT_Gateway_Subdev_GetBindList
214214
* output param subdev_bindlist
215215
*
216216
* @return QCLOUD_RET_SUCCESS for success, or err code for failure
217217
*/
218218
void IOT_Gateway_Subdev_DestoryBindList(SubdevBindList *subdev_bindlist);
219219

220-
221220
#ifdef __cplusplus
222221
}
223222
#endif

include/exports/qcloud_iot_export_log.h

+3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ void IOT_Log_Gen(const char *file, const char *func, const int line, const int l
157157
#define Log_w(fmt, ...) IOT_Log_Gen(__FILE__, __FUNCTION__, __LINE__, eLOG_WARN, fmt, ##__VA_ARGS__)
158158
#define Log_e(fmt, ...) IOT_Log_Gen(__FILE__, __FUNCTION__, __LINE__, eLOG_ERROR, fmt, ##__VA_ARGS__)
159159

160+
/* check pointer before printf/snprintf */
161+
#define STRING_PTR_PRINT_SANITY_CHECK(s) ((s) ? (s) : "null")
162+
160163
/* Macro for debug mode */
161164
#ifdef IOT_DEBUG
162165
#define IOT_FUNC_ENTRY \

include/exports/qcloud_iot_export_remote_config.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,26 @@ extern "C" {
2323
#define REMOTE_CONFIG_ERRCODE_SUCCESS 0 // get config success
2424
#define REMOTE_CONFIG_ERRCODE_DISABLE 1001 // Cloud platform has been disabled remote config
2525

26-
#define REMOTE_CONFIG_JSON_BUFFER_MIN_LEN 60 // config json buffer sys need len
26+
#define REMOTE_CONFIG_JSON_BUFFER_MIN_LEN 60 // config json buffer sys need len
2727

2828
/**
2929
* @brief proc config data, subscribe set struct ConfigSubscirbeUserData
3030
*
3131
* @param client MQTTClient pointer
32-
* @param config_reply_errcode Config ErrCode; ERRCODE_REMOTE_CONFIG_SUCCESS can proc config_json other config_json is invalid
33-
* @param config_json config json data string, format is {xxxx}; user config data at cloud platform, pointer is
32+
* @param config_reply_errcode Config ErrCode; ERRCODE_REMOTE_CONFIG_SUCCESS can proc config_json other config_json is
33+
invalid
34+
* @param config_json config json data string, format is {xxxx}; user config data at cloud platform, pointer is
3435
struct ConfigSubscirbeUserData json_buffer member
35-
* @param config_json_len config json data length,
36+
* @param config_json_len config json data length,
3637
* @return void
3738
*/
3839
typedef void (*OnConfigProcHandler)(void *client, int config_reply_errcode, char *config_json, int config_json_len);
3940

4041
typedef struct {
41-
OnConfigProcHandler on_config_proc; // config proc callback when message arrived
42-
int json_buffer_len; // sys json data need 60 B + config json data max len
43-
char * json_buffer; // save json buffer [sys json data + config json data] ,sdk proc recv buff
44-
// save config json data as OnConfigProcHandler functions config_json parameter
42+
OnConfigProcHandler on_config_proc; // config proc callback when message arrived
43+
int json_buffer_len; // sys json data need 60 B + config json data max len
44+
char * json_buffer; // save json buffer [sys json data + config json data] ,sdk proc recv buff
45+
// save config json data as OnConfigProcHandler functions config_json parameter
4546
} ConfigSubscirbeUserData;
4647

4748
/**

include/exports/qcloud_iot_export_system.h

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ extern "C" {
3030
*/
3131
int IOT_Get_SysTime(void* pClient, long* time);
3232

33+
/**
34+
* @brief sync ntp timestamp from MQTT server
35+
*
36+
* @param pClient MQTTClient pointer
37+
* @return QCLOUD_RET_SUCCESS for success
38+
* otherwise, failure
39+
*/
40+
int IOT_Sync_NTPTime(void* pClient);
41+
3342
#ifdef __cplusplus
3443
}
3544
#endif

include/qcloud_iot_import.h

+14
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,20 @@ char *HAL_Timer_current(char *time_str);
304304
*/
305305
long HAL_Timer_current_sec(void);
306306

307+
/**
308+
* @brief Set timestamp in second to systime/rtc
309+
*
310+
* @return 0 is success other failed
311+
*/
312+
int HAL_Timer_set_systime_sec(size_t timestamp_sec);
313+
314+
/**
315+
* @brief Set timestamp in millsecond to systime/rtc
316+
*
317+
* @return 0 is success other failed
318+
*/
319+
int HAL_Timer_set_systime_ms(size_t timestamp_ms);
320+
307321
#ifdef AT_TCP_ENABLED
308322
int HAL_AT_TCP_Init(void);
309323
uintptr_t HAL_AT_TCP_Connect(const char *host, uint16_t port);

platform/os/freertos/HAL_TCP_lwip.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ uintptr_t HAL_TCP_Connect(const char *host, uint16_t port)
5757

5858
ret = getaddrinfo(host, port_str, &hints, &addr_list);
5959
if (ret) {
60-
Log_e("getaddrinfo(%s:%s) error", host, port_str);
60+
Log_e("getaddrinfo(%s:%s) error", STRING_PTR_PRINT_SANITY_CHECK(host), port_str);
6161
return 0;
6262
}
6363

@@ -78,13 +78,13 @@ uintptr_t HAL_TCP_Connect(const char *host, uint16_t port)
7878
}
7979

8080
if (ret == 0) {
81-
Log_e("failed to connect with TCP server: %s:%s", host, port_str);
81+
Log_e("failed to connect with TCP server: %s:%s", STRING_PTR_PRINT_SANITY_CHECK(host), port_str);
8282
} else {
8383
/* reduce log print due to frequent log server connect/disconnect */
8484
if (0 == strncmp(host, LOG_UPLOAD_SERVER_DOMAIN, HOST_STR_LENGTH))
8585
UPLOAD_DBG("connected with TCP server: %s:%s", host, port_str);
8686
else
87-
Log_i("connected with TCP server: %s:%s", host, port_str);
87+
Log_i("connected with TCP server: %s:%s", STRING_PTR_PRINT_SANITY_CHECK(host), port_str);
8888
}
8989

9090
freeaddrinfo(addr_list);

platform/os/freertos/HAL_Timer_freertos.c

+40
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ extern "C" {
2323
#include <string.h>
2424

2525
#include "qcloud_iot_import.h"
26+
#include "utils_timer.h"
2627

2728
#define PLATFORM_HAS_TIME_FUNCS
2829
//#define PLATFORM_HAS_CMSIS
@@ -37,6 +38,45 @@ extern "C" {
3738
#include "stm32l4xx_hal.h"
3839
#endif
3940

41+
int HAL_Timer_set_systime_sec(size_t timestamp_sec)
42+
{
43+
#if defined PLATFORM_HAS_TIME_FUNCS
44+
struct timeval stime;
45+
stime.tv_sec = timestamp_sec;
46+
stime.tv_usec = 0;
47+
if (0 != settimeofday(&stime, NULL)) {
48+
return -1;
49+
}
50+
return 0;
51+
#else
52+
RTC_DATE_TIME date_time;
53+
date_time.ms = 0;
54+
timestamp_to_date(timestamp_sec, &date_time, 8);
55+
// set RTC Time note hw rtc year base
56+
return -1;
57+
#endif
58+
}
59+
60+
int HAL_Timer_set_systime_ms(size_t timestamp_ms)
61+
{
62+
#if defined PLATFORM_HAS_TIME_FUNCS
63+
struct timeval stime;
64+
stime.tv_sec = (timestamp_ms / 1000);
65+
stime.tv_usec = ((timestamp_ms % 1000) * 1000);
66+
67+
if (0 != settimeofday(&stime, NULL)) {
68+
return -1;
69+
}
70+
return 0;
71+
#else
72+
RTC_DATE_TIME date_time;
73+
date_time.ms = timestamp_ms % 1000;
74+
timestamp_to_date(timestamp_ms / 1000, &date_time, 8);
75+
// set RTC Time note hw rtc year base
76+
return -1;
77+
#endif
78+
}
79+
4080
uint32_t HAL_GetTimeMs(void)
4181
{
4282
#if defined PLATFORM_HAS_TIME_FUNCS

platform/os/freertos/HAL_UDP_lwip.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ uintptr_t HAL_UDP_Connect(const char *host, unsigned short port)
4646
hints.ai_family = AF_INET;
4747
hints.ai_protocol = IPPROTO_UDP;
4848

49-
Log_d("establish tcp connection with server(host=%s port=%s)", host, port_str);
49+
Log_d("establish tcp connection with server(host=%s port=%s)", STRING_PTR_PRINT_SANITY_CHECK(host), port_str);
5050

5151
if (getaddrinfo(host, port_str, &hints, &addr_list) != 0) {
5252
Log_e("getaddrinfo error,errno:%s", strerror(errno));

platform/os/linux/HAL_Device_linux.c

+9-8
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ int HAL_SetDevInfoFile(const char *file_name)
108108

109109
/* check if file exists */
110110
if (access(file_name, 0)) {
111-
Log_e("device info file \"%s\" not existed", file_name);
111+
Log_e("device info file \"%s\" not existed", STRING_PTR_PRINT_SANITY_CHECK(file_name));
112112
return QCLOUD_ERR_FAILURE;
113113
}
114114

@@ -141,7 +141,7 @@ int HAL_GetDevInfoFromFile(const char *file_name, void *dev_info)
141141

142142
fp = fopen(file_name, "r");
143143
if (NULL == fp) {
144-
Log_e("open device info file \"%s\" failed", file_name);
144+
Log_e("open device info file \"%s\" failed", STRING_PTR_PRINT_SANITY_CHECK(file_name));
145145
ret = QCLOUD_ERR_FAILURE;
146146
goto exit;
147147
}
@@ -329,29 +329,30 @@ static int iot_save_devinfo_to_json_file(DeviceInfo *pDevInfo)
329329

330330
// product id, device name
331331
rc_of_snprintf = HAL_Snprintf(JsonDoc + strlen(JsonDoc), remain_size, "\"%s\":\"%s\",\n\"%s\":\"%s\",\n",
332-
KEY_PRODUCT_ID, pDevInfo->product_id, KEY_DEV_NAME, pDevInfo->device_name);
332+
KEY_PRODUCT_ID, STRING_PTR_PRINT_SANITY_CHECK(pDevInfo->product_id), KEY_DEV_NAME,
333+
STRING_PTR_PRINT_SANITY_CHECK(pDevInfo->device_name));
333334
remain_size -= rc_of_snprintf;
334335

335336
// product secret
336337
#ifdef DEV_DYN_REG_ENABLED
337338
rc_of_snprintf = HAL_Snprintf(JsonDoc + strlen(JsonDoc), remain_size, "\"%s\":\"%s\",\n", KEY_PRODUCT_SECRET,
338-
pDevInfo->product_secret);
339+
STRING_PTR_PRINT_SANITY_CHECK(pDevInfo->product_secret));
339340
remain_size -= rc_of_snprintf;
340341
#endif
341342

342343
// key device info or cert device info
343344
#ifdef AUTH_MODE_CERT
344345
rc_of_snprintf = HAL_Snprintf(JsonDoc + strlen(JsonDoc), remain_size, "\"%s\":{\n", STR_DEV_CERT);
345346
remain_size -= rc_of_snprintf;
346-
rc_of_snprintf =
347-
HAL_Snprintf(JsonDoc + strlen(JsonDoc), remain_size, "\"%s\":\"%s\",\n\"%s\":\"%s\"\n}", STR_DEV_CERT_FILE,
348-
pDevInfo->dev_cert_file_name, STR_DEV_KEY_FILE, pDevInfo->dev_key_file_name);
347+
rc_of_snprintf = HAL_Snprintf(JsonDoc + strlen(JsonDoc), remain_size, "\"%s\":\"%s\",\n\"%s\":\"%s\"\n}",
348+
STR_DEV_CERT_FILE, STRING_PTR_PRINT_SANITY_CHECK(pDevInfo->dev_cert_file_name),
349+
STR_DEV_KEY_FILE, STRING_PTR_PRINT_SANITY_CHECK(pDevInfo->dev_key_file_name));
349350
remain_size -= rc_of_snprintf;
350351
#else
351352
rc_of_snprintf = HAL_Snprintf(JsonDoc + strlen(JsonDoc), remain_size, "\"%s\":{\n", STR_DEV_INFO);
352353
remain_size -= rc_of_snprintf;
353354
rc_of_snprintf = HAL_Snprintf(JsonDoc + strlen(JsonDoc), remain_size, "\"%s\":\"%s\"\n}", STR_DEV_SECRET,
354-
pDevInfo->device_secret);
355+
STRING_PTR_PRINT_SANITY_CHECK(pDevInfo->device_secret));
355356
remain_size -= rc_of_snprintf;
356357
#endif
357358

platform/os/linux/HAL_TCP_linux.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ uintptr_t HAL_TCP_Connect(const char *host, uint16_t port)
7373
ret = getaddrinfo(host, port_str, &hints, &addr_list);
7474
if (ret) {
7575
if (ret == EAI_SYSTEM)
76-
Log_e("getaddrinfo(%s:%s) error: %s", host, port_str, strerror(errno));
76+
Log_e("getaddrinfo(%s:%s) error: %s", STRING_PTR_PRINT_SANITY_CHECK(host), port_str, strerror(errno));
7777
else
78-
Log_e("getaddrinfo(%s:%s) error: %s", host, port_str, gai_strerror(ret));
78+
Log_e("getaddrinfo(%s:%s) error: %s", STRING_PTR_PRINT_SANITY_CHECK(host), port_str, gai_strerror(ret));
7979
return 0;
8080
}
8181

@@ -96,13 +96,13 @@ uintptr_t HAL_TCP_Connect(const char *host, uint16_t port)
9696
}
9797

9898
if (0 == ret) {
99-
Log_e("fail to connect with TCP server: %s:%s", host, port_str);
99+
Log_e("fail to connect with TCP server: %s:%s", STRING_PTR_PRINT_SANITY_CHECK(host), port_str);
100100
} else {
101101
/* reduce log print due to frequent log server connect/disconnect */
102102
if (0 == strncmp(host, LOG_UPLOAD_SERVER_DOMAIN, HOST_STR_LENGTH))
103103
UPLOAD_DBG("connected with TCP server: %s:%s", host, port_str);
104104
else
105-
Log_i("connected with TCP server: %s:%s", host, port_str);
105+
Log_i("connected with TCP server: %s:%s", STRING_PTR_PRINT_SANITY_CHECK(host), port_str);
106106
}
107107

108108
freeaddrinfo(addr_list);

platform/os/linux/HAL_Timer_linux.c

+24
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,30 @@ long HAL_Timer_current_sec(void)
8282
return tv.tv_sec;
8383
}
8484

85+
int HAL_Timer_set_systime_sec(size_t timestamp_sec)
86+
{
87+
struct timeval stime;
88+
stime.tv_sec = timestamp_sec;
89+
stime.tv_usec = 0;
90+
91+
if (0 != settimeofday(&stime, NULL)) {
92+
return -1;
93+
}
94+
return 0;
95+
}
96+
97+
int HAL_Timer_set_systime_ms(size_t timestamp_ms)
98+
{
99+
struct timeval stime;
100+
stime.tv_sec = (timestamp_ms / 1000);
101+
stime.tv_usec = ((timestamp_ms % 1000) * 1000);
102+
103+
if (0 != settimeofday(&stime, NULL)) {
104+
return -1;
105+
}
106+
return 0;
107+
}
108+
85109
#ifdef __cplusplus
86110
}
87111
#endif

platform/os/linux/HAL_UDP_linux.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ uintptr_t HAL_UDP_Connect(const char *host, unsigned short port)
4747
hints.ai_family = AF_INET;
4848
hints.ai_protocol = IPPROTO_UDP;
4949

50-
Log_d("establish tcp connection with server(host=%s port=%s)", host, port_str);
50+
Log_d("establish tcp connection with server(host=%s port=%s)", STRING_PTR_PRINT_SANITY_CHECK(host), port_str);
5151

5252
if (getaddrinfo(host, port_str, &hints, &addr_list) != 0) {
5353
Log_e("getaddrinfo error,errno:%s", strerror(errno));

0 commit comments

Comments
 (0)