Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 12b7177

Browse files
committed
Fixed changes recommended by @peter-pycom
1 parent 4312085 commit 12b7177

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

esp32/lte/lteppp.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,17 +658,21 @@ static bool lteppp_send_at_cmd_exp (const char *cmd, uint32_t timeout, const cha
658658
}
659659
#endif
660660
// flush the rx buffer first
661-
if(!expect_continuation ||
662-
(len >= 2 && cmd[0] == 'A' && cmd[1] == 'T')) // starts with AT
661+
if(!expect_continuation || (len >= 2 && cmd[0] == 'A' && cmd[1] == 'T')) // starts with AT
662+
{
663663
uart_flush(LTE_UART_ID);
664+
}
664665
// uart_read_bytes(LTE_UART_ID, (uint8_t *)tmp_buf, sizeof(tmp_buf), 5 / portTICK_RATE_MS);
665666
// then send the command
666667
uart_write_bytes(LTE_UART_ID, cmd, cmd_len);
667668

668669
if(expect_continuation)
670+
{
669671
return true;
672+
}
670673
else {
671-
if (strcmp(cmd, "+++")) {
674+
if (strcmp(cmd, "+++"))
675+
{
672676
uart_write_bytes(LTE_UART_ID, "\r", 1);
673677
}
674678

esp32/mods/modlte.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,11 +1236,11 @@ STATIC mp_obj_t lte_send_at_cmd(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m
12361236
lte_check_inppp();
12371237
STATIC const mp_arg_t allowed_args[] = {
12381238
{ MP_QSTR_cmd, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = mp_const_none} },
1239-
{ MP_QSTR_delay, MP_ARG_INT, {.u_int = 10000} }
1239+
{ MP_QSTR_delay, MP_ARG_INT, {.u_int = LTE_RX_TIMEOUT_MAX_MS} }
12401240
};
12411241
// parse args
1242-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
12431242
uint32_t argLength = MP_ARRAY_SIZE(allowed_args);
1243+
mp_arg_val_t args[argLength];
12441244
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
12451245
if (args[0].u_obj == mp_const_none) {
12461246
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "the command must be specified!"));

0 commit comments

Comments
 (0)