def receiveMessage(self, timestamp, srcIp, srcPort, message):
        assert srcIp==self.destIp
        assert srcPort==self.destPort
        assert (message['token']==self.token) or (message['messageId']==self.messageId)

        # log
        log.debug('receiveMessage timestamp={0} srcIp={1} srcPort={2} message={3}'.format(timestamp,srcIp,srcPort,message))

        # turn message into exception if needed
        if message['code'] not in d.METHOD_ALL+d.COAP_RC_ALL_SUCCESS:
            message = e.coapRcFactory(message['code'])

        # store packet
        with self.dataLock:
            self.LastRxPacket = (timestamp,srcIp,srcPort,message)

        # signal reception
        self.rxMsgEvent.set()

    #======================= private ==========================================

    #===== fsm
dataset/ETHPy150Open openwsn-berkeley/coap/coap/coapTransmitter.py/coapTransmitter.receiveMessage/original