Separated method to start wifiscand and configure interface for scanning
authorjaviplx <javiplx@gmail.com>
Thu, 3 Jun 2010 15:40:47 +0000 (15:40 +0000)
committerjaviplx <javiplx@gmail.com>
Thu, 3 Jun 2010 15:40:47 +0000 (15:40 +0000)
git-svn-id: file:///svnroot/wifihood/trunk/wifiscanner@7 c51dfc6a-5949-4919-9c8e-f207a149c383

debian/control
wifimap/wifiscan.py

index 8883f93..e117372 100644 (file)
@@ -6,7 +6,7 @@ Standards-Version: 3.6.1
 
 Package: wifihood-scanner
 Architecture: any
-Depends: python-osso, ${shlibs:Depends}, ${misc:Depends}
+Depends: python-osso, wifiscand (>= 1.1), ${shlibs:Depends}, ${misc:Depends}
 Description: WifiHood Scanner
 
 #Package: wifihood-mapper
index 41175ad..574582e 100644 (file)
@@ -12,17 +12,17 @@ class Scanner ( gps.GPSObject ) :
     def __init__ ( self , widget=None , ifname="wlan0" ) :
         gps.GPSObject.__init__( self , widget )
         self.osso_context = osso.Context("wifi_scanner", "2.0", False)
+        osso_rpc = osso.Rpc(self.osso_context)
+        scan_out = osso_rpc.rpc_run("org.javiplx.wifiscan", "/org/javiplx/wifiscan", "org.javiplx.wifiscan", "wakeup", wait_reply = True)
         self._timer = None
 
     def start ( self ) :
         osso_rpc = osso.Rpc(self.osso_context)
         scan_out = osso_rpc.rpc_run("org.javiplx.wifiscan", "/org/javiplx/wifiscan", "org.javiplx.wifiscan", "start")
-        osso.SystemNote(self.osso_context).system_note_infoprint("WifiScand started")
 
     def stop ( self ) :
         osso_rpc = osso.Rpc(self.osso_context)
         scan_out = osso_rpc.rpc_run("org.javiplx.wifiscan", "/org/javiplx/wifiscan", "org.javiplx.wifiscan", "stop")
-        osso.SystemNote(self.osso_context).system_note_infoprint("WifiScand stopped")
 
     def scan ( self ) :
         osso_rpc = osso.Rpc(self.osso_context)
@@ -31,7 +31,6 @@ class Scanner ( gps.GPSObject ) :
         except Exception , ex :
             osso.SystemNote(self.osso_context).system_note_infoprint("Exception scanning %s" % ex )
             return True
-        #osso.SystemNote(self.osso_context).system_note_infoprint("Found %d APs" % len(scan_out.split()) )
         out_str = ""
         for net in scan_out.split() :
             items = net.rsplit(":", 1)
@@ -49,7 +48,6 @@ class Scanner ( gps.GPSObject ) :
                 loclist.write ( "%s\n" % ( self.satellites ,) )
                 loclist.close()
             if self.cell_info :
-            #    osso.SystemNote(self.osso_context).system_note_infoprint("Found Cell : %s" % ( self.cell_info ,) )
                 celllist = open( "/home/user/MyDocs/cell.info" , 'a' )
                 celllist.write ( "%s\n" % ( self.cell_info ,) )
                 celllist.close()