Enum pn532::comm_rx_mode

Enum Documentation

enum class pn532::comm_rx_mode

Mode in which channel::raw_receive should operate to handle variable-length frames.

Values:

enumerator stream

Data in the RX stream is progressively consumed by each channel::raw_receive call.

Multiple channel::raw_receive calls of short length are performed within channel::on_receive_prepare and channel::on_receive_complete. These are used to progressively read the parts of the received frame. Each byte is thus read only once, and no reading beyond the frame boundary is performed. This is the typical scenario for e.g. High Speed UART on ESP32.

enumerator buffered

Only one channel::raw_receive call can be performed on a frame. At most a single call to channel::raw_receive can be performed in-between channel::on_receive_prepare and channel::on_receive_complete. In order to determine the full length of a response info frame, it must be requested multiple times. This is obtained by sending an application-level NACK. Since this technique only works for INFO frames (the PN532 would not resend an ACK/NACK/ERROR frame), every channel::raw_receive call will request at least as many bytes as necessary to parse an ACK/NACK/ERROR frame (i.e. frame_id::max_min_info_frame_header_length).