def get_devices_cb(devices):
     self.device = attach_serial_protocol(devices[0], test=False)
     self.sconn = self.device.sconn
     self.sport = self.device.sport
     d2 = self.device.preinit()
     d2.addCallback(self._authenticate)
     return d2
Ejemplo n.º 2
0
 def get_devices_cb(devices):
     self.device = attach_serial_protocol(devices[0], test=False)
     self.sconn = self.device.sconn
     self.sport = self.device.sport
     d2 = self.device.preinit()
     d2.addCallback(self._authenticate)
     return d2
    def setup_device(self, device):
        if device.sconn:
            log.msg("%s: device.sconn already setup" % self)
            # device might be already configured by configuration dialog
            return device

        return attach_serial_protocol(device)
Ejemplo n.º 4
0
 def get_profiles_from_imsi_prefix(self):
     from vmc.common.persistent import net_manager
     from vmc.common.startup import attach_serial_protocol
     # we just need the IMSI, but the device is not setup yet. We'll setup
     # its sconn temporarily
     device = self.get_device()
     if not device.sconn:
         device = attach_serial_protocol(device)
     
     def get_imsi_eb(failure):
         failure.trap(ex.ATError,
                      ex.CMEErrorSIMPINRequired, ex.CMEErrorSIMFailure)
         # this card doesn't likes to be asked for its IMSI if its not
         # authenticated, we will just return None, as we don't have any
         # way to get the IMSI
         return failure
     
     d = device.sconn.get_imsi()
     d.addCallback(lambda imsi: net_manager.get_all_networks_by_id(imsi))
     d.addErrback(get_imsi_eb)
     
     return d
 def get_devices_cb(devices):
     self.device = attach_serial_protocol(devices[0], test=False)
     self.sconn = self.device.sconn
     self.sport = self.device.sport
     return self._authenticate()
 def get_devices_cb(devices):
     self.device = attach_serial_protocol(devices[0], test=False)
     self.sconn = self.device.sconn
     self.sport = self.device.sport
 def get_devices_cb(devices):
     self.device = attach_serial_protocol(devices[0], test=False)
     self.sconn = self.device.sconn
     self.sport = self.device.sport
     return self.device.preinit()
 def get_devices_cb(devices):
     self.device = attach_serial_protocol(devices[0], test=False)
     self.sconn = self.device.sconn
     self.sport = self.device.sport
     return self._authenticate()
 def setup_device(self, device):
     if device.sconn:
         # device might be already configured by configuration dialog
         return device
     
     return attach_serial_protocol(device)