def connect(self, dev):
    print('Connecting to ', dev, '.')
    self.ser = serial.Serial(dev, 115200, timeout=1)
    if (not self.requestInfo(3)):
        self.disconnect()
        return False
    if self.testmode:
        print('Connection to ', self.ser.name, ' was successfull, but the device is running the hardware test firmware, which cannot be used for anything but testing. Please flash the proper inkkeys firmware to use it.')
        return False
    print('Connected to ', self.ser.name, '.')
    return True
def connect(self, dev):
    print('Connecting to ', dev, '.')
    self.ser = serial.Serial(dev, 115200, timeout=1)
    if (not self.requestInfo(3)):
        self.disconnect()
        return False
    if self.testmode:
        print('Connection to ', self.ser.name, ' was successfull, but the device is running the hardware test firmware, which cannot be used for anything but testing. Please flash the proper inkkeys firmware to use it.')
        return False
    print('Connected to ', self.ser.name, '.')
    return True