The timeout was meant to give more time to find the modem, yet the
callback didn't actually check if it came back but blindly issued a
reset.
Add a check to the callback to see if the modem was found and only
reset if not.
Fixes https://gitlab.com/mobian1/devices/eg25-manager/-/issues/28
If a user created a custom config file and we added new fields in a
newer version, `eg25-manager` will crash by assuming all config files
are complete and up-to-date.
Moreover, creating a custom config, even to change only one option,
required copying a complete default config file and then editing the
relevant field(s). This could lead to issues when upgrading, as default
values of fields unrelated to the user change could be modified and not
applied to the user config.
This patch addresses both these issues by:
* making sure at least one config file exists
* requiring only the "default" config file (the one under `/usr/share`)
to include all the required fields
* trying to use user config for each field, falling back to the default
config file if the field isn't present in the user config
* exiting with a meaningful error message in case the default config
file is missing a required field or section
That way, it will be possible to have a minimal user config file
containing only the field(s) needing a different value than the default
one, falling back to the values in the default config file.
Fixes#23
This commit prepares the use of device-specific configuration files.
These files should be named after the device-tree `compatible` string
with the `toml` extension.
`eg25-manager` will search for config files in
`<prefix>/etc/eg25-manager` first (or `/etc/eg25-manager` if prefix is
`/usr`), then in `<prefix>/share/eg25-manager`.
The EG25 modem needs at least 2 minutes after indicating 'RDY'
to be fully operational. If the modem is suspended before that,
calls or texts may not be seen by the userspace.
This mostly occurs when a full reboot or poweroff/poweron
sequence of the phone is performed.
:
Most of the modem issues follow a (incomplete) USB device reset. Instead
of relying solely on the existing timer, this patch adds a udev monitor
which resets the modem as soon as its associated USB device is reset,
which greatly improves recovery time.
This patch adds a 3s delay when resetting the modem during which we
avoid triggering a new reset. This makes sure we don't trigger a reset
twice in a row.
It also disables any related running timer to avoid being re-triggered
unnecessarily.