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)
评论列表
文章目录