Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed changes recommended by @peter-pycom
  • Loading branch information
ftylitak committed Jul 16, 2020
commit 12b7177229d577c1c835b8571a25b4008a5b024c
10 changes: 7 additions & 3 deletions esp32/lte/lteppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,17 +658,21 @@ static bool lteppp_send_at_cmd_exp (const char *cmd, uint32_t timeout, const cha
}
#endif
// flush the rx buffer first
if(!expect_continuation ||
(len >= 2 && cmd[0] == 'A' && cmd[1] == 'T')) // starts with AT
if(!expect_continuation || (len >= 2 && cmd[0] == 'A' && cmd[1] == 'T')) // starts with AT
{
uart_flush(LTE_UART_ID);
}
// uart_read_bytes(LTE_UART_ID, (uint8_t *)tmp_buf, sizeof(tmp_buf), 5 / portTICK_RATE_MS);
// then send the command
uart_write_bytes(LTE_UART_ID, cmd, cmd_len);

if(expect_continuation)
{
return true;
}
else {
if (strcmp(cmd, "+++")) {
if (strcmp(cmd, "+++"))
{
uart_write_bytes(LTE_UART_ID, "\r", 1);
}

Expand Down
4 changes: 2 additions & 2 deletions esp32/mods/modlte.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
lte_check_inppp();
STATIC const mp_arg_t allowed_args[] = {
{ MP_QSTR_cmd, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = mp_const_none} },
{ MP_QSTR_delay, MP_ARG_INT, {.u_int = 10000} }
{ MP_QSTR_delay, MP_ARG_INT, {.u_int = LTE_RX_TIMEOUT_MAX_MS} }
};
// parse args
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
uint32_t argLength = MP_ARRAY_SIZE(allowed_args);
mp_arg_val_t args[argLength];
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
if (args[0].u_obj == mp_const_none) {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "the command must be specified!"));
Expand Down