[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone4-368-g700ab82

Daniel Willmann daniel at totalueberwachung.de
Mon Feb 2 18:51:44 UTC 2009


The following commit has been merged in the master branch:
commit 0e2e6a2326950671e9eb286df0483a2c8143c47a
Author: Daniel Willmann <daniel at totalueberwachung.de>
Date:   Mon Dec 22 01:46:34 2008 +0100

    ogsmd: Fail gracefully if the serial device doesn't exist yet
    
    Thinkpad WWAN cards can be enabled through a /sys file. It takes some
    time from enabling the device to the device nodes actually appearing.
    This makes the VirtualChannel fail gracefully when the device does not
    exist so it will retry. Also increased the channel open retries from 5
    to 7.

diff --git a/framework/subsystems/ogsmd/gsm/channel.py b/framework/subsystems/ogsmd/gsm/channel.py
index e2f28cf..63d76f0 100644
--- a/framework/subsystems/ogsmd/gsm/channel.py
+++ b/framework/subsystems/ogsmd/gsm/channel.py
@@ -88,7 +88,11 @@ class VirtualChannel( object ):
         self.serial.parity = serial.PARITY_NONE
         self.serial.stopbits = serial.STOPBITS_ONE
         self.serial.timeout = None
-        self.serial.open()
+        try:
+            self.serial.open()
+        except serial.serialutil.SerialException:
+          # Fail gracefully if the device isn't there (yet)
+          return False
         if not self.serial.isOpen():
             return False
 
diff --git a/framework/subsystems/ogsmd/modems/abstract/modem.py b/framework/subsystems/ogsmd/modems/abstract/modem.py
index 00b3202..281301f 100644
--- a/framework/subsystems/ogsmd/modems/abstract/modem.py
+++ b/framework/subsystems/ogsmd/modems/abstract/modem.py
@@ -258,7 +258,7 @@ class AbstractModem( object ):
     # internal API
     #
     def _initChannels( self, on_ok, on_error, iteration=1 ):
-        if iteration == 5:
+        if iteration == 7:
             # we did try to open the modem 5 times -- giving up now
             on_error()
         # try to open all channels

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list