def requestInfo(self, timeout):
    with self.awaitingResponseLock:
        print('Requesting device info...')
        start = time.time()
        self.sendToDevice(CommandCode.INFO.value)
        line = self.readFromDevice()
        while (line != 'Inkkeys'):
            if ((time.time() - start) > timeout):
                return False
            if (line == None):
                time.sleep(0.1)
                line = self.readFromDevice()
                continue
            print('Skipping: ', line)
            line = self.readFromDevice()
        print('Header found. Waiting for infos...')
        line = self.readFromDevice()
        while (line != 'Done'):
            if ((time.time() - start) > timeout):
                return False
            if (line == None):
                time.sleep(0.1)
                line = self.readFromDevice()
                continue
            if line.startswith('TEST '):
                self.testmode = (line[5] != '0')
            elif line.startswith('N_LED '):
                self.nLeds = int(line[6:])
            elif line.startswith('DISP_W '):
                self.dispW = int(line[7:])
            elif line.startswith('DISP_H '):
                self.dispH = int(line[7:])
            elif line.startswith('ROT_CIRCLE_STEPS '):
                self.rotCircleSteps = int(line[17:])
            else:
                print('Skipping: ', line)
            line = self.readFromDevice()
        print('End of info received.')
        print('Testmode: ', self.testmode)
        print('Number of LEDs: ', self.nLeds)
        print('Display width: ', self.dispW)
        print('Display height: ', self.dispH)
        print('Rotation circle steps: ', self.rotCircleSteps)
        return True
def requestInfo(self, timeout):
    with self.awaitingResponseLock:
        print('Requesting device info...')
        start = time.time()
        self.sendToDevice(CommandCode.INFO.value)
        line = self.readFromDevice()
        while (line != 'Inkkeys'):
            if ((time.time() - start) > timeout):
                return False
            if (line == None):
                time.sleep(0.1)
                line = self.readFromDevice()
                continue
            print('Skipping: ', line)
            line = self.readFromDevice()
        print('Header found. Waiting for infos...')
        line = self.readFromDevice()
        while (line != 'Done'):
            if ((time.time() - start) > timeout):
                return False
            if (line == None):
                time.sleep(0.1)
                line = self.readFromDevice()
                continue
            if line.startswith('TEST '):
                self.testmode = (line[5] != '0')
            elif line.startswith('N_LED '):
                self.nLeds = int(line[6:])
            elif line.startswith('DISP_W '):
                self.dispW = int(line[7:])
            elif line.startswith('DISP_H '):
                self.dispH = int(line[7:])
            elif line.startswith('ROT_CIRCLE_STEPS '):
                self.rotCircleSteps = int(line[17:])
            else:
                print('Skipping: ', line)
            line = self.readFromDevice()
        print('End of info received.')
        print('Testmode: ', self.testmode)
        print('Number of LEDs: ', self.nLeds)
        print('Display width: ', self.dispW)
        print('Display height: ', self.dispH)
        print('Rotation circle steps: ', self.rotCircleSteps)
        return True