From b7fd5023f0c34fcc4a2d723286d957cf35cc3f48 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Sat, 18 Aug 2018 00:40:45 -0500 Subject: [PATCH] device: Honor autoconnect setting on power up If the device Powered state is toggled, honor the autoconnect setting instead of always going into AUTOCONNECT mode --- src/device.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/device.c b/src/device.c index d2896664..8a0b0a97 100644 --- a/src/device.c +++ b/src/device.c @@ -2591,11 +2591,13 @@ static void device_netdev_notify(struct netdev *netdev, switch (event) { case NETDEV_WATCH_EVENT_UP: - device->autoconnect = true; - device_enter_state(device, DEVICE_STATE_AUTOCONNECT); - l_dbus_property_changed(dbus, device_get_path(device), IWD_DEVICE_INTERFACE, "Powered"); + + if (device->autoconnect) + device_enter_state(device, DEVICE_STATE_AUTOCONNECT); + else + device_enter_state(device, DEVICE_STATE_DISCONNECTED); break; case NETDEV_WATCH_EVENT_DOWN: device_enter_state(device, DEVICE_STATE_OFF);