New upstream release 0.0.5

This commit is contained in:
Arnaud Ferraris
2020-12-11 13:38:19 +01:00
6 changed files with 13 additions and 16 deletions

View File

@@ -8,7 +8,7 @@
project ( project (
'eg25manager', 'eg25manager',
'c', 'c',
version : '0.0.1', version : '0.0.5',
license : 'GPLv3+', license : 'GPLv3+',
meson_version : '>= 0.50.0', meson_version : '>= 0.50.0',
default_options : default_options :

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);
@@ -195,6 +197,9 @@ static gboolean modem_response(gint fd,
retry_at_command(manager); retry_at_command(manager);
else if (strstr(response, "OK")) else if (strstr(response, "OK"))
process_at_result(manager, response); process_at_result(manager, response);
else
// Not a recognized response, try running next command, just in case
next_at_command(manager);
} }
return TRUE; return TRUE;
@@ -259,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);
} }

View File

@@ -135,20 +135,14 @@ error:
manager->modem_state = EG25_STATE_RESETTING; manager->modem_state = EG25_STATE_RESETTING;
} }
void modem_suspend_pre(struct EG25Manager *manager) void modem_suspend(struct EG25Manager *manager)
{ {
manager->modem_state = EG25_STATE_SUSPENDING;
gpio_sequence_suspend(manager); gpio_sequence_suspend(manager);
}
void modem_suspend_post(struct EG25Manager *manager)
{
at_sequence_suspend(manager); at_sequence_suspend(manager);
} }
void modem_resume_pre(struct EG25Manager *manager) void modem_resume_pre(struct EG25Manager *manager)
{ {
manager->modem_state = EG25_STATE_RESUMING;
gpio_sequence_resume(manager); gpio_sequence_resume(manager);
} }

View File

@@ -51,8 +51,7 @@ struct EG25Manager {
void modem_configure(struct EG25Manager *data); void modem_configure(struct EG25Manager *data);
void modem_reset(struct EG25Manager *data); void modem_reset(struct EG25Manager *data);
void modem_suspend_pre(struct EG25Manager *data); void modem_suspend(struct EG25Manager *data);
void modem_suspend_post(struct EG25Manager *data);
void modem_resume_pre(struct EG25Manager *data); void modem_resume_pre(struct EG25Manager *data);
void modem_resume_post(struct EG25Manager *data); void modem_resume_post(struct EG25Manager *data);
void modem_update_state(struct EG25Manager *data, MMModemState state); void modem_update_state(struct EG25Manager *data, MMModemState state);

View File

@@ -132,9 +132,6 @@ static void object_removed_cb(struct EG25Manager *manager, GDBusObject *object)
path = g_dbus_object_get_object_path(object); path = g_dbus_object_get_object_path(object);
g_message("ModemManager object `%s' removed", path); g_message("ModemManager object `%s' removed", path);
if (manager->modem_state == EG25_STATE_SUSPENDING)
modem_suspend_post(manager);
manager->mm_modem = NULL; manager->mm_modem = NULL;
if (manager->modem_usb_id) { if (manager->modem_usb_id) {
g_free(manager->modem_usb_id); g_free(manager->modem_usb_id);

View File

@@ -92,11 +92,13 @@ static void signal_cb(GDBusProxy *proxy,
if (is_about_to_suspend) { if (is_about_to_suspend) {
g_message("system is about to suspend"); g_message("system is about to suspend");
modem_suspend_pre(manager); manager->modem_state = EG25_STATE_SUSPENDING;
modem_suspend(manager);
} else { } else {
g_message("system is resuming"); g_message("system is resuming");
take_inhibitor(manager); take_inhibitor(manager);
modem_resume_pre(manager); modem_resume_pre(manager);
manager->modem_state = EG25_STATE_RESUMING;
manager->suspend_source = g_timeout_add_seconds(8, G_SOURCE_FUNC(check_modem_resume), manager); manager->suspend_source = g_timeout_add_seconds(8, G_SOURCE_FUNC(check_modem_resume), manager);
} }
} }