def enqueue(self, pdu):
        self.log("enqueue {pdu.name} PDU".format(pdu=pdu))
        if not connection_mode_pdu_types in pdu.type:
            self.err("non connection mode pdu on data link connection")
            pdu = FrameReject.from_pdu(pdu, flags="W", dlc=self)
            self.close(); self.send_queue.append(pdu)
            return

        if self.state.CLOSED:
            pdu = DisconnectedMode(pdu.ssap, pdu.dsap, reason=1)
            self.send_queue.append(pdu)

        if self.state.LISTEN:
            if isinstance(pdu, Connect):
                if super(DataLinkConnection, self).enqueue(pdu) == False:
                    log.warn("full backlog on listening socket")
                    pdu = DisconnectedMode(pdu.ssap, pdu.dsap, reason=0x20)
                    self.send_queue.append(pdu)
                    return False
                return True

        if self.state.CONNECT:
            if (isinstance(pdu, ConnectionComplete) or
                isinstance(pdu, DisconnectedMode)):
                with self.lock:
                    self.recv_queue.append(pdu)
                    self.recv_ready.notify()

        if self.state.DISCONNECT:
            if isinstance(pdu, DisconnectedMode):
                with self.lock:
                    self.recv_queue.append(pdu)
                    self.recv_ready.notify()

        if self.state.ESTABLISHED:
            return self._enqueue_state_established(pdu)
dataset/ETHPy150Open javgh/greenaddress-pos-tools/nfc/llcp/tco.py/DataLinkConnection.enqueue/swapped operands of `in`