diff --git a/src/manager.c b/src/manager.c index 38e71a6..7420c5f 100644 --- a/src/manager.c +++ b/src/manager.c @@ -226,24 +226,26 @@ gboolean modem_reset(struct EG25Manager *manager) g_warning("Unable to open /sys/bus/usb/drivers/usb/unbind"); goto error; } + ret = write(fd, manager->modem_usb_id, len); + close(fd); if (ret < len) { g_warning("Couldn't unbind modem: wrote %d/%d bytes", ret, len); goto error; } - close(fd); fd = open("/sys/bus/usb/drivers/usb/bind", O_WRONLY); if (fd < 0) { - g_warning("Unable to open /sys/bus/usb/drivers/usb/unbind"); + g_warning("Unable to open /sys/bus/usb/drivers/usb/bind"); goto error; } + ret = write(fd, manager->modem_usb_id, len); + close(fd); if (ret < len) { g_warning("Couldn't bind modem: wrote %d/%d bytes", ret, len); goto error; } - close(fd); g_message("Successfully reset modem's USB connection");