at: fix GPS disabling on suspend

This commit is contained in:
Arnaud Ferraris
2020-12-11 13:30:36 +01:00
parent 664f82d570
commit 9713af7ca8

View File

@@ -55,7 +55,9 @@ static gboolean send_at_command(struct EG25Manager *manager)
struct AtCommand *at_cmd = g_list_nth_data(manager->at_cmds, 0); struct AtCommand *at_cmd = g_list_nth_data(manager->at_cmds, 0);
if (at_cmd) { if (at_cmd) {
if (at_cmd->subcmd == NULL && at_cmd->value == NULL) if (at_cmd->subcmd == NULL && at_cmd->value == NULL && at_cmd->expected == NULL)
sprintf(command, "AT+%s\r\n", at_cmd->cmd);
else if (at_cmd->subcmd == NULL && at_cmd->value == NULL)
sprintf(command, "AT+%s?\r\n", at_cmd->cmd); sprintf(command, "AT+%s?\r\n", at_cmd->cmd);
else if (at_cmd->subcmd == NULL && at_cmd->value) else if (at_cmd->subcmd == NULL && at_cmd->value)
sprintf(command, "AT+%s=%s\r\n", at_cmd->cmd, at_cmd->value); sprintf(command, "AT+%s=%s\r\n", at_cmd->cmd, at_cmd->value);
@@ -262,7 +264,7 @@ void at_sequence_configure(struct EG25Manager *manager)
void at_sequence_suspend(struct EG25Manager *manager) void at_sequence_suspend(struct EG25Manager *manager)
{ {
append_at_command(manager, "QGPS", NULL, "0", NULL); append_at_command(manager, "QGPSEND", NULL, NULL, NULL);
append_at_command(manager, "QCFG", "urc/cache", "1", NULL); append_at_command(manager, "QCFG", "urc/cache", "1", NULL);
send_at_command(manager); send_at_command(manager);
} }