Skip to content

Commit dbe74ff

Browse files
jbrzozoskirlubos
authored andcommitted
drivers: at_cmd: Add more logging
Add extra logging to show all received data, and also relevant warnings when it is likely that the AT notification handler was accidentally overwritten. Signed-off-by: Justin Brzozoski <[email protected]>
1 parent a35b202 commit dbe74ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/at_cmd/at_cmd.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ static void socket_thread_fn(void *arg1, void *arg2, void *arg3)
171171
goto next;
172172
}
173173

174+
LOG_DBG("at_cmd_rx: %s", log_strdup(item->data));
175+
174176
payload_len = get_return_code(item->data, &ret);
175177

176178
if (ret.state != AT_CMD_NOTIFICATION) {
@@ -289,6 +291,11 @@ int at_cmd_write(const char *const cmd,
289291

290292
void at_cmd_set_notification_handler(at_cmd_handler_t handler)
291293
{
294+
LOG_DBG("Setting notification handler to %p", handler);
295+
if ((notification_handler != NULL) && (handler != NULL)) {
296+
LOG_WRN("Forgetting prior notification handler %p",
297+
notification_handler);
298+
}
292299

293300
k_sem_take(&cmd_pending, K_FOREVER);
294301

0 commit comments

Comments
 (0)