@@ -184,14 +184,9 @@ int qcloud_iot_mqtt_resubscribe(Qcloud_IoT_Client *pClient) {
184184
185185 POINTER_SANITY_CHECK (pClient , QCLOUD_ERR_INVAL );
186186
187- Timer timer ;
188- uint32_t len = 0 ;
189187 uint32_t itr = 0 ;
190188 char * topic = NULL ;
191189 SubscribeParams temp_param ;
192- uint16_t packet_id = 0 ;
193-
194- ListNode * node = NULL ;
195190
196191 if (NULL == pClient ) {
197192 IOT_FUNC_EXIT_RC (QCLOUD_ERR_INVAL );
@@ -215,47 +210,6 @@ int qcloud_iot_mqtt_resubscribe(Qcloud_IoT_Client *pClient) {
215210 Log_e ("resubscribe failed %d, topic: %s" , rc , topic );
216211 IOT_FUNC_EXIT_RC (rc );
217212 }
218-
219- #if 0
220- InitTimer (& timer );
221- countdown_ms (& timer , pClient -> command_timeout_ms );
222-
223- HAL_MutexLock (pClient -> lock_write_buf );
224- packet_id = get_next_packet_id (pClient );
225- rc = _serialize_subscribe_packet (pClient -> write_buf , pClient -> write_buf_size , 0 , packet_id , 1 ,
226- & topic , & (pClient -> sub_handles [itr ].qos ), & len );
227- if (QCLOUD_ERR_SUCCESS != rc ) {
228- HAL_MutexUnlock (pClient -> lock_write_buf );
229- IOT_FUNC_EXIT_RC (rc );
230- }
231-
232- /* 等待 sub ack 列表中添加元素 */
233- SubTopicHandle sub_handle ;
234- sub_handle .topic_filter = topic ;
235- sub_handle .message_handler = pClient -> sub_handles [itr ].message_handler ;
236- sub_handle .qos = pClient -> sub_handles [itr ].qos ;
237- sub_handle .message_handler_data = pClient -> sub_handles [itr ].message_handler_data ;
238-
239- rc = push_sub_info_to (pClient , len , (unsigned int )packet_id , SUBSCRIBE , & sub_handle , & node );
240- if (QCLOUD_ERR_SUCCESS != rc ) {
241- Log_e ("push publish into to pubInfolist failed!" );
242- HAL_MutexUnlock (pClient -> lock_write_buf );
243- IOT_FUNC_EXIT_RC (rc );
244- }
245-
246- // 发送SUBSCRIBE报文
247- rc = send_mqtt_packet (pClient , len , & timer );
248- if (QCLOUD_ERR_SUCCESS != rc ) {
249- HAL_MutexLock (pClient -> lock_list_sub );
250- list_remove (pClient -> list_sub_wait_ack , node );
251- HAL_MutexUnlock (pClient -> lock_list_sub );
252-
253- HAL_MutexUnlock (pClient -> lock_write_buf );
254- IOT_FUNC_EXIT_RC (rc );
255- }
256-
257- HAL_MutexUnlock (pClient -> lock_write_buf );
258- #endif
259213 }
260214
261215 IOT_FUNC_EXIT_RC (QCLOUD_ERR_SUCCESS );
0 commit comments