def _action_WAITFORACK(self):

        # log
        log.debug('_action_WAITFORACK()')

        startTime   = time.time()
        ackMaxWait  = self.ackTimeout*random.uniform(1, d.DFLT_ACK_RANDOM_FACTOR)
        while True:
            waitTimeLeft = startTime+ackMaxWait-time.time()
            if self.rxMsgEvent.wait(timeout=waitTimeLeft):
                # I got message
                with self.dataLock:
                    (timestamp,srcIp,srcPort,message) = self.LastRxPacket
                if isinstance(message,e.coapRc):
                    with self.dataLock:
                        self.coapError = message
                    return
                elif (
                        message['type']==d.TYPE_ACK and
                        message['messageId']==self.messageId
                    ):

                    # store ACK
                    with self.dataLock:
                        self.receivedACK = (timestamp,srcIp,srcPort,message)

                    # update FSM state
                    self._setState(self.STATE_ACKRX)

                    # kick FSM
                    self._kickFsm()
                    return
            else:
                # re-send

                # update FSM state
                self._setState(self.STATE_TXCON)

                # kick FSM
                self._kickFsm()
                return
dataset/ETHPy150Open openwsn-berkeley/coap/coap/coapTransmitter.py/coapTransmitter._action_WAITFORACK/original