12
12
13
13
static void default_msg_handler (void * client , message_data_t * msg )
14
14
{
15
- MQTT_LOG_I ("mqtt-client:%d %s()... \ntopic: %s, qos: %d, \nmessage:%s" , __LINE__ , __FUNCTION__ ,
15
+ MQTT_LOG_I ("mqtt-client:%d %s() - \ntopic: %s, qos: %d, \nmessage:%s" , __LINE__ , __FUNCTION__ ,
16
16
msg -> topic_name , msg -> message -> qos , (char * )msg -> message -> payload );
17
17
}
18
18
@@ -352,7 +352,7 @@ static void mqtt_ack_handler_resend(mqtt_client_t* c, ack_handlers_t* ack_handle
352
352
353
353
mqtt_send_packet (c , ack_handler -> payload_len , & timer ); /* resend data */
354
354
platform_mutex_unlock (& c -> mqtt_write_lock );
355
- MQTT_LOG_W ("mqtt-client:%d %s()... resend %d package, packet_id is %d " , __LINE__ , __FUNCTION__ , ack_handler -> type , ack_handler -> packet_id );
355
+ MQTT_LOG_W ("mqtt-client:%d %s() - resend %d package, packet_id is %d " , __LINE__ , __FUNCTION__ , ack_handler -> type , ack_handler -> packet_id );
356
356
}
357
357
358
358
static int mqtt_ack_list_node_is_exist (mqtt_client_t * c , int type , uint16_t packet_id )
@@ -460,7 +460,7 @@ static int mqtt_msg_handler_is_exist(mqtt_client_t* c, message_handlers_t *handl
460
460
461
461
/* determine whether a node already exists by mqtt topic, but wildcards are not supported */
462
462
if ((NULL != msg_handler -> topic_filter ) && (mqtt_is_topic_equals (msg_handler -> topic_filter , handler -> topic_filter ))) {
463
- MQTT_LOG_W ("mqtt-client:%d %s()... msg_handler->topic_filter: %s, handler->topic_filter: %s" ,
463
+ MQTT_LOG_W ("mqtt-client:%d %s() - msg_handler->topic_filter: %s, handler->topic_filter: %s" ,
464
464
__LINE__ , __FUNCTION__ , msg_handler -> topic_filter , handler -> topic_filter );
465
465
return 1 ;
466
466
}
@@ -569,7 +569,7 @@ static int mqtt_try_resubscribe(mqtt_client_t* c)
569
569
mqtt_list_t * curr , * next ;
570
570
message_handlers_t * msg_handler ;
571
571
572
- MQTT_LOG_W ("mqtt-client:%d %s()... mqtt try resubscribe ... " , __LINE__ , __FUNCTION__ );
572
+ MQTT_LOG_W ("mqtt-client:%d %s() - mqtt try resubscribe " , __LINE__ , __FUNCTION__ );
573
573
574
574
if (mqtt_list_is_empty (& c -> mqtt_msg_handler_list )) {
575
575
// MQTT_LOG_D("mqtt-client:%d %s() mqtt_msg_handler_list is empty", __LINE__, __FUNCTION__);
@@ -581,7 +581,7 @@ static int mqtt_try_resubscribe(mqtt_client_t* c)
581
581
582
582
/* resubscribe topic */
583
583
if ((rc = mqtt_subscribe (c , msg_handler -> topic_filter , msg_handler -> qos , msg_handler -> handler )) == MQTT_ACK_HANDLER_NUM_TOO_MUCH_ERROR )
584
- MQTT_LOG_W ("mqtt-client:%d %s()... mqtt ack handler num too much ... " , __LINE__ , __FUNCTION__ );
584
+ MQTT_LOG_W ("mqtt-client:%d %s() - mqtt ack handler num too much " , __LINE__ , __FUNCTION__ );
585
585
586
586
}
587
587
@@ -601,7 +601,7 @@ static int mqtt_try_do_reconnect(mqtt_client_t* c)
601
601
mqtt_ack_list_scan (c , 0 );
602
602
}
603
603
604
- MQTT_LOG_D ("mqtt-client:%d %s()... mqtt try connect result is -0x%04x" , __LINE__ , __FUNCTION__ , - rc );
604
+ MQTT_LOG_D ("mqtt-client:%d %s() - mqtt try connect result is -0x%04x" , __LINE__ , __FUNCTION__ , - rc );
605
605
606
606
RETURN_ERROR (rc );
607
607
}
@@ -711,7 +711,7 @@ static int mqtt_suback_packet_handle(mqtt_client_t *c, platform_timer_t *timer)
711
711
712
712
if (is_nack ) {
713
713
mqtt_msg_handler_destory (msg_handler ); /* subscribe topic failed, destory message handler */
714
- MQTT_LOG_D ("subscribe topic failed... " );
714
+ MQTT_LOG_D ("subscribe topic failed" );
715
715
RETURN_ERROR (MQTT_SUBSCRIBE_NOT_ACK_ERROR );
716
716
}
717
717
@@ -919,7 +919,7 @@ static int mqtt_yield(mqtt_client_t* c, int timeout_ms)
919
919
mqtt_ack_list_scan (c , 1 );
920
920
921
921
} else if (MQTT_NOT_CONNECT_ERROR == rc ) {
922
- MQTT_LOG_E ("mqtt-client:%d %s()... mqtt not connect" , __LINE__ , __FUNCTION__ );
922
+ MQTT_LOG_E ("mqtt-client:%d %s() - mqtt not connect" , __LINE__ , __FUNCTION__ );
923
923
} else {
924
924
break ;
925
925
}
@@ -937,19 +937,19 @@ static void mqtt_yield_thread(void *arg)
937
937
938
938
state = mqtt_get_client_state (c );
939
939
if (CLIENT_STATE_CONNECTED != state ) {
940
- MQTT_LOG_W ("mqtt-client:%d %s()... , mqtt is not connected to the server... " , __LINE__ , __FUNCTION__ );
940
+ MQTT_LOG_W ("mqtt-client:%d %s() - , mqtt is not connected to the server" , __LINE__ , __FUNCTION__ );
941
941
platform_thread_stop (c -> mqtt_thread ); /* mqtt is not connected to the server, stop thread */
942
942
}
943
943
944
944
while (1 ) {
945
945
rc = mqtt_yield (c , c -> mqtt_cmd_timeout );
946
946
if (MQTT_CLEAN_SESSION_ERROR == rc ) {
947
- MQTT_LOG_W ("mqtt-client:%d %s()... , mqtt clean session... ." , __LINE__ , __FUNCTION__ );
947
+ MQTT_LOG_W ("mqtt-client:%d %s() - , mqtt clean session." , __LINE__ , __FUNCTION__ );
948
948
network_disconnect (c -> mqtt_network );
949
949
mqtt_clean_session (c );
950
950
goto exit ;
951
951
} else if (MQTT_RECONNECT_TIMEOUT_ERROR == rc ) {
952
- MQTT_LOG_W ("mqtt-client:%d %s()... , mqtt reconnect timeout... ." , __LINE__ , __FUNCTION__ );
952
+ MQTT_LOG_W ("mqtt-client:%d %s() - , mqtt reconnect timeout." , __LINE__ , __FUNCTION__ );
953
953
}
954
954
}
955
955
@@ -993,7 +993,7 @@ static int mqtt_connect_with_results(mqtt_client_t* c)
993
993
RETURN_ERROR (rc );
994
994
}
995
995
996
- MQTT_LOG_I ("mqtt-client:%d %s()... mqtt connect success... " , __LINE__ , __FUNCTION__ );
996
+ MQTT_LOG_I ("mqtt-client:%d %s() - mqtt connect success" , __LINE__ , __FUNCTION__ );
997
997
998
998
connect_data .keepAliveInterval = c -> mqtt_keep_alive_interval ;
999
999
connect_data .cleansession = c -> mqtt_clean_session ;
@@ -1047,7 +1047,7 @@ static int mqtt_connect_with_results(mqtt_client_t* c)
1047
1047
/*creat the thread fail and disconnect the mqtt socket connect*/
1048
1048
network_release (c -> mqtt_network );
1049
1049
rc = MQTT_CONNECT_FAILED_ERROR ;
1050
- MQTT_LOG_W ("mqtt-client:%d %s()... mqtt yield thread creat failed... " , __LINE__ , __FUNCTION__ );
1050
+ MQTT_LOG_W ("mqtt-client:%d %s() - mqtt yield thread creat failed" , __LINE__ , __FUNCTION__ );
1051
1051
}
1052
1052
} else {
1053
1053
mqtt_set_client_state (c , CLIENT_STATE_CONNECTED ); /* reconnect, mqtt thread is already exists */
@@ -1081,7 +1081,7 @@ static uint32_t mqtt_read_buf_malloc(mqtt_client_t* c, uint32_t size)
1081
1081
c -> mqtt_read_buf = (uint8_t * ) platform_memory_alloc (c -> mqtt_read_buf_size );
1082
1082
1083
1083
if (NULL == c -> mqtt_read_buf ) {
1084
- MQTT_LOG_E ("mqtt-client:%d %s()... malloc read buf failed... " , __LINE__ , __FUNCTION__ );
1084
+ MQTT_LOG_E ("mqtt-client:%d %s() - malloc read buf failed" , __LINE__ , __FUNCTION__ );
1085
1085
RETURN_ERROR (MQTT_MEM_NOT_ENOUGH_ERROR );
1086
1086
}
1087
1087
return c -> mqtt_read_buf_size ;
@@ -1103,7 +1103,7 @@ static uint32_t mqtt_write_buf_malloc(mqtt_client_t* c, uint32_t size)
1103
1103
c -> mqtt_write_buf = (uint8_t * ) platform_memory_alloc (c -> mqtt_write_buf_size );
1104
1104
1105
1105
if (NULL == c -> mqtt_write_buf ) {
1106
- MQTT_LOG_E ("mqtt-client:%d %s()... malloc write buf failed... " , __LINE__ , __FUNCTION__ );
1106
+ MQTT_LOG_E ("mqtt-client:%d %s() - malloc write buf failed" , __LINE__ , __FUNCTION__ );
1107
1107
RETURN_ERROR (MQTT_MEM_NOT_ENOUGH_ERROR );
1108
1108
}
1109
1109
return c -> mqtt_write_buf_size ;
@@ -1115,7 +1115,7 @@ static int mqtt_init(mqtt_client_t* c)
1115
1115
c -> mqtt_network = (network_t * ) platform_memory_alloc (sizeof (network_t ));
1116
1116
1117
1117
if (NULL == c -> mqtt_network ) {
1118
- MQTT_LOG_E ("mqtt-client:%d %s()... malloc memory failed... " , __LINE__ , __FUNCTION__ );
1118
+ MQTT_LOG_E ("mqtt-client:%d %s() - malloc memory failed" , __LINE__ , __FUNCTION__ );
1119
1119
RETURN_ERROR (MQTT_MEM_NOT_ENOUGH_ERROR );
1120
1120
}
1121
1121
memset (c -> mqtt_network , 0 , sizeof (network_t ));
@@ -1198,7 +1198,7 @@ int mqtt_keep_alive(mqtt_client_t* c)
1198
1198
1199
1199
if (platform_timer_is_expired (& c -> mqtt_last_sent ) || platform_timer_is_expired (& c -> mqtt_last_received )) {
1200
1200
if (c -> mqtt_ping_outstanding ) {
1201
- MQTT_LOG_W ("mqtt-client:%d %s()... ping outstanding" , __LINE__ , __FUNCTION__ );
1201
+ MQTT_LOG_W ("mqtt-client:%d %s() - ping outstanding" , __LINE__ , __FUNCTION__ );
1202
1202
/*must realse the socket file descriptor zhaoshimin 20200629*/
1203
1203
network_release (c -> mqtt_network );
1204
1204
@@ -1250,7 +1250,7 @@ int mqtt_release(mqtt_client_t* c)
1250
1250
while ((CLIENT_STATE_INVALID != mqtt_get_client_state (c ))) {
1251
1251
// platform_timer_usleep(1000); // 1ms avoid compiler optimization.
1252
1252
if (platform_timer_is_expired (& timer )) {
1253
- MQTT_LOG_E ("mqtt-client:%d %s()... mqtt release failed... " , __LINE__ , __FUNCTION__ );
1253
+ MQTT_LOG_E ("mqtt-client:%d %s() - mqtt release failed" , __LINE__ , __FUNCTION__ );
1254
1254
RETURN_ERROR (MQTT_FAILED_ERROR )
1255
1255
}
1256
1256
}
@@ -1415,7 +1415,7 @@ int mqtt_publish(mqtt_client_t* c, const char* topic_filter, mqtt_message_t* msg
1415
1415
msg -> payloadlen = strlen ((char * )msg -> payload );
1416
1416
1417
1417
if (msg -> payloadlen > c -> mqtt_write_buf_size ) {
1418
- MQTT_LOG_E ("publish payload len is is greater than client write buffer... " );
1418
+ MQTT_LOG_E ("publish payload len is is greater than client write buffer" );
1419
1419
RETURN_ERROR (MQTT_BUFFER_TOO_SHORT_ERROR );
1420
1420
}
1421
1421
@@ -1457,7 +1457,7 @@ int mqtt_publish(mqtt_client_t* c, const char* topic_filter, mqtt_message_t* msg
1457
1457
platform_mutex_unlock (& c -> mqtt_write_lock );
1458
1458
1459
1459
if ((MQTT_ACK_HANDLER_NUM_TOO_MUCH_ERROR == rc ) || (MQTT_MEM_NOT_ENOUGH_ERROR == rc )) {
1460
- MQTT_LOG_W ("mqtt-client:%d %s()... there is not enough memory space to record... " , __LINE__ , __FUNCTION__ );
1460
+ MQTT_LOG_W ("mqtt-client:%d %s() - there is not enough memory space to record" , __LINE__ , __FUNCTION__ );
1461
1461
1462
1462
/*must realse the socket file descriptor zhaoshimin 20200629*/
1463
1463
network_release (c -> mqtt_network );
@@ -1482,13 +1482,13 @@ int mqtt_list_subscribe_topic(mqtt_client_t* c)
1482
1482
RETURN_ERROR (MQTT_NULL_VALUE_ERROR );
1483
1483
1484
1484
if (mqtt_list_is_empty (& c -> mqtt_msg_handler_list ))
1485
- MQTT_LOG_I ("mqtt-client:%d %s()... there are no subscribed topics... " , __LINE__ , __FUNCTION__ );
1485
+ MQTT_LOG_I ("mqtt-client:%d %s() - there are no subscribed topics" , __LINE__ , __FUNCTION__ );
1486
1486
1487
1487
LIST_FOR_EACH_SAFE (curr , next , & c -> mqtt_msg_handler_list ) {
1488
1488
msg_handler = LIST_ENTRY (curr , message_handlers_t , list );
1489
1489
/* determine whether a node already exists by mqtt topic, but wildcards are not supported */
1490
1490
if (NULL != msg_handler -> topic_filter ) {
1491
- MQTT_LOG_I ("mqtt-client:%d %s()... [%d] subscribe topic: %s" , __LINE__ , __FUNCTION__ , ++ i ,msg_handler -> topic_filter );
1491
+ MQTT_LOG_I ("mqtt-client:%d %s() - [%d] subscribe topic: %s" , __LINE__ , __FUNCTION__ , ++ i ,msg_handler -> topic_filter );
1492
1492
}
1493
1493
}
1494
1494
0 commit comments