mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
src: add udev watcher to improve modem recovery
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 commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "manager.h"
|
||||
#include "mm-iface.h"
|
||||
#include "suspend.h"
|
||||
#include "udev.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
@@ -30,6 +31,7 @@ static gboolean quit_app(struct EG25Manager *manager)
|
||||
at_destroy(manager);
|
||||
mm_iface_destroy(manager);
|
||||
suspend_destroy(manager);
|
||||
udev_destroy(manager);
|
||||
|
||||
if (manager->modem_state >= EG25_STATE_STARTED) {
|
||||
g_message("Powering down the modem...");
|
||||
@@ -202,6 +204,7 @@ int main(int argc, char *argv[])
|
||||
gpio_init(&manager);
|
||||
mm_iface_init(&manager);
|
||||
suspend_init(&manager);
|
||||
udev_init(&manager);
|
||||
|
||||
g_idle_add(G_SOURCE_FUNC(modem_start), &manager);
|
||||
|
||||
|
Reference in New Issue
Block a user