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

Commit 92ffa59

Browse files
committed
LTE debug: print milliseconds spent
1 parent 684d948 commit 92ffa59

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

esp32/mods/modlte.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,17 @@ static void lte_callback_handler(void* arg)
195195
static bool lte_push_at_command_ext(char *cmd_str, uint32_t timeout, const char *expected_rsp, size_t len) {
196196
lte_task_cmd_data_t cmd = { .timeout = timeout, .dataLen = len};
197197
memcpy(cmd.data, cmd_str, len);
198+
uint32_t start = mp_hal_ticks_ms();
198199
if (lte_debug)
199-
printf("[AT] %s\n", cmd_str);
200+
printf("[AT] %u %s\n", start, cmd_str);
200201
lteppp_send_at_command(&cmd, &modlte_rsp);
201202
if ((expected_rsp == NULL) || (strstr(modlte_rsp.data, expected_rsp) != NULL)) {
202203
if (lte_debug)
203-
printf("[AT-OK] %s\n", modlte_rsp.data);
204+
printf("[AT-OK] +%u %s\n", mp_hal_ticks_ms()-start, modlte_rsp.data);
204205
return true;
205206
}
206207
if (lte_debug)
207-
printf("[AT-FAIL] %s\n", modlte_rsp.data);
208+
printf("[AT-FAIL] +%u %s\n", mp_hal_ticks_ms()-start, modlte_rsp.data);
208209
return false;
209210
}
210211

0 commit comments

Comments
 (0)