def _enqueue_state_established(self, pdu):
        if isinstance(pdu, Information):
            if len(pdu.sdu) > self.recv_miu:
                self.log("reject " + str(self))
                pdu = FrameReject.from_pdu(pdu, flags="I", dlc=self)
            elif pdu.ns != self.recv_cnt:
                self.log("reject " + str(self))
                pdu = FrameReject.from_pdu(pdu, flags="S", dlc=self)
            if isinstance(pdu, FrameReject):
                self.send_queue.clear()
                self.send_queue.append(pdu)
                log.debug("enqueued frame reject")
                return

        if isinstance(pdu, FrameReject):
            with self.lock:
                self.state.SHUTDOWN = True
                self.close()
            return

        if isinstance(pdu, Disconnect):
            with self.lock:
                self.state.CLOSE_WAIT = True
                pdu = DisconnectedMode(self.peer, self.addr, reason=0)
                self.send_queue.clear()
                self.send_queue.append(pdu)
            return

        if (isinstance(pdu, Information) or
            isinstance(pdu, ReceiveReady) or
            isinstance(pdu, ReceiveNotReady)):
            with self.lock:
                # acks = N(R) - V(SA) mod 16
                acks = (pdu.nr - self.send_ack) % 16
                if acks:
                    self.acks_recvd += acks
                    self.acks_ready.notify_all()
                    self.send_token.notify()
                    self.send_ack = pdu.nr # V(SA) := N(R)
                if isinstance(pdu, ReceiveNotReady):
                    self.mode.SEND_BUSY = True
                if isinstance(pdu, ReceiveReady):
                    self.mode.SEND_BUSY = False

        if isinstance(pdu, Information):
            with self.lock:
                # V(R) := V(R) + 1 mod 16
                self.recv_cnt = (self.recv_cnt + 1) % 16
            super(DataLinkConnection, self).enqueue(pdu)
dataset/ETHPy150Open javgh/greenaddress-pos-tools/nfc/llcp/tco.py/DataLinkConnection._enqueue_state_established/original