# NFCommander reader API This API concerns the communication with the active NFC components used for tag reading / writing. Implementing this API allows the project to support new NFC hardware ## Specification Additional readers can be connected by implementing their specifics in a shared library named `reader_.so`. In the NFCommander configuration, specifying the `nfc.reader` configuration option sets the reader name that is to be loaded. ## Interface The shared library should export the following symbols and respective prototypes * `int init()` : Initialize the reader-specific data structures and communication details * (optional) `int handle(int fd)` : Callback invoked when a registered descriptor is pending events * `int scan()` : Invoked to request the current set of tags detectable in the field ## Operation This section will describe the lifecycle of a reader implementation plugin. ### Initialization After the shared library is loaded, the `init` export is called. The module should connect to its specific hardware interface and verify that the field is in operating condition. The module may use the `config_get` NFCommander API to read specific configuration options, such as ports to connect to. If necessary, file descriptors and sockets can be registered with the core using the `core_manage_fd` API. Pending events will be signaled using the libraries `handle` export. ### Operation TBD ### Cleanup TBD