From bb61a6c87d460a66fc78297df815928137884a38 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sat, 5 Oct 2013 12:13:21 +0200 Subject: [PATCH] Send the first few NOOPs more quickly. Apparently one can get lost, leaving the user looking at a "wait" dialog for 10 seconds. --- src/calibre/devices/smart_device_app/driver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py index 9492a68187..fc10dd323b 100644 --- a/src/calibre/devices/smart_device_app/driver.py +++ b/src/calibre/devices/smart_device_app/driver.py @@ -845,8 +845,9 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): self.is_connected = False if self.is_connected: self.noop_counter += 1 - if only_presence and ( - self.noop_counter % self.SEND_NOOP_EVERY_NTH_PROBE) != 1: + if (only_presence and + self.noop_counter > self.SEND_NOOP_EVERY_NTH_PROBE and + (self.noop_counter % self.SEND_NOOP_EVERY_NTH_PROBE) != 1): try: ans = select.select((self.device_socket,), (), (), 0) if len(ans[0]) == 0: