[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:45 UTC 2009


The following commit has been merged in the master branch:
commit 7a57b235cf9dcd93bf4950fc3ed3c32859cf7c4a
Author: Daniel Willmann <daniel at totalueberwachung.de>
Date:   Tue Dec 23 12:57:32 2008 +0100

    ogsmd: Add support for AcT and remove duplicate plusCREG
    
    Modems that support more than just GPRS will have an additional number
    identifying the network access type in +COPS, +CREG and +CGREG.

diff --git a/framework/subsystems/ogsmd/device.py b/framework/subsystems/ogsmd/device.py
index e53ffb5..f7cdc93 100644
--- a/framework/subsystems/ogsmd/device.py
+++ b/framework/subsystems/ogsmd/device.py
@@ -402,7 +402,7 @@ class Device( resource.Resource ):
     def SignalStrength( self, strength ):
         logger.info( "org.freesmartphone.GSM.Network.SignalStrength: %s", strength )
 
-    @dbus.service.method( DBUS_INTERFACE_NETWORK, "", "a(isss)",
+    @dbus.service.method( DBUS_INTERFACE_NETWORK, "", "a(issss)",
                           async_callbacks=( "dbus_ok", "dbus_error" ) )
     @resource.checkedmethod
     def ListProviders( self, dbus_ok, dbus_error ):
diff --git a/framework/subsystems/ogsmd/gsm/const.py b/framework/subsystems/ogsmd/gsm/const.py
index 3141c65..93f6c85 100644
--- a/framework/subsystems/ogsmd/gsm/const.py
+++ b/framework/subsystems/ogsmd/gsm/const.py
@@ -25,7 +25,8 @@ logger = logging.getLogger( "ogsmd" )
 # format patterns
 #=========================================================================#
 # +COPS: (2,"MEDION Mobile","","26203"),(3,"T-Mobile D","TMO D","26201"),(3,"Vodafone.de","Vodafone","26202"),(3,"o2 - de","o2 - de","26207")
-PAT_OPERATOR_LIST = re.compile( '\((?P<status>[123]),"(?P<name>[^"]+?)","(?P<shortname>[^"]*?)","(?P<code>\d*?)"\)' )
+# +COPS: (2,"E-PLUS","E-PLUS","26203",2),(2,"E-PLUS","E-PLUS","26203",0),(3,"T-Mobile D","T-Mobile D","26201",0),(3,"Vodafone.de","Vodafone.de","26202",0),(3,"Vodafone.de","Vodafone.de","26202",2),(3,"o2 - de","o2 - de","26207",2),(3,"o2 - de","o2 - de","26207",0),(3,"T-Mobile D","T-Mobile D","26201",2)
+PAT_OPERATOR_LIST = re.compile( '\((?P<status>[123]),"(?P<name>[^"]+?)","(?P<shortname>[^"]*?)","(?P<code>\d*?)"(?:,(?P<act>\d))?\)')
 
 # +CPBR: (1-250),44,17
 # +CBPR: (1-50)
@@ -667,6 +668,17 @@ REGISTER_MODE = { \
 }
 
 #=========================================================================#
+REGISTER_ACT = { \
+    0: "GSM",
+    1: "Compact GSM",
+    2: "UMTS",
+    3: "EDGE",
+    4: "HSDPA",
+    5: "HSUPA",
+    6: "HSDPA/HSUPA",
+}
+
+#=========================================================================#
 PHONEBOOK_CATEGORY = BiDict ( { \
     "contacts": "SM",
     "dialed": "DC",
diff --git a/framework/subsystems/ogsmd/modems/abstract/mediator.py b/framework/subsystems/ogsmd/modems/abstract/mediator.py
index 1c22f39..1c1437b 100644
--- a/framework/subsystems/ogsmd/modems/abstract/mediator.py
+++ b/framework/subsystems/ogsmd/modems/abstract/mediator.py
@@ -1047,6 +1047,8 @@ class NetworkGetStatus( NetworkMediator ):
                 else:
                     result["mode"] = const.REGISTER_MODE[int(values[0])]
                     result["provider"] = values[2].strip( '"' )
+                    if len( values ) == 4:
+                        result["act"] = const.REGISTER_ACT[int( values[3] )]
                     values = safesplit( self._rightHandSide( response[-2] ), ',' )
                     if len( values ) > 2:
                         result["code"] = int( values[2].strip( '"' ) )
@@ -1091,7 +1093,11 @@ class NetworkListProviders( NetworkMediator ): # a{sv}
                 status = const.PROVIDER_STATUS[int(operator.groupdict()["status"])]
                 name = operator.groupdict()["name"]
                 shortname = operator.groupdict()["shortname"]
-                result.append( ( index, status, name, shortname ) )
+                act = operator.groupdict()["act"]
+                if act == "":
+                    act = "0" # Default to plain GPRS
+                act = const.REGISTER_ACT[int(act)]
+                result.append( ( index, status, name, shortname, act ) )
             self._ok( result )
         else:
             NetworkMediator.responseFromChannel( self, request, response )
@@ -1424,9 +1430,11 @@ class PdpGetNetworkStatus( PdpMediator ):
             else:
                 result[ "registration"] = const.REGISTER_STATUS[int(safesplit( self._rightHandSide( response[-2] ), ',' )[1])]
                 values = safesplit( self._rightHandSide( response[-2] ), ',' )
-                if len( values ) == 4: # have lac and cid now
+                if len( values ) >= 4: # have lac and cid now
                     result["lac"] = values[2].strip( '"' )
                     result["cid"] = values[3].strip( '"' )
+                if len( values ) == 5:
+                    result["act"] = const.REGISTER_ACT[ int(values[4]) ]
         self._ok( result )
 
 #=========================================================================#
diff --git a/framework/subsystems/ogsmd/modems/abstract/unsolicited.py b/framework/subsystems/ogsmd/modems/abstract/unsolicited.py
index 0d3e8a1..455d61f 100644
--- a/framework/subsystems/ogsmd/modems/abstract/unsolicited.py
+++ b/framework/subsystems/ogsmd/modems/abstract/unsolicited.py
@@ -92,21 +92,26 @@ class AbstractUnsolicitedResponseDelegate( object ):
         values = safesplit( righthandside, ',' )
         status = {}
         status["registration"] = const.REGISTER_STATUS[int(values[0])]
-        if len( values ) == 3:
+        if len( values ) >= 3:
             status["lac"] = values[1].strip( '"' )
             status["cid"] = values[2].strip( '"' )
+        if len( values ) == 4:
+            status["act"] = const.REGISTER_ACT[int(values[3])]
         self._object.NetworkStatus( status )
 
     # +CREG: 1,"000F","032F"
+    # +CREG: 1,"000F","032F",2
     def plusCREG( self, righthandside ):
         """
         Network Registration Status Update
         """
         values = safesplit( righthandside, ',' )
         self.register = const.REGISTER_STATUS[int(values[0])]
-        if len( values ) == 3:
+        if len( values ) >= 3:
             self.lac = values[1].strip( '"' )
             self.cid = values[2].strip( '"' )
+        if len( values ) == 4:
+            self.act = const.REGISTER_ACT[int(values[3])]
 
         self._mediator.NetworkGetStatus( self._object, self.statusOK, self.statusERR )
 
@@ -144,19 +149,6 @@ class AbstractUnsolicitedResponseDelegate( object ):
         else:
             self._object.IncomingStoredMessage( int(index) )
 
-    # +CREG: 1,"000F","032F"
-    def plusCREG( self, righthandside ):
-        """
-        Network Registration
-        """
-        values = safesplit( righthandside, ',' )
-        self.register = const.REGISTER_STATUS[int(values[0])]
-        if len( values ) == 3:
-            self.lac = values[1].strip( '"' )
-            self.cid = values[2].strip( '"' )
-
-        self._mediator.NetworkGetStatus( self._object, self.statusOK, self.statusERR )
-
     # +CRING: VOICE
     def plusCRING( self, calltype ):
         """

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list