Skip to main content

Module reader

Module reader 

Source
Expand description

This module is responsible for the reader’s interaction with the device.

It handles this through SessionManager state which is responsible for handling the session with the device.

From the reader’s perspective, the flow is as follows:

            +--------+
            |        |
            |  User  |
            |        |
            +---+----+
                |
                |
            +---v-----+
            |         |
            | Device  |
  +---------+         |<----------------+
  |         |         |                 |
  |         |         |                 |
  |         +--+--^---+                 |
  |              |  |                   |
  |              |  | establish_session |
  |qr_engagement |  |                   |
  |              |  |                   | new_request
  |              |  |                   |
+-v--------------v--+-------------------+---+
|                  Reader                   |
|                                           |
| +--------------------+   handle_response  |
| |                    +---------------+    |
| | SessionManager     |               |    |
| |                    |<--------------+    |
| +--------------------+                    |
|                                           |
+-------------------------------------------+

§Example

You can view examples in tests directory in simulated_device_and_reader.rs, for a basic example and simulated_device_and_reader_state.rs which uses State pattern, Arc and Mutex.

Structs§

ReaderAuthentication
ReaderAuthenticationAll
SessionManager
The main state of the reader.

Enums§

Error
Various errors that can occur during the interaction with the device.

Functions§

parse
parse_namespaces