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

Commit d93abce

Browse files
committed
Update modlte.c
Assign LTE_RX_TIMEOUT_MAX_MS as default value
1 parent 09e39fe commit d93abce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

esp32/mods/modlte.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ STATIC mp_obj_t lte_send_at_cmd(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m
12311231
lte_check_inppp();
12321232
STATIC const mp_arg_t allowed_args[] = {
12331233
{ MP_QSTR_cmd, MP_ARG_OBJ, {.u_obj = mp_const_none} },
1234-
{ MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_obj = mp_const_none} },
1234+
{ MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = LTE_RX_TIMEOUT_MAX_MS} },
12351235
};
12361236
// parse args
12371237
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
@@ -1242,7 +1242,7 @@ STATIC mp_obj_t lte_send_at_cmd(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m
12421242
if (MP_OBJ_IS_STR_OR_BYTES(args[0].u_obj))
12431243
{
12441244
size_t len;
1245-
lte_push_at_command_ext((char *)(mp_obj_str_get_data(args[0].u_obj, &len)), args[1].u_obj == mp_const_none ? LTE_RX_TIMEOUT_MAX_MS : args[1].u_int, NULL, len);
1245+
lte_push_at_command_ext((char *)(mp_obj_str_get_data(args[0].u_obj, &len)), args[1].u_int, NULL, len);
12461246
}
12471247
else
12481248
{
@@ -1254,7 +1254,7 @@ STATIC mp_obj_t lte_send_at_cmd(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m
12541254
vstr_add_str(&vstr, modlte_rsp.data);
12551255
while(modlte_rsp.data_remaining)
12561256
{
1257-
lte_push_at_command_ext("Pycom_Dummy", args[1].u_obj == mp_const_none ? LTE_RX_TIMEOUT_MAX_MS : args[1].u_int, NULL, strlen("Pycom_Dummy") );
1257+
lte_push_at_command_ext("Pycom_Dummy", args[1].u_int, NULL, strlen("Pycom_Dummy") );
12581258
vstr_add_str(&vstr, modlte_rsp.data);
12591259
}
12601260
return mp_obj_new_str_from_vstr(&mp_type_str, &vstr);

0 commit comments

Comments
 (0)