manager: make sure we don't reset the modem twice in a row

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.
This commit is contained in:
Arnaud Ferraris
2020-12-18 00:45:58 +01:00
parent c39000bf93
commit 74b91c7d58
4 changed files with 34 additions and 8 deletions

View File

@@ -26,6 +26,11 @@ enum EG25State {
struct EG25Manager {
GMainLoop *loop;
guint reset_timer;
int at_fd;
guint at_source;
GList *at_cmds;
enum EG25State modem_state;
gchar *modem_usb_id;
@@ -40,10 +45,6 @@ struct EG25Manager {
guint suspend_source;
int at_fd;
guint at_source;
GList *at_cmds;
struct gpiod_chip *gpiochip[2];
struct gpiod_line *gpio_out[5];
struct gpiod_line *gpio_in[2];