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

Commit 572788e

Browse files
author
Islam Wahdan
authored
Merge pull request #348 from robert-hh/Dev
mods/pyblte.c: Fix the lenght field for AT commands
2 parents aaccab0 + 88499f1 commit 572788e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

esp32/mods/modlte.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,10 @@ static bool lte_check_legacy_version(void) {
301301

302302
static int lte_get_modem_version(void)
303303
{
304-
lte_task_cmd_data_t cmd = { .timeout = LTE_RX_TIMEOUT_MAX_MS };
305-
306304
/* Get modem version */
307-
memcpy(cmd.data, "AT!=\"showver\"", strlen("AT!=\"showver\""));
308305
char * ver = NULL;
309306

310-
lteppp_send_at_command(&cmd, &modlte_rsp);
307+
lte_push_at_command_ext("AT!=\"showver\"", LTE_RX_TIMEOUT_MAX_MS, NULL, strlen("AT!=\"showver\""));
311308
ver = strstr(modlte_rsp.data, "Software :");
312309

313310
if(ver != NULL )
@@ -649,11 +646,8 @@ STATIC mp_obj_t lte_attach(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t
649646
if (strstr(modlte_rsp.data, carrier)) {
650647
lte_obj.carrier = false;
651648
/* Get configured bands in modem */
652-
lte_task_cmd_data_t cmd = { .timeout = LTE_RX_TIMEOUT_MAX_MS };
653-
memcpy(cmd.data, "AT+SMDD", strlen("AT+SMDD"));
654-
lteppp_send_at_command(&cmd, &modlte_rsp);
649+
lte_push_at_command_ext("AT+SMDD", LTE_RX_TIMEOUT_MAX_MS, NULL, strlen("AT+SMDD"));
655650
/* Dummy command for command response > Uart buff size */
656-
memcpy(cmd.data, "Pycom_Dummy", strlen("Pycom_Dummy"));
657651
MP_THREAD_GIL_EXIT();
658652
if(strstr(modlte_rsp.data, "17 bands") != NULL)
659653
{
@@ -667,7 +661,7 @@ STATIC mp_obj_t lte_attach(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t
667661
is_hw_new_band_support = true;
668662
}
669663
}
670-
lteppp_send_at_command(&cmd, &modlte_rsp);
664+
lte_push_at_command_ext("Pycom_Dummy", LTE_RX_TIMEOUT_MAX_MS, NULL, strlen("Pycom_Dummy"));
671665
}
672666
MP_THREAD_GIL_ENTER();
673667
int version = lte_get_modem_version();

0 commit comments

Comments
 (0)