#usb #bill-acceptor #bill-validator

bnr

Pure Rust implementation of the BNR XFS USB communication protocol

3 releases

0.1.2 Mar 13, 2024
0.1.1 Feb 15, 2024
0.1.0 Jan 24, 2024

#152 in Finance

Download history 6/week @ 2024-01-22 110/week @ 2024-02-12 34/week @ 2024-02-19 9/week @ 2024-02-26 26/week @ 2024-03-04 111/week @ 2024-03-11 6/week @ 2024-03-18 29/week @ 2024-04-01

148 downloads per month

MIT license

565KB
12K SLoC

BNR API

This library presents a high-level, safe, idiomatic Rust API for interacting with MEI/CPI BNR devices.

Library organization

The structure of the project's file tree roughly follows the organization of the MEI/CPI modules.

Related types are grouped together in modules. Larger modules are further split into their own set of modules, and glob-imported by the parent module.

Future goals

The ultimate goal is to cover a large portion of the API surface, and then begin to implement all functionality in Rust.

Enough functionality is implemented to perform device initialization, configuration, deposit, dispense, and reset.

There is still a reasonable amount left to implement.


lib.rs:

Device communication library for MEI/CPI BNR devices.

This library is for communicating with BNR cash devices using the BNR/XFS communication protocol over a USB connection.

Users can either use the stand-alone functions exposed by the module APIs, or create a local instance of a [DeviceHandle].

Creating a local instance of a [DeviceHandle] allows the user to interact using the method calls directly.

The module APIs more closely mirror the C library provided by MEI/CPI, and utilize a global instance of a [DeviceHandle]. These APIs are more useful for backwards compatibility with applications already using the MEI/CPI libraries.

Dependencies

~6–18MB
~230K SLoC