def waitRapduInject(self, timeout=30):
        startTime = time.time()
        while True:
            with self.lock:
                rapduInject = self.rapduInject
                if rapduInject:
                    self.rapduInject = None
                    self.inject = INJECT_READY
                    return rapduInject
                currentTime = time.time()
                if currentTime - startTime > timeout:
                    self.inject = INJECT_READY
                    raise Exception("Timeout. No rapdu for injected data received within %ds" %timeout)
            time.sleep(0.001)