From 9e40ae11d6b7584a2882f6a9177862156cc2e97c Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Sat, 20 Feb 2021 20:12:21 +0100 Subject: [PATCH 1/3] data: add AT command reporting firmware version Fixes #7 --- data/pine64,pinephone-1.0.toml | 1 + data/pine64,pinephone-1.1.toml | 1 + data/pine64,pinephone-1.2.toml | 1 + 3 files changed, 3 insertions(+) diff --git a/data/pine64,pinephone-1.0.toml b/data/pine64,pinephone-1.0.toml index 6509057..c0e9192 100644 --- a/data/pine64,pinephone-1.0.toml +++ b/data/pine64,pinephone-1.0.toml @@ -31,6 +31,7 @@ configure = [ # match, the command is then executed with value `expect` in # order to set the parameter to the configured value (optional) # A command can have `expect` OR `value` configured, but it shouldn't have both + { cmd = "QGMR" }, { cmd = "QDAI", expect = "1,1,0,1,0,0,1,1" }, { cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" }, { cmd = "QCFG", subcmd = "ims", expect = "1" }, diff --git a/data/pine64,pinephone-1.1.toml b/data/pine64,pinephone-1.1.toml index 6509057..c0e9192 100644 --- a/data/pine64,pinephone-1.1.toml +++ b/data/pine64,pinephone-1.1.toml @@ -31,6 +31,7 @@ configure = [ # match, the command is then executed with value `expect` in # order to set the parameter to the configured value (optional) # A command can have `expect` OR `value` configured, but it shouldn't have both + { cmd = "QGMR" }, { cmd = "QDAI", expect = "1,1,0,1,0,0,1,1" }, { cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" }, { cmd = "QCFG", subcmd = "ims", expect = "1" }, diff --git a/data/pine64,pinephone-1.2.toml b/data/pine64,pinephone-1.2.toml index 1d33fc0..566ac80 100644 --- a/data/pine64,pinephone-1.2.toml +++ b/data/pine64,pinephone-1.2.toml @@ -27,6 +27,7 @@ configure = [ # match, the command is then executed with value `expect` in # order to set the parameter to the configured value (optional) # A command can have `expect` OR `value` configured, but it shouldn't have both + { cmd = "QGMR" }, { cmd = "QDAI", expect = "1,1,0,1,0,0,1,1" }, { cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" }, { cmd = "QCFG", subcmd = "ims", expect = "1" }, From 3bf2d785bb4e2dfefbb8b92ad5cb4c9734241884 Mon Sep 17 00:00:00 2001 From: Dylan Van Assche Date: Sun, 21 Feb 2021 16:12:17 +0100 Subject: [PATCH 2/3] at: fix argument order 'expected' and 'value' parts of the AT command were switched. --- src/at.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/at.c b/src/at.c index a9172de..4b5cd62 100644 --- a/src/at.c +++ b/src/at.c @@ -320,7 +320,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); - append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->expected, cmd->value); + append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected); } send_at_command(manager); } @@ -329,7 +329,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); - append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->expected, cmd->value); + append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected); } send_at_command(manager); } @@ -338,7 +338,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); - append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->expected, cmd->value); + append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected); } send_at_command(manager); } @@ -347,7 +347,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); - append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->expected, cmd->value); + append_at_command(manager, cmd->cmd, cmd->subcmd, cmd->value, cmd->expected); } send_at_command(manager); } From 3d076e8bc8de78fe7c140d0ec5afbde95ac3ee10 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Sun, 21 Feb 2021 16:40:36 +0100 Subject: [PATCH 3/3] README: add details about config files --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fd5fb4f..6507770 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,20 @@ $ ninja -C ../eg25-build # ninja -C ../eg25-build install ``` +## Configuration + +`eg25-manager` uses device-specific configuration files, named after the +device-tree `compatible` field. These files are installed to +`/usr/share/eg25-manager`. They can be copied to `/etc/eg25-manager` then +modified, that way they won't be overwritten during an upgrade. + ## Running `eg25-manager` is usually run as a systemd service, but can also be manually started from the command-line (requires root privileges): ``` -# eg25-manager +# eg25manager ``` ## License