@@ -195,16 +195,17 @@ static void lte_callback_handler(void* arg)
195195static bool lte_push_at_command_ext (char * cmd_str , uint32_t timeout , const char * expected_rsp , size_t len ) {
196196 lte_task_cmd_data_t cmd = { .timeout = timeout , .dataLen = len };
197197 memcpy (cmd .data , cmd_str , len );
198+ uint32_t start = mp_hal_ticks_ms ();
198199 if (lte_debug )
199- printf ("[AT] %s\n" , cmd_str );
200+ printf ("[AT] %u % s\n" , start , cmd_str );
200201 lteppp_send_at_command (& cmd , & modlte_rsp );
201202 if ((expected_rsp == NULL ) || (strstr (modlte_rsp .data , expected_rsp ) != NULL )) {
202203 if (lte_debug )
203- printf ("[AT-OK] % s\n" , modlte_rsp .data );
204+ printf ("[AT-OK] +%u % s\n" , mp_hal_ticks_ms () - start , modlte_rsp .data );
204205 return true;
205206 }
206207 if (lte_debug )
207- printf ("[AT-FAIL] % s\n" , modlte_rsp .data );
208+ printf ("[AT-FAIL] +%u % s\n" , mp_hal_ticks_ms () - start , modlte_rsp .data );
208209 return false;
209210}
210211
@@ -1186,12 +1187,12 @@ STATIC mp_obj_t lte_disconnect(mp_obj_t self_in) {
11861187 lte_pause_ppp ();
11871188 }
11881189 lteppp_set_state (E_LTE_ATTACHED );
1189- lte_push_at_command ("ATH" , LTE_RX_TIMEOUT_MIN_MS );
1190+ lte_push_at_command ("ATH" , LTE_RX_TIMEOUT_MAX_MS );
11901191 while (true) {
1191- mp_hal_delay_ms (LTE_RX_TIMEOUT_MIN_MS );
11921192 if (lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS )) {
11931193 break ;
11941194 }
1195+ mp_hal_delay_ms (LTE_RX_TIMEOUT_MIN_MS );
11951196 }
11961197 lte_check_attached (lte_legacyattach_flag );
11971198 mod_network_deregister_nic (& lte_obj );
0 commit comments