Send AT commands only to the appropriate channels.
Also reorganize the order of the channel classes in the code to reflect the
respective dlci line order.

Signed-off-by: Antonio Ospite <osp...@studenti.unina.it>
---
 .../ogsmd/modems/freescale_neptune/channel.py      |   57 ++++++++++++++------
 1 files changed, 40 insertions(+), 17 deletions(-)

diff --git a/framework/subsystems/ogsmd/modems/freescale_neptune/channel.py 
b/framework/subsystems/ogsmd/modems/freescale_neptune/channel.py
index 94b8574..b7b7b60 100644
--- a/framework/subsystems/ogsmd/modems/freescale_neptune/channel.py
+++ b/framework/subsystems/ogsmd/modems/freescale_neptune/channel.py
@@ -25,11 +25,20 @@ class EzxMuxChannel( AbstractModemChannel ):
     def __init__( self, *args, **kwargs ):
         AbstractModemChannel.__init__( self, *args, **kwargs )
 
+
+#=========================================================================#
+class CallAndNetworkChannel( EzxMuxChannel ):
+#=========================================================================#
+    def __init__( self, *args, **kwargs ):
+        EzxMuxChannel.__init__( self, *args, **kwargs )
+
+        # FIXME we can't do this, since it is modem-wide (not VC-wide)
+        #self.enqueue( "+CMER=0,0,0,0,0" ) # unsolicited event reporting: none
+
     def _populateCommands( self ):
         AbstractModemChannel._populateCommands( self ) # default command init
 
-        c = self._commands["init"]
-        c.append( '+USBSTAT=255,1' )           # charge
+        c = self._commands["init"] = []
 
         c.append( '+EPOM=1,0' ) # Ezx Power On Modem
         c.append( '+EAPF=12,1,0' ) # ??
@@ -48,23 +57,19 @@ class EzxMuxChannel( AbstractModemChannel ):
         c.append( "+CGEREP=2,1" )
         c.append( "+CGREG=2" )
 
-#=========================================================================#
-class CallAndNetworkChannel( EzxMuxChannel ):
-#=========================================================================#
-    def __init__( self, *args, **kwargs ):
-        EzxMuxChannel.__init__( self, *args, **kwargs )
+        self._commands["sim"] = []
 
-        # FIXME we can't do this, since it is modem-wide (not VC-wide)
-        #self.enqueue( "+CMER=0,0,0,0,0" ) # unsolicited event reporting: none
 
 #=========================================================================#
-class MiscChannel( EzxMuxChannel ):
+class SmsChannel( EzxMuxChannel ):
 #=========================================================================#
     def __init__( self, *args, **kwargs ):
         EzxMuxChannel.__init__( self, *args, **kwargs )
 
-        # FIXME we can't do this, since it is modem-wide (not VC-wide)
-        #self.enqueue( "+CMER=0,0,0,0,0" ) # unsolicited event reporting: none
+    def _populateCommands( self ):
+        AbstractModemChannel._populateCommands( self ) # default command init
+
+        self._commands["init"] = []
 
         # This modem needs a special SIM init sequence otherwise GSM 07.07 SMS 
commands won't succeed
         c = self._commands["sim"] = []
@@ -73,18 +78,36 @@ class MiscChannel( EzxMuxChannel ):
         c.append( "+EPMS?" )
         c.append( "+EMGL=4" )
 
-    def modemStateSimUnlocked( self, *args, **kwargs ):
-        # we _should_ be ready now, alas we can't check for sure :(
-        self._modem._object.ReadyStatus( True )
 
 #=========================================================================#
-class SmsChannel( EzxMuxChannel ):
+class SimChannel( EzxMuxChannel ):
 #=========================================================================#
     def __init__( self, *args, **kwargs ):
         EzxMuxChannel.__init__( self, *args, **kwargs )
 
+    def _populateCommands( self ):
+        AbstractModemChannel._populateCommands( self ) # default command init
+
+        self._commands["init"] = []
+
+
 #=========================================================================#
-class SimChannel( EzxMuxChannel ):
+class MiscChannel( EzxMuxChannel ):
 #=========================================================================#
     def __init__( self, *args, **kwargs ):
         EzxMuxChannel.__init__( self, *args, **kwargs )
+
+        # FIXME we can't do this, since it is modem-wide (not VC-wide)
+        #self.enqueue( "+CMER=0,0,0,0,0" ) # unsolicited event reporting: none
+
+    def modemStateSimUnlocked( self, *args, **kwargs ):
+        # we _should_ be ready now, alas we can't check for sure :(
+        self._modem._object.ReadyStatus( True )
+
+    def _populateCommands( self ):
+        AbstractModemChannel._populateCommands( self ) # default command init
+
+        c = self._commands["init"] = []
+        c.append( '+USBSTAT=255,1' )           # charge
+
+        self._commands["sim"] = []
-- 
1.7.1


Reply via email to