Merge branch 'at_logging' into 'master'

Fix logging of at commands (was preventing sending them)

See merge request mobian1/devices/eg25-manager!36
This commit is contained in:
Arnaud Ferraris
2021-10-05 20:33:55 +00:00

View File

@@ -83,8 +83,6 @@ gboolean at_send_command(struct EG25Manager *manager)
manager->at_callback = at_cmd->callback; manager->at_callback = at_cmd->callback;
g_message("Sending command: %s", g_strstrip(command));
do { do {
ret = write(manager->at_fd, &command[pos], len); ret = write(manager->at_fd, &command[pos], len);
@@ -243,12 +241,15 @@ static gboolean modem_response(gint fd,
} while (ret > 0 && pos < (sizeof(response) - 1)); } while (ret > 0 && pos < (sizeof(response) - 1));
if (pos > 0) { if (pos > 0) {
g_autofree gchar *escaped = NULL;
response[pos] = 0; response[pos] = 0;
g_strstrip(response); g_strstrip(response);
if (strlen(response) == 0) if (strlen(response) == 0)
return TRUE; return TRUE;
g_message("Response: [%s]", response); escaped = g_strescape(response, "\"");
g_message("Response: [%s]", escaped);
/* /*
* When the modem is started, it outputs 'RDY' to indicate that * When the modem is started, it outputs 'RDY' to indicate that