def extract_info(self, children):
        # U630 sports just one serial port
        for device in children:
            try:
                self.dport = device['serial.device'].encode('utf8')
            except KeyError:
                pass

        if not self.dport:
            raise DeviceLacksExtractInfo(self)
Пример #2
0
    def extract_info(self, children):
        for device in children:
            try:
                if device['serial.port'] == 0:  #data port
                    self.dport = device['serial.device'].encode('utf8')
            except KeyError:
                pass

        if not self.dport:
            raise DeviceLacksExtractInfo(self)
Пример #3
0
 def extract_info(self, children):
     # HW 220 uses ttyUSB0 and ttyUSB1
     for device in children:
         try:
             if device['serial.port'] == 1: # control port
                 self.cport = device['serial.device'].encode('utf8')
             elif device['serial.port'] == 0: # data port
                 self.dport = device['serial.device'].encode('utf8')
         except KeyError:
             pass
     
     if not self.cport or not self.dport:
         raise DeviceLacksExtractInfo(self)