clf.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:bitpay-brick 作者: javgh 项目源码 文件源码
def exchange(self, send_data, timeout):
        """Exchange data with an activated target (data is a command
        frame) or as an activated target (data is a response
        frame). Returns a target response frame (if data is send to an
        activated target) or a next command frame (if data is send
        from an activated target). Returns None if the communication
        link broke during exchange (if data is sent as a target). The
        timeout is the number of seconds to wait for data to return,
        if the timeout expires an nfc.clf.TimeoutException is
        raised. Other nfc.clf.DigitalProtocolExceptions may be raised
        if an error is detected during communication.

        .. note:: This is a direct interface to the
           driver and not needed if :meth:`connect` is used.
        """
        if self.dev is None:
            raise IOError(errno.ENODEV, os.strerror(errno.ENODEV))

        with self.lock:
            return self.dev.exchange(send_data, timeout)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号