@@ -394,10 +394,10 @@ static mp_obj_t lte_init_helper(lte_obj_t *self, const mp_arg_val_t *args) {
394
394
if (!strstr (modlte_rsp .data , carrier )) {
395
395
sprintf (at_cmd , "AT+SQNCTM=\"%s\"" , carrier );
396
396
lte_push_at_command (at_cmd , LTE_RX_TIMEOUT_MAX_MS );
397
- lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true);
397
+ lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
398
398
mp_hal_delay_ms (LTE_RX_TIMEOUT_MIN_MS );
399
- if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true)) {
400
- lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true);
399
+ if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL )) {
400
+ lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
401
401
}
402
402
lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS );
403
403
lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS );
@@ -496,10 +496,10 @@ STATIC mp_obj_t lte_deinit(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t
496
496
if (lte_check_sim_present ()) {
497
497
if (args [1 ].u_bool ) {
498
498
if (lte_push_at_command ("AT+CFUN=4,1" , LTE_RX_TIMEOUT_MAX_MS )) {
499
- lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true);
499
+ lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
500
500
mp_hal_delay_ms (LTE_RX_TIMEOUT_MIN_MS );
501
- if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true)) {
502
- lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true);
501
+ if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL )) {
502
+ lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
503
503
}
504
504
lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS );
505
505
if (!lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS )) {
@@ -516,10 +516,10 @@ STATIC mp_obj_t lte_deinit(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t
516
516
} else {
517
517
if (args [1 ].u_bool ) {
518
518
if (lte_push_at_command ("AT+CFUN=0,1" , LTE_RX_TIMEOUT_MAX_MS )) {
519
- lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true);
519
+ lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
520
520
mp_hal_delay_ms (LTE_RX_TIMEOUT_MIN_MS );
521
- if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true)) {
522
- lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true);
521
+ if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL )) {
522
+ lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
523
523
}
524
524
lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS );
525
525
if (!lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS )) {
@@ -676,10 +676,10 @@ mp_obj_t lte_detach(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_arg
676
676
if (lte_check_sim_present ()) {
677
677
if (args [0 ].u_bool ) {
678
678
if (lte_push_at_command ("AT+CFUN=4,1" , LTE_RX_TIMEOUT_MAX_MS )) {
679
- lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true);
679
+ lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
680
680
mp_hal_delay_ms (LTE_RX_TIMEOUT_MIN_MS );
681
- if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true)) {
682
- lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true);
681
+ if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL )) {
682
+ lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
683
683
}
684
684
lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS );
685
685
if (!lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS )) {
@@ -696,10 +696,10 @@ mp_obj_t lte_detach(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_arg
696
696
} else {
697
697
if (args [0 ].u_bool ) {
698
698
if (lte_push_at_command ("AT+CFUN=0,1" , LTE_RX_TIMEOUT_MAX_MS )) {
699
- lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true);
699
+ lteppp_wait_at_rsp ("+S" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
700
700
mp_hal_delay_ms (LTE_RX_TIMEOUT_MIN_MS );
701
- if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true)) {
702
- lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true);
701
+ if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL )) {
702
+ lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
703
703
}
704
704
lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS );
705
705
if (!lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS )) {
@@ -922,8 +922,14 @@ STATIC mp_obj_t lte_send_at_cmd(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m
922
922
const char * cmd = mp_obj_str_get_str (args [0 ].u_obj );
923
923
lte_push_at_command_delay ((char * )cmd , LTE_RX_TIMEOUT_MAX_MS , args [1 ].u_int );
924
924
vstr_t vstr ;
925
- vstr_init_len (& vstr , strlen (modlte_rsp .data ));
926
- strcpy (vstr .buf , modlte_rsp .data );
925
+ vstr_init (& vstr , 0 );
926
+ vstr_add_str (& vstr , modlte_rsp .data );
927
+ while (modlte_rsp .data_remaining )
928
+ {
929
+ lte_push_at_command_delay ("Pycom_Dummy" , LTE_RX_TIMEOUT_MAX_MS , args [1 ].u_int );
930
+ vstr_add_str (& vstr , modlte_rsp .data );
931
+ }
932
+
927
933
return mp_obj_new_str_from_vstr (& mp_type_str , & vstr );
928
934
}
929
935
STATIC MP_DEFINE_CONST_FUN_OBJ_KW (lte_send_at_cmd_obj , 1 , lte_send_at_cmd );
@@ -1015,8 +1021,8 @@ STATIC mp_obj_t lte_reset(mp_obj_t self_in) {
1015
1021
lte_push_at_command ("AT^RESET" , LTE_RX_TIMEOUT_MAX_MS );
1016
1022
lteppp_set_state (E_LTE_IDLE );
1017
1023
mp_hal_delay_ms (LTE_RX_TIMEOUT_MIN_MS );
1018
- if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true)) {
1019
- lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true);
1024
+ if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL )) {
1025
+ lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
1020
1026
}
1021
1027
lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS );
1022
1028
if (!lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS )) {
@@ -1036,8 +1042,8 @@ STATIC mp_obj_t lte_factory_reset(mp_obj_t self_in) {
1036
1042
lte_push_at_command ("AT^RESET" , LTE_RX_TIMEOUT_MAX_MS );
1037
1043
lteppp_set_state (E_LTE_IDLE );
1038
1044
mp_hal_delay_ms (LTE_RX_TIMEOUT_MIN_MS );
1039
- if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true)) {
1040
- lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true);
1045
+ if (!lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL )) {
1046
+ lteppp_wait_at_rsp ("+SYSSTART" , LTE_RX_TIMEOUT_MAX_MS , true, NULL );
1041
1047
}
1042
1048
lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS );
1043
1049
if (!lte_push_at_command ("AT" , LTE_RX_TIMEOUT_MAX_MS )) {
0 commit comments