def updateDisplay(self, fullRefresh=False, timeout=5):
    with self.awaitingResponseLock:
        start = time.time()
        self.sendToDevice(((CommandCode.REFRESH.value + ' ') + (RefreshTypeCode.FULL.value if fullRefresh else RefreshTypeCode.PARTIAL.value)))
        line = self.readFromDevice()
        while (line != 'ok'):
            if ((time.time() - start) > timeout):
                return False
            if (line == None):
                time.sleep(0.1)
                line = self.readFromDevice()
                continue
            line = self.readFromDevice()
        self.resendImageData()
        self.sendToDevice(((CommandCode.REFRESH.value + ' ') + RefreshTypeCode.OFF.value))
        line = self.readFromDevice()
        while (line != 'ok'):
            if ((time.time() - start) > timeout):
                return False
            if (line == None):
                time.sleep(0.1)
                line = self.readFromDevice()
                continue
            line = self.readFromDevice()
def updateDisplay(self, fullRefresh=False, timeout=5):
    with self.awaitingResponseLock:
        start = time.time()
        self.sendToDevice(((CommandCode.REFRESH.value + ' ') + (RefreshTypeCode.FULL.value if fullRefresh else RefreshTypeCode.PARTIAL.value)))
        line = self.readFromDevice()
        while (line != 'ok'):
            if ((time.time() - start) > timeout):
                return False
            if (line == None):
                time.sleep(0.1)
                line = self.readFromDevice()
                continue
            line = self.readFromDevice()
        self.resendImageData()
        self.sendToDevice(((CommandCode.REFRESH.value + ' ') + RefreshTypeCode.OFF.value))
        line = self.readFromDevice()
        while (line != 'ok'):
            if ((time.time() - start) > timeout):
                return False
            if (line == None):
                time.sleep(0.1)
                line = self.readFromDevice()
                continue
            line = self.readFromDevice()