[-]
[+]
|
Changed |
_service:tar_git:eg25-manager.spec
|
|
[-]
[+]
|
Added |
_service:tar_git:0001-mm-iface-clean-out-modem_iface-if-mm-disappears.patch
^
|
@@ -0,0 +1,28 @@
+From 705950bb399781a291a3998014f916fc1effce16 Mon Sep 17 00:00:00 2001
+From: Bhushan Shah <bhush94@gmail.com>
+Date: Thu, 15 Apr 2021 09:29:36 +0530
+Subject: [PATCH 1/8] mm-iface: clean out modem_iface if mm disappears
+
+otherwise we will be stuck in state where restarting of mm will not
+reset the modem_iface and it will loop through hard resetting modem
+---
+ src/mm-iface.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/mm-iface.c b/src/mm-iface.c
+index d6a74f8..0409236 100644
+--- a/src/mm-iface.c
++++ b/src/mm-iface.c
+@@ -183,6 +183,9 @@ static void mm_iface_clean(struct EG25Manager *manager)
+ g_free(manager->modem_usb_id);
+ manager->modem_usb_id = NULL;
+ }
++ if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) {
++ manager->modem_iface = MODEM_IFACE_NONE;
++ }
+ }
+
+ static void mm_vanished_cb(GDBusConnection *connection,
+--
+2.31.1
+
|
[-]
[+]
|
Added |
_service:tar_git:0002-config-synchronize-with-modem-power.patch
^
|
@@ -0,0 +1,97 @@
+From a046b539418958eeb2ee26ec5ef273835c98d0d2 Mon Sep 17 00:00:00 2001
+From: Dylan Van Assche <me@dylanvanassche.be>
+Date: Thu, 15 Apr 2021 20:11:03 +0200
+Subject: [PATCH 2/8] config: synchronize with modem-power
+
+We cannot assume default factory values if other drivers change them
+---
+ data/pine64,pinephone-1.0.toml | 13 +++++++++++--
+ data/pine64,pinephone-1.1.toml | 13 +++++++++++--
+ data/pine64,pinephone-1.2.toml | 12 ++++++++++++
+ 3 files changed, 34 insertions(+), 4 deletions(-)
+
+diff --git a/data/pine64,pinephone-1.0.toml b/data/pine64,pinephone-1.0.toml
+index e1f5b24..6e21bda 100644
+--- a/data/pine64,pinephone-1.0.toml
++++ b/data/pine64,pinephone-1.0.toml
+@@ -39,12 +39,21 @@ configure = [
+ { cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" },
+ { cmd = "QCFG", subcmd = "ims", expect = "1" },
+ { cmd = "QCFG", subcmd = "urc/ri/ring", expect = "\"pulse\",2000,1000,5000,\"off\",1" },
+- { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",2000" },
+- { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1" },
++ { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",2000,1" },
++ { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
+ { cmd = "QCFG", subcmd = "urc/delay", expect = "1" },
+ { cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
+ { cmd = "QGPS", value = "1" },
+ { cmd = "QSCLK", value = "1" },
++# Reset modem-power configurations to what we expect
++ { cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
++ { cmd = "QCFG", subcmd = "fast/poweroff", expect = "1" },
++ { cmd = "QCFG", subcmd = "apready", expect = "0,0,500" },
++ { cmd = "QCFG", subcmd = "sleepind/level", expect = "0" },
++ { cmd = "QCFG", subcmd = "wakeupin/level", expect = "0,0" },
++ { cmd = "QCFG", subcmd = "ApRstLevel", expect = "0" },
++ { cmd = "QCFG", subcmd = "ModemRstLevel", expect = "0" },
++ { cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
+ ]
+ suspend = [
+ { cmd = "QGPSEND" },
+diff --git a/data/pine64,pinephone-1.1.toml b/data/pine64,pinephone-1.1.toml
+index e1f5b24..6e21bda 100644
+--- a/data/pine64,pinephone-1.1.toml
++++ b/data/pine64,pinephone-1.1.toml
+@@ -39,12 +39,21 @@ configure = [
+ { cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" },
+ { cmd = "QCFG", subcmd = "ims", expect = "1" },
+ { cmd = "QCFG", subcmd = "urc/ri/ring", expect = "\"pulse\",2000,1000,5000,\"off\",1" },
+- { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",2000" },
+- { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1" },
++ { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",2000,1" },
++ { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
+ { cmd = "QCFG", subcmd = "urc/delay", expect = "1" },
+ { cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
+ { cmd = "QGPS", value = "1" },
+ { cmd = "QSCLK", value = "1" },
++# Reset modem-power configurations to what we expect
++ { cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
++ { cmd = "QCFG", subcmd = "fast/poweroff", expect = "1" },
++ { cmd = "QCFG", subcmd = "apready", expect = "0,0,500" },
++ { cmd = "QCFG", subcmd = "sleepind/level", expect = "0" },
++ { cmd = "QCFG", subcmd = "wakeupin/level", expect = "0,0" },
++ { cmd = "QCFG", subcmd = "ApRstLevel", expect = "0" },
++ { cmd = "QCFG", subcmd = "ModemRstLevel", expect = "0" },
++ { cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
+ ]
+ suspend = [
+ { cmd = "QGPSEND" },
+diff --git a/data/pine64,pinephone-1.2.toml b/data/pine64,pinephone-1.2.toml
+index 4ca1274..598ebaf 100644
+--- a/data/pine64,pinephone-1.2.toml
++++ b/data/pine64,pinephone-1.2.toml
+@@ -36,9 +36,21 @@ configure = [
+ { cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" },
+ { cmd = "QCFG", subcmd = "ims", expect = "1" },
+ { cmd = "QCFG", subcmd = "apready", expect = "1,0,500" },
++ { cmd = "QCFG", subcmd = "urc/ri/ring", expect = "\"pulse\",120,1000,5000,\"off\",1" },
++ { cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",120,1" },
++ { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
++ { cmd = "QCFG", subcmd = "urc/delay", expect = "0" },
+ { cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
+ { cmd = "QGPS", value = "1" },
+ { cmd = "QSCLK", value = "1" },
++# Reset modem-power configurations to what we expect
++ { cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
++ { cmd = "QCFG", subcmd = "fast/poweroff", expect = "1" },
++ { cmd = "QCFG", subcmd = "sleepind/level", expect = "0" },
++ { cmd = "QCFG", subcmd = "wakeupin/level", expect = "0,0" },
++ { cmd = "QCFG", subcmd = "ApRstLevel", expect = "0" },
++ { cmd = "QCFG", subcmd = "ModemRstLevel", expect = "0" },
++ { cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
+ ]
+ suspend = [
+ { cmd = "QGPSEND" },
+--
+2.31.1
+
|
[-]
[+]
|
Added |
_service:tar_git:0003-at-fast-poweroff-is-only-available-in-newer-firmware.patch
^
|
@@ -0,0 +1,31 @@
+From 0094dea49d8bc5a60c044da1e01417c29397c7b0 Mon Sep 17 00:00:00 2001
+From: Dylan Van Assche <me@dylanvanassche.be>
+Date: Sat, 17 Apr 2021 15:50:07 +0200
+Subject: [PATCH 3/8] at: fast/poweroff is only available in newer firmware
+ versions
+
+Do not retry the AT command of the fast/poweroff setting as it may not be supported by the firmware
+---
+ src/at.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/at.c b/src/at.c
+index a34025f..4469d26 100644
+--- a/src/at.c
++++ b/src/at.c
+@@ -215,7 +215,11 @@ static gboolean modem_response(gint fd,
+ suspend_inhibit(manager, TRUE, TRUE);
+ manager->modem_state = EG25_STATE_STARTED;
+ }
+- else if (strstr(response, "ERROR"))
++ /*
++ * QCFG="fast/poweroff" configuration is only available in
++ * newer firmware versions
++ */
++ else if (strstr(response, "ERROR") && !strstr(response, "fast/poweroff"))
+ retry_at_command(manager);
+ else if (strstr(response, "OK"))
+ process_at_result(manager, response);
+--
+2.31.1
+
|
[-]
[+]
|
Added |
_service:tar_git:0004-at-g_free-doesn-t-require-NULL-checking.patch
^
|
@@ -0,0 +1,46 @@
+From a74d2c58babd2e85a4d1920e0144b5c7ee2231d0 Mon Sep 17 00:00:00 2001
+From: Dylan Van Assche <me@dylanvanassche.be>
+Date: Wed, 12 May 2021 16:41:48 +0200
+Subject: [PATCH 4/8] at: g_free doesn't require NULL checking
+
+From the docs: If mem is NULL it simply returns, so there is no need to check mem against NULL before calling this function.
+---
+ src/at.c | 15 +++++----------
+ 1 file changed, 5 insertions(+), 10 deletions(-)
+
+diff --git a/src/at.c b/src/at.c
+index 4469d26..3ccc5d6 100644
+--- a/src/at.c
++++ b/src/at.c
+@@ -104,14 +104,10 @@ static void next_at_command(struct EG25Manager *manager)
+ if (!at_cmd)
+ return;
+
+- if (at_cmd->cmd)
+- g_free(at_cmd->cmd);
+- if (at_cmd->subcmd)
+- g_free(at_cmd->subcmd);
+- if (at_cmd->value)
+- g_free(at_cmd->value);
+- if (at_cmd->expected)
+- g_free(at_cmd->expected);
++ g_free(at_cmd->cmd);
++ g_free(at_cmd->subcmd);
++ g_free(at_cmd->value);
++ g_free(at_cmd->expected);
+ g_free(at_cmd);
+ manager->at_cmds = g_list_remove(manager->at_cmds, at_cmd);
+
+@@ -142,8 +138,7 @@ static void process_at_result(struct EG25Manager *manager, char *response)
+ return;
+
+ if (at_cmd->expected && !strstr(response, at_cmd->expected)) {
+- if (at_cmd->value)
+- g_free(at_cmd->value);
++ g_free(at_cmd->value);
+ at_cmd->value = at_cmd->expected;
+ at_cmd->expected = NULL;
+ g_message("Got a different result than expected, changing value...");
+--
+2.31.1
+
|
[-]
[+]
|
Added |
_service:tar_git:0005-at-make-next_at_command-send_at_command-process_at_r.patch
^
|
@@ -0,0 +1,176 @@
+From 3a205f7e9baf702dccc572ae2342990052c23155 Mon Sep 17 00:00:00 2001
+From: Dylan Van Assche <me@dylanvanassche.be>
+Date: Wed, 12 May 2021 18:21:29 +0200
+Subject: [PATCH 5/8] at: make next_at_command, send_at_command,
+ process_at_result, and append_at_command public methods
+
+Allows other modules to send AT commands as well
+---
+ src/at.c | 47 ++++++++++++++++++++++++-----------------------
+ src/at.h | 22 ++++++++++++++++------
+ 2 files changed, 40 insertions(+), 29 deletions(-)
+
+diff --git a/src/at.c b/src/at.c
+index 3ccc5d6..1e605a1 100644
+--- a/src/at.c
++++ b/src/at.c
+@@ -52,7 +52,7 @@ static int configure_serial(const char *tty)
+ return fd;
+ }
+
+-static gboolean send_at_command(struct EG25Manager *manager)
++gboolean at_send_command(struct EG25Manager *manager)
+ {
+ char command[256];
+ struct AtCommand *at_cmd = manager->at_cmds ? g_list_nth_data(manager->at_cmds, 0) : NULL;
+@@ -97,7 +97,7 @@ static gboolean send_at_command(struct EG25Manager *manager)
+ return FALSE;
+ }
+
+-static void next_at_command(struct EG25Manager *manager)
++void at_next_command(struct EG25Manager *manager)
+ {
+ struct AtCommand *at_cmd = manager->at_cmds ? g_list_nth_data(manager->at_cmds, 0) : NULL;
+
+@@ -111,7 +111,7 @@ static void next_at_command(struct EG25Manager *manager)
+ g_free(at_cmd);
+ manager->at_cmds = g_list_remove(manager->at_cmds, at_cmd);
+
+- send_at_command(manager);
++ at_send_command(manager);
+ }
+
+ static void retry_at_command(struct EG25Manager *manager)
+@@ -124,13 +124,14 @@ static void retry_at_command(struct EG25Manager *manager)
+ at_cmd->retries++;
+ if (at_cmd->retries > 3) {
+ g_critical("Command %s retried %d times, aborting...", at_cmd->cmd, at_cmd->retries);
+- next_at_command(manager);
++ at_next_command(manager);
+ } else {
+- g_timeout_add(500, G_SOURCE_FUNC(send_at_command), manager);
++ g_timeout_add(500, G_SOURCE_FUNC(at_send_command), manager);
+ }
+ }
+
+-static void process_at_result(struct EG25Manager *manager, char *response)
++void at_process_result(struct EG25Manager *manager,
++ const char *response)
+ {
+ struct AtCommand *at_cmd = manager->at_cmds ? g_list_nth_data(manager->at_cmds, 0) : NULL;
+
+@@ -143,17 +144,17 @@ static void process_at_result(struct EG25Manager *manager, char *response)
+ at_cmd->expected = NULL;
+ g_message("Got a different result than expected, changing value...");
+ g_message("\t%s\n\t%s", at_cmd->expected, response);
+- send_at_command(manager);
++ at_send_command(manager);
+ } else {
+- next_at_command(manager);
++ at_next_command(manager);
+ }
+ }
+
+-static int append_at_command(struct EG25Manager *manager,
+- const char *cmd,
+- const char *subcmd,
+- const char *value,
+- const char *expected)
++int at_append_command(struct EG25Manager *manager,
++ const char *cmd,
++ const char *subcmd,
++ const char *value,
++ const char *expected)
+ {
+ struct AtCommand *at_cmd = calloc(1, sizeof(struct AtCommand));
+
+@@ -217,10 +218,10 @@ static gboolean modem_response(gint fd,
+ else if (strstr(response, "ERROR") && !strstr(response, "fast/poweroff"))
+ retry_at_command(manager);
+ else if (strstr(response, "OK"))
+- process_at_result(manager, response);
++ at_process_result(manager, response);
+ else
+ // Not a recognized response, try running next command, just in case
+- next_at_command(manager);
++ at_next_command(manager);
+ }
+
+ return TRUE;
+@@ -325,34 +326,34 @@ void at_sequence_configure(struct EG25Manager *manager)
+ {
+ for (guint i = 0; i < configure_commands->len; i++) {
+ struct AtCommand *cmd = &g_array_index(configure_commands, struct AtCommand, i);
+- append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
++ at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
+ }
+- send_at_command(manager);
++ at_send_command(manager);
+ }
+
+ void at_sequence_suspend(struct EG25Manager *manager)
+ {
+ for (guint i = 0; i < suspend_commands->len; i++) {
+ struct AtCommand *cmd = &g_array_index(suspend_commands, struct AtCommand, i);
+- append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
++ at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
+ }
+- send_at_command(manager);
++ at_send_command(manager);
+ }
+
+ void at_sequence_resume(struct EG25Manager *manager)
+ {
+ for (guint i = 0; i < resume_commands->len; i++) {
+ struct AtCommand *cmd = &g_array_index(resume_commands, struct AtCommand, i);
+- append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
++ at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
+ }
+- send_at_command(manager);
++ at_send_command(manager);
+ }
+
+ void at_sequence_reset(struct EG25Manager *manager)
+ {
+ for (guint i = 0; i < reset_commands->len; i++) {
+ struct AtCommand *cmd = &g_array_index(reset_commands, struct AtCommand, i);
+- append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
++ at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
+ }
+- send_at_command(manager);
++ at_send_command(manager);
+ }
+diff --git a/src/at.h b/src/at.h
+index ba294a4..e0445af 100644
+--- a/src/at.h
++++ b/src/at.h
+@@ -8,10 +8,20 @@
+
+ #include "manager.h"
+
+-int at_init(struct EG25Manager *data, toml_table_t *config);
+-void at_destroy(struct EG25Manager *data);
++int at_init(struct EG25Manager *manager, toml_table_t *config);
++void at_destroy(struct EG25Manager *manager);
+
+-void at_sequence_configure(struct EG25Manager *data);
+-void at_sequence_suspend(struct EG25Manager *data);
+-void at_sequence_resume(struct EG25Manager *data);
+-void at_sequence_reset(struct EG25Manager *data);
++void at_process_result(struct EG25Manager *manager,
++ const char *response);
++void at_next_command(struct EG25Manager *manager);
++gboolean at_send_command(struct EG25Manager *manager);
++int at_append_command(struct EG25Manager *manager,
++ const char *cmd,
++ const char *subcmd,
++ const char *value,
++ const char *expected);
++
++void at_sequence_configure(struct EG25Manager *manager);
++void at_sequence_suspend(struct EG25Manager *manager);
++void at_sequence_resume(struct EG25Manager *manager);
++void at_sequence_reset(struct EG25Manager *manager);
+--
+2.31.1
+
|
[-]
[+]
|
Added |
_service:tar_git:0006-at-log-expected-result-before-setting-it-to-NULL.patch
^
|
@@ -0,0 +1,29 @@
+From 47a7069c143c0f6a1219a1cef78a51d0f31f0710 Mon Sep 17 00:00:00 2001
+From: Dylan Van Assche <me@dylanvanassche.be>
+Date: Wed, 12 May 2021 18:25:40 +0200
+Subject: [PATCH 6/8] at: log expected result before setting it to NULL
+
+Otherwise the log contains NULL instead of the expected value, making it hard to debug
+---
+ src/at.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/at.c b/src/at.c
+index 1e605a1..533ed1c 100644
+--- a/src/at.c
++++ b/src/at.c
+@@ -141,9 +141,9 @@ void at_process_result(struct EG25Manager *manager,
+ if (at_cmd->expected && !strstr(response, at_cmd->expected)) {
+ g_free(at_cmd->value);
+ at_cmd->value = at_cmd->expected;
+- at_cmd->expected = NULL;
+ g_message("Got a different result than expected, changing value...");
+- g_message("\t%s\n\t%s", at_cmd->expected, response);
++ g_message("Expected: [%s]\nResponse: [%s]", at_cmd->expected, response);
++ at_cmd->expected = NULL;
+ at_send_command(manager);
+ } else {
+ at_next_command(manager);
+--
+2.31.1
+
|
[-]
[+]
|
Added |
_service:tar_git:0007-at-allow-custom-callbacks-for-AT-command-response-pr.patch
^
|
@@ -0,0 +1,158 @@
+From 427944b75e0a4abc4cc2af2f16858739a8833e6e Mon Sep 17 00:00:00 2001
+From: Dylan Van Assche <me@dylanvanassche.be>
+Date: Wed, 12 May 2021 18:34:03 +0200
+Subject: [PATCH 7/8] at: allow custom callbacks for AT command response
+ processing
+
+---
+ src/at.c | 32 +++++++++++++++++---------------
+ src/at.h | 14 +++++++++++++-
+ src/manager.h | 1 +
+ 3 files changed, 31 insertions(+), 16 deletions(-)
+
+diff --git a/src/at.c b/src/at.c
+index 533ed1c..35b7042 100644
+--- a/src/at.c
++++ b/src/at.c
+@@ -16,14 +16,6 @@
+
+ #include <glib-unix.h>
+
+-struct AtCommand {
+- char *cmd;
+- char *subcmd;
+- char *value;
+- char *expected;
+- int retries;
+-};
+-
+ static GArray *configure_commands = NULL;
+ static GArray *suspend_commands = NULL;
+ static GArray *resume_commands = NULL;
+@@ -69,6 +61,7 @@ gboolean at_send_command(struct EG25Manager *manager)
+ len = sprintf(command, "AT+%s=\"%s\"\r\n", at_cmd->cmd, at_cmd->subcmd);
+ else if (at_cmd->subcmd && at_cmd->value)
+ len = sprintf(command, "AT+%s=\"%s\",%s\r\n", at_cmd->cmd, at_cmd->subcmd, at_cmd->value);
++ manager->at_callback = at_cmd->callback;
+
+ ret = write(manager->at_fd, command, len);
+ if (ret < len)
+@@ -154,7 +147,10 @@ int at_append_command(struct EG25Manager *manager,
+ const char *cmd,
+ const char *subcmd,
+ const char *value,
+- const char *expected)
++ const char *expected,
++ void (*callback)
++ (struct EG25Manager *manager,
++ const char *response))
+ {
+ struct AtCommand *at_cmd = calloc(1, sizeof(struct AtCommand));
+
+@@ -168,6 +164,8 @@ int at_append_command(struct EG25Manager *manager,
+ at_cmd->value = g_strdup(value);
+ if (expected)
+ at_cmd->expected = g_strdup(expected);
++ if (callback)
++ at_cmd->callback = callback;
+
+ manager->at_cmds = g_list_append(manager->at_cmds, at_cmd);
+
+@@ -217,8 +215,12 @@ static gboolean modem_response(gint fd,
+ */
+ else if (strstr(response, "ERROR") && !strstr(response, "fast/poweroff"))
+ retry_at_command(manager);
+- else if (strstr(response, "OK"))
+- at_process_result(manager, response);
++ else if (strstr(response, "OK")) {
++ if (manager->at_callback != NULL)
++ manager->at_callback(manager, response);
++ else
++ g_warning("AT command succesfull but no callback registered");
++ }
+ else
+ // Not a recognized response, try running next command, just in case
+ at_next_command(manager);
+@@ -326,7 +328,7 @@ void at_sequence_configure(struct EG25Manager *manager)
+ {
+ for (guint i = 0; i < configure_commands->len; i++) {
+ struct AtCommand *cmd = &g_array_index(configure_commands, struct AtCommand, i);
+- at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
++ at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected, at_process_result);
+ }
+ at_send_command(manager);
+ }
+@@ -335,7 +337,7 @@ void at_sequence_suspend(struct EG25Manager *manager)
+ {
+ for (guint i = 0; i < suspend_commands->len; i++) {
+ struct AtCommand *cmd = &g_array_index(suspend_commands, struct AtCommand, i);
+- at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
++ at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected, at_process_result);
+ }
+ at_send_command(manager);
+ }
+@@ -344,7 +346,7 @@ void at_sequence_resume(struct EG25Manager *manager)
+ {
+ for (guint i = 0; i < resume_commands->len; i++) {
+ struct AtCommand *cmd = &g_array_index(resume_commands, struct AtCommand, i);
+- at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
++ at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected, at_process_result);
+ }
+ at_send_command(manager);
+ }
+@@ -353,7 +355,7 @@ void at_sequence_reset(struct EG25Manager *manager)
+ {
+ for (guint i = 0; i < reset_commands->len; i++) {
+ struct AtCommand *cmd = &g_array_index(reset_commands, struct AtCommand, i);
+- at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected);
++ at_append_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected, at_process_result);
+ }
+ at_send_command(manager);
+ }
+diff --git a/src/at.h b/src/at.h
+index e0445af..0364e2c 100644
+--- a/src/at.h
++++ b/src/at.h
+@@ -8,6 +8,15 @@
+
+ #include "manager.h"
+
++typedef struct AtCommand {
++ char *cmd;
++ char *subcmd;
++ char *value;
++ char *expected;
++ void (*callback)(struct EG25Manager *manager, const char *response);
++ int retries;
++} AtCommand;
++
+ int at_init(struct EG25Manager *manager, toml_table_t *config);
+ void at_destroy(struct EG25Manager *manager);
+
+@@ -19,7 +28,10 @@ int at_append_command(struct EG25Manager *manager,
+ const char *cmd,
+ const char *subcmd,
+ const char *value,
+- const char *expected);
++ const char *expected,
++ void (*callback)
++ (struct EG25Manager *manager,
++ const char *response));
+
+ void at_sequence_configure(struct EG25Manager *manager);
+ void at_sequence_suspend(struct EG25Manager *manager);
+diff --git a/src/manager.h b/src/manager.h
+index 30028e6..3cc0118 100644
+--- a/src/manager.h
++++ b/src/manager.h
+@@ -47,6 +47,7 @@ struct EG25Manager {
+ int at_fd;
+ guint at_source;
+ GList *at_cmds;
++ void (*at_callback)(struct EG25Manager *manager, const char *response);
+
+ enum EG25State modem_state;
+ gchar *modem_usb_id;
+--
+2.31.1
+
|
[-]
[+]
|
Added |
_service:tar_git:0008-gnss-add-GNSS-assistance-support.patch
^
|
@@ -0,0 +1,852 @@
+From b5578250c1f2c00972e8c7215458160b04871c5e Mon Sep 17 00:00:00 2001
+From: Dylan Van Assche <me@dylanvanassche.be>
+Date: Wed, 12 May 2021 19:37:21 +0200
+Subject: [PATCH 8/8] gnss: add GNSS assistance support
+
+Automatically fetch the GNSS assistance data from the Web
+to heavily reduce the time to acquire a GNSS lock by uploading
+the assistance data to the modem.
+This feature is optional and can be disabled in the configuration
+as people may prefer to not download the assistance data from
+the Quectel/Qualcomm servers.
+Also configure the GNSS engine to optimize the performance
+and power consumption.
+---
+ data/pine64,pinephone-1.0.toml | 26 +-
+ data/pine64,pinephone-1.1.toml | 26 +-
+ data/pine64,pinephone-1.2.toml | 26 +-
+ meson.build | 1 +
+ src/at.c | 22 +-
+ src/gnss.c | 478 +++++++++++++++++++++++++++++++++
+ src/gnss.h | 16 ++
+ src/manager.c | 2 +
+ src/manager.h | 34 +++
+ src/meson.build | 1 +
+ src/mm-iface.c | 5 +-
+ 11 files changed, 625 insertions(+), 12 deletions(-)
+ create mode 100644 src/gnss.c
+ create mode 100644 src/gnss.h
+
+diff --git a/data/pine64,pinephone-1.0.toml b/data/pine64,pinephone-1.0.toml
+index 6e21bda..c2ee8bd 100644
+--- a/data/pine64,pinephone-1.0.toml
++++ b/data/pine64,pinephone-1.0.toml
+@@ -43,7 +43,6 @@ configure = [
+ { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
+ { cmd = "QCFG", subcmd = "urc/delay", expect = "1" },
+ { cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
+- { cmd = "QGPS", value = "1" },
+ { cmd = "QSCLK", value = "1" },
+ # Reset modem-power configurations to what we expect
+ { cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
+@@ -54,11 +53,32 @@ configure = [
+ { cmd = "QCFG", subcmd = "ApRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "ModemRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
++# GNSS configuration:
++# * Enable A-GPS data upload support (XTRA)
++# * Disable On-Demand-Positioning (ODP) mode
++# to avoid running the GNSS system in the background, even when not enabled.
++# * Enable Dynamic Power Optimizations (DPO) mode to turn off GNSS RF radios
++# when they are not in use.
++# * Only enable GPS and GLONASS, disable other GNSS systems.
++# A-GPS data upload doesn't work for Galileo anyway.
++# * Avoid turning on GNSS support automatically when the modem boots.
++ { cmd = "QGPSXTRA", expect = "1" },
++ { cmd = "QGPSCFG", subcmd = "gnssconfig", expect = "4" },
++ { cmd = "QGPSCFG", subcmd = "odpcontrol", expect = "0" },
++ { cmd = "QGPSCFG", subcmd = "dpoenable", expect = "1" },
++ { cmd = "QGPSCFG", subcmd = "gpsnmeatype", expect = "31" },
++ { cmd = "QGPSCFG", subcmd = "glonassnmeatype", expect = "7" },
++ { cmd = "QGPSCFG", subcmd = "galileonmeatype", expect = "0" },
++ { cmd = "QGPSCFG", subcmd = "beidounmeatype", expect = "0" },
++ { cmd = "QGPSCFG", subcmd = "autogps", expect = "0" },
+ ]
+ suspend = [
+- { cmd = "QGPSEND" },
+ ]
+ resume = [
+- { cmd = "QGPS", value = "1" }
+ ]
+ reset = [ { cmd = "CFUN", value = "1,1" } ]
++
++[gnss]
++enabled = true
++url = "https://proxy.postmarketos.org"
++file = "xtra2.bin"
+diff --git a/data/pine64,pinephone-1.1.toml b/data/pine64,pinephone-1.1.toml
+index 6e21bda..c2ee8bd 100644
+--- a/data/pine64,pinephone-1.1.toml
++++ b/data/pine64,pinephone-1.1.toml
+@@ -43,7 +43,6 @@ configure = [
+ { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
+ { cmd = "QCFG", subcmd = "urc/delay", expect = "1" },
+ { cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
+- { cmd = "QGPS", value = "1" },
+ { cmd = "QSCLK", value = "1" },
+ # Reset modem-power configurations to what we expect
+ { cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
+@@ -54,11 +53,32 @@ configure = [
+ { cmd = "QCFG", subcmd = "ApRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "ModemRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
++# GNSS configuration:
++# * Enable A-GPS data upload support (XTRA)
++# * Disable On-Demand-Positioning (ODP) mode
++# to avoid running the GNSS system in the background, even when not enabled.
++# * Enable Dynamic Power Optimizations (DPO) mode to turn off GNSS RF radios
++# when they are not in use.
++# * Only enable GPS and GLONASS, disable other GNSS systems.
++# A-GPS data upload doesn't work for Galileo anyway.
++# * Avoid turning on GNSS support automatically when the modem boots.
++ { cmd = "QGPSXTRA", expect = "1" },
++ { cmd = "QGPSCFG", subcmd = "gnssconfig", expect = "4" },
++ { cmd = "QGPSCFG", subcmd = "odpcontrol", expect = "0" },
++ { cmd = "QGPSCFG", subcmd = "dpoenable", expect = "1" },
++ { cmd = "QGPSCFG", subcmd = "gpsnmeatype", expect = "31" },
++ { cmd = "QGPSCFG", subcmd = "glonassnmeatype", expect = "7" },
++ { cmd = "QGPSCFG", subcmd = "galileonmeatype", expect = "0" },
++ { cmd = "QGPSCFG", subcmd = "beidounmeatype", expect = "0" },
++ { cmd = "QGPSCFG", subcmd = "autogps", expect = "0" },
+ ]
+ suspend = [
+- { cmd = "QGPSEND" },
+ ]
+ resume = [
+- { cmd = "QGPS", value = "1" }
+ ]
+ reset = [ { cmd = "CFUN", value = "1,1" } ]
++
++[gnss]
++enabled = true
++url = "https://proxy.postmarketos.org"
++file = "xtra2.bin"
+diff --git a/data/pine64,pinephone-1.2.toml b/data/pine64,pinephone-1.2.toml
+index 598ebaf..a45c7ec 100644
+--- a/data/pine64,pinephone-1.2.toml
++++ b/data/pine64,pinephone-1.2.toml
+@@ -41,7 +41,6 @@ configure = [
+ { cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
+ { cmd = "QCFG", subcmd = "urc/delay", expect = "0" },
+ { cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
+- { cmd = "QGPS", value = "1" },
+ { cmd = "QSCLK", value = "1" },
+ # Reset modem-power configurations to what we expect
+ { cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
+@@ -51,11 +50,32 @@ configure = [
+ { cmd = "QCFG", subcmd = "ApRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "ModemRstLevel", expect = "0" },
+ { cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
++# GNSS configuration:
++# * Enable A-GPS data upload support (XTRA)
++# * Disable On-Demand-Positioning (ODP) mode
++# to avoid running the GNSS system in the background, even when not enabled.
++# * Enable Dynamic Power Optimizations (DPO) mode to turn off GNSS RF radios
++# when they are not in use.
++# * Only enable GPS and GLONASS, disable other GNSS systems.
++# A-GPS data upload doesn't work for Galileo anyway.
++# * Avoid turning on GNSS support automatically when the modem boots.
++ { cmd = "QGPSXTRA", expect = "1" },
++ { cmd = "QGPSCFG", subcmd = "gnssconfig", expect = "4" },
++ { cmd = "QGPSCFG", subcmd = "odpcontrol", expect = "0" },
++ { cmd = "QGPSCFG", subcmd = "dpoenable", expect = "1" },
++ { cmd = "QGPSCFG", subcmd = "gpsnmeatype", expect = "31" },
++ { cmd = "QGPSCFG", subcmd = "glonassnmeatype", expect = "7" },
++ { cmd = "QGPSCFG", subcmd = "galileonmeatype", expect = "0" },
++ { cmd = "QGPSCFG", subcmd = "beidounmeatype", expect = "0" },
++ { cmd = "QGPSCFG", subcmd = "autogps", expect = "0" },
+ ]
+ suspend = [
+- { cmd = "QGPSEND" },
+ ]
+ resume = [
+- { cmd = "QGPS", value = "1" }
+ ]
+ reset = [ { cmd = "CFUN", value = "1,1" } ]
++
++[gnss]
++enabled = true
++url = "https://proxy.postmarketos.org"
++file = "xtra2.bin"
+diff --git a/meson.build b/meson.build
+index d57d2cb..2852778 100644
+--- a/meson.build
++++ b/meson.build
+@@ -58,6 +58,7 @@ mgr_deps = [
+ dependency('gudev-1.0'),
+ dependency('libgpiod'),
+ dependency('libusb-1.0'),
++ dependency('libcurl'),
+ mmglib_dep,
+ ]
+
+diff --git a/src/at.c b/src/at.c
+index 35b7042..3e0f531 100644
+--- a/src/at.c
++++ b/src/at.c
+@@ -6,6 +6,7 @@
+
+ #include "at.h"
+ #include "suspend.h"
++#include "gnss.h"
+
+ #include <fcntl.h>
+ #include <stdio.h>
+@@ -205,24 +206,41 @@ static gboolean modem_response(gint fd,
+
+ g_message("Response: [%s]", response);
+
++ /*
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/sailfish-on-dontbeevil/eg25-manager</param>
<param name="branch">main</param>
- <param name="revision">0.3.1+git5</param>
+ <param name="revision"></param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
|
Added |
_service:tar_git:eg25-manager-0.3.1+git5+main.20210727115014.1.g7d53a27.tar.bz2
^
|
|
Deleted |
_service:tar_git:eg25-manager-0.3.1+git5.tar.bz2
^
|