Struct pn532::p2p::target
Defined in File p2p.hpp
Inheritance Relationships
Derived Type
public pn532::p2p::pn532_target
(Class pn532::p2p::pn532_target)
Struct Documentation
-
struct target
Generic interface of a P2P NFC module acting as a target in P2P communication. This responds to commands by sending answers.
Subclassed by pn532::p2p::pn532_target
Public Functions
-
virtual result<mlab::bin_data> receive(ms timeout) = 0
Receives, synchronously, the data sent by the initiator. A call to send must follow right after having processed the data.
- Parameters:
timeout – Maximum time after which channel_error::timeout is returned.
- Returns:
The data sent by the initiator, or any of the channel_error error conditions.
-
virtual result send(mlab::bin_data const &data, ms timeout) = 0
Sends back an answer to the initiator. This must always be called after receive has returned.
- Parameters:
data – Data to send back to the initiator.
timeout – Maximum time after which channel_error::timeout is returned.
- Returns:
Either
mlab::result_success
or any of the channel_error error conditions.
-
virtual ~target() = default
-
virtual result<mlab::bin_data> receive(ms timeout) = 0