[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. upstream/0.9.5.5-717-g0f98819

Michael 'Mickey' Lauer mickey at vanille-media.de
Sat Aug 6 08:20:00 UTC 2011


The following commit has been merged in the debian branch:
commit 55f80974a723610de6d8af58e9604dfde348551f
Author: Antonio Ospite <ospite at studenti.unina.it>
Date:   Fri May 21 14:13:59 2010 +0200

    ogsmd: freescale_neptune, make network registration more reliable
    
    On gen1 +CFUN={1,0} is very slow to sync up with the network and this can
    confuse ogsmd, by sleeping in DeviceSetAntennaPower and before NetworkRegister we
    give the modem the time to emit the responses to +CFUN and +COPS in a clearer
    order. We do the symmetric in NetworkUnregister.
    
    Signed-off-by: Antonio Ospite <ospite at studenti.unina.it>

diff --git a/framework/subsystems/ogsmd/modems/freescale_neptune/mediator.py b/framework/subsystems/ogsmd/modems/freescale_neptune/mediator.py
index 101d8b1..ad9b5f6 100644
--- a/framework/subsystems/ogsmd/modems/freescale_neptune/mediator.py
+++ b/framework/subsystems/ogsmd/modems/freescale_neptune/mediator.py
@@ -86,24 +86,22 @@ class SimGetAuthStatus( SimMediator ):
 class DeviceSetAntennaPower( AbstractMediator.DeviceSetAntennaPower ):
 #=========================================================================#
     """
-    We want to receive all initial status commands, so we always send +CFUN=0 first.
-
     In contrast to AbstractMediator.DeviceSetAntennaPower, PIN handling
     has been removed here, since after powercycling we will get an URC
     indicating the PIN status.
     """
 
     def trigger( self ):
-        self._commchannel.enqueue( "+CFUN=0", self.responseFromChannel1, self.errorFromChannel )
+        if not self.power:
+            time.sleep(2.0)
 
-    def responseFromChannel1( self, request, response ):
-        # FIXME: make async
-        time.sleep( 2.0 )
         cmd = "+CFUN=%d" % ( 1 if self.power else 0 )
         self._commchannel.enqueue( cmd, self.responseFromChannel, self.errorFromChannel )
 
     def responseFromChannel( self, request, response ):
         if response[-1] == "OK":
+            if self.power:
+                time.sleep( 2.0 )
             self._ok()
         else:
             DeviceMediator.responseFromChannel( self, request, response )
@@ -141,6 +139,27 @@ class SimListPhonebooks( SimMediator ):
         self._ok( "contacts own fixed".split() )
 
 #=========================================================================#
+class NetworkRegister( NetworkMediator ):
+#=========================================================================#
+    def trigger( self ):
+        time.sleep( 4.0 )
+        self._commchannel.enqueue( "+COPS=0,0", self.responseFromChannel, self.errorFromChannel )
+
+#=========================================================================#
+class NetworkUnregister( NetworkMediator ):
+#=========================================================================#
+    def trigger( self ):
+        self._commchannel.enqueue( "+COPS=2,0", self.responseFromChannel, self.errorFromChannel )
+
+    @logged
+    def responseFromChannel( self, request, response ):
+        if response[-1] == "OK":
+            time.sleep( 4.0 )
+            self._ok()
+        else:
+            NetworkMediator.responseFromChannel( self, request, response )
+
+#=========================================================================#
 class NetworkGetStatus( NetworkMediator ):
 #=========================================================================#
     """

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list