Expand description
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.
Re-exports§
Modules§
- arrays
- Work-around for const-generic arrays in serde from MikailBag:
- cash
- Functions for cash-related operations.
- denominations
- Functions for denomination operations.
- device_
handle - history
- Functions related to device history.
- init
- maintenance
- Types and functionality for performing maintenance on BNR devices.
- status
- Types and functions for handling system status events.
- sys_
config - System configuration types and functionality.
- xfs
- XFS message types for BNR communication.
Macros§
- create_
xfs_ array - create_
xfs_ bool - Creates a new XFS boolean type.
- create_
xfs_ date_ time - create_
xfs_ i4 - Creates a new XFS
i4type. - create_
xfs_ string - create_
xfs_ struct - Creates an XFS
structtype. - impl_
default - Implements the
Defaulttrait for types that have anewfunction. - impl_
xfs_ array - Common functionality for XFS
structtypes. - impl_
xfs_ bool - Common functionality for XFS
booleantypes. - impl_
xfs_ date_ time - Common functionality for XFS
dateTimetypes. - impl_
xfs_ enum - Implements traits common to XFS enum types.
- impl_
xfs_ i4 - Common functionality for XFS
i4types. - impl_
xfs_ int - Common functionality for XFS
inttypes. - impl_
xfs_ string - Common functionality for XFS
stringtypes. - impl_
xfs_ struct - Common functionality for XFS
structtypes. - inner_
enum - Provides convenience functions to destructure an enum with new-type variants.
Structs§
- Allow
UsbFront Switch - Allows to use USB Front interface to communicate with the BNR. Default value is TRUE.
- Amount
- Represents a denomination amount.
- Amount
NotAvailable Count - Represents the amount not available count.
- Auto
Present - This specifies whether cash will be automatically presented to the user on execution of a dispense (autoPresent set to TRUE), or whether the cash will only be transported to the Bundler.
- Auto
Retract AtInlet - Specifies whether bill will be automatically retracted to positioner when jam occurred during bill presenting at inlet or outlet. Default value is FALSE.
- BadRough
Shape Count - Represents the bad rough shape count.
- BadShape
Count - Represents the bad shape count.
- BadShape
Reject Count - Represents the bad shape reject count.
- Bill
Acceptance History - Represents the bill acceptance history.
- Bill
Dispense History - Represents the bill dispense history of the BNR device.
- Bill
Ending InMM Section Counters - Represents a list of bill ending in main module section count items.
- Bill
Error Count - Represents the bill error count.
- Bill
Extracted Count - Represents the bill extracted count.
- Bill
Intake Cover Count - Represents the bill intake cover count.
- Bill
JamCount - Represents the bill jam count.
- Bill
NotAvailable Count - Represents the bill not available count.
- Bill
Requested Count - Represents the bill requested count.
- Bill
Rolled Back Count - Represents the bill rolled back count.
- Bill
TooLong InBottom Transport BwCount - Represents the bill too long in bottom transport bw count.
- Bill
TooLong InSpine FwCount - Represents the bill too long in spine fw count.
- Bill
TooShort InBottom Transport BwCount - Represents the bill too short in bottom transport bw count.
- Bill
TooShort InSpine FwCount - Represents the bill too short in spine fw count.
- Bills
Taken Sensor - The device has a bills taken sensor. Always TRUE in the BNR.
- Billset
Id - Billset
IdList - Represents a list of BillsetInfo.
- Billset
Info - Represents billset information.
- Bottom
Transport Count - Represents the bottom transport count.
- Bundler
Count - Represents the bundler count.
- Callback
Intermediate Response - Represents a response to a callback call made by the device.
- Callback
Operation Response - Represents a response to a callback call made by the device.
- Callback
Result - Represents the result for a particular callback operation.
- Callback
Status - Represents the identification ID for a particular callback operation.
- Callback
Status Response - Represents a response to a callback call made by the device.
- Cancel
Reject Count - Represents the cancel reject count.
- Capabilities
- Describes the BNR capabilities.
- CashBox
- The service can handle a cash box. Always TRUE in the BNR.
- Cash
InTransaction Count - Represents the cash in transaction count.
- Cash
Modules Lock Count - Represents the cash modules locked count.
- Cash
Order - Represents a cash order event initiated by the device.
- Cash
Type - Represents a cash type ISO currency code, value, and variant.
- Cash
Type Acceptance History - Represents the history of cash acceptance events.
- Cash
Type Acceptance History List - Represents a list of CashTypeAcceptanceHistory items.
- Cash
Type Dispense History - Represents the dispense history of each CashType
- Cash
Type Dispense History Items - Represents a list of CashTypeDispenseHistory items.
- Cash
Type List - CashType list used for LCU’s secondary cash_type.
- Cash
Type Recycle History Item - Represents a cash type recycle history item.
- Cash
Type Recycle History Items - Represents a list of CashTypeRecycleHistoryItem items.
- Cash
Unit - Represents a cash unit in a BNR device.
- Cashbox
- Represents a denomination cashbox amount.
- Category2
- Euro Article 6, Category 2 support
- Category3
- Euro Article 6, Category 3 support
- CdrPosition
Capabilities - Characteristics of an input/output position.
- CdrPosition
Capabilities List - List of position capabilties.
- CdrPosition
Status List - List of CDR stacker status by position.
- CdrStatus
- Represents the CDR status returned by the
get_statuscall. - Component
Type - Represents the component type of the VersionRequirement
- Configuration
Error Count - Represents the configuration error count.
- Configuration
Reject Count - Represents the configuration reject count.
- Confusion
Count - Represents the confusion count.
- Content
Status Supported - Specifies whether there is a sensor to detect if the position is empty.
- Count
- Represents the note count.
- Currency
- Represents a currency set used in the CDR.
- Currency
Code - Represents an ISO 4217 currency code.
- Current
Date Time - Represents the device current date time.
- Denominate
Amount Count - Represents the denominate amount count.
- Denomination
- This structure handles a list of DenominationItems.
- Denomination
Info - Denomination information for enabling and configuring BNR denominations.
- Denomination
Item - This structure describes the number of bills stored to or dispensed from a Logical Cash Unit.
- Denomination
Items - Denomination
List - Represents a list of DenominationInfo.
- Deposit
- The device can deposit cash. Always TRUE in the BNR.
- Deposit
Count - Represents the deposit count.
- Deposit
Counters - Represents counters for deposits.
- Detector
- The device supports a detector to verify accepted cash. Always TRUE in the BNR.
- Device
Handle - BNR XFS device handle for communication over USB.
- Direct
From Loader Count - Represents the direct from loader count.
- Disappeared
Count - Represents the disappeared count.
- Dispense
- The device can dispense cash. Equals to FALSE in BNA6 configuration, otherwise equals to TRUE.
- Dispense
Amount Count - Represents the dispense amount count.
- Dispense
Count - Represents the dispense count.
- Dispense
Counters - Represents counters for dispensed notes.
- Dispense
Request - Structure that defines the parameters of
bnr_Dispense()orbnr_Denominate(), to specify either an amount or a list of banknotes to dispense. - Emptied
Count - Represents the emptied count.
- Enable
Denomination - Represents whether to enable a denomination specified by a DenominationInfo.
- Environment
Error Count - Represents the environment error count.
- Escrow
- The device supports an escrow. Always TRUE in the BNR.
- Escrow
Size - Specifies the maximum number of bills on the escrow. Equals to 20 in BNA6 configuration, otherwise equals to 15.
- Euro
Art6 Capability - Capabilities for Euro Article 6.
- Exponent
- Represents the exponent field of a [Currency].
- Extended
Counters - Represents extended counters for a cash unit.
- Extraction
Reject Count - Represents the extraction reject count.
- Extraction
Reject Details - Represents the details of extraction reject events.
- Fitness
Count - Represents the fitness count.
- Fitness
Reject Count - Represents the fitness reject count.
- Forced
InCount - Represents the forced in count.
- Forgery
Count - Represents the forgery count.
- Hardware
Failure Count - Represents the hardware failure count.
- Hardware
Failure With Bill Stopped Count - Represents the hardware failure with bill stopped count.
- Held
Back Count - Represents the held back count.
- Incident
Start Section Counters - Represents the incident start section counters.
- Incident
Start Section Counters List - Represents a list of incident start section count items.
- Incompatible
Software Count - Represents the incompatible software count.
- Initial
Count - Represents the initial note count.
- Inlet
Acceptance History - Represents inlet acceptance history.
- Inlet
Detection Count - Represents the inlet detection count.
- Input
- Specifies whether this position can be used as source for an accept command.
- Insertion
Reject Count - Represents the reject count for bill insertion.
- Insertion
Reject Details - Represents details about inssertion reject events.
- Insertion
Start Count - Represents the start count for bill insertion.
- Interface
Count - Represents the interface count.
- Interface
Count List - Represents a list of interface count items.
- Intermediate
Identification Id - Represents the specific call instance for a particular callback operation.
- Intermediate
Stacker - The device has a temporary storage before presenting bills. Always TRUE in the BNR.
- Internal
Reset Count - Represents the internal reset count.
- Internal
Reset With Bill Stopped Count - Represents the internal reset with bill stopped count.
- Loader
Acceptance History - Acceptance bills extracted from the loader unit.
- Loader
Slot Acceptance History - Represents the loader slot acceptance history.
- Lock
- Representation of the
lockfield of a PhysicalCashUnit. - Logical
Cash Unit - Represents a logical cash unit, and its parameters.
- Logical
Cash Unit Items - Logical
Cash Unit List - Represents a list of LogicalCashUnits.
- Main
Module Section Counters - Represents the main module section counters.
- Major
- Represents the major component of the Version
- MaxIn
Bills - Maximum number of bills to be accepted by one command. Allways 1 for the BNR.
- MaxItems
- Maximum number of items which this position can hold.
- MaxOut
Bills - Maximum number of bills to be dispensed by one command. Equals to 20 in BNA6 configuration, otherwise equals to 15.
- MaxSize
- Represents the maximum size of a list.
- Minor
- Represents the minor component of the Version
- Missing
Module Count - Represents the missile module count.
- Module
Count - Represents the module count.
- Module
Count List - Represents a list of module count items.
- Module
Type - Represents the module type of the VersionRequirement
- Number
- Represents a CU ID number.
- Operation
Identification Id - Represents the specific call instance for a particular callback operation.
- Operational
Degraded Count - Represents the operational degraded count.
- Other
Denomination Count - Represents the other denomination count.
- Output
- Specifies whether this position can be used as target for a dispense command.
- PcuName
- Represents the name of a PCU.
- PerSection
History - Represents the internal XFS representation of per-section history.
- PerSection
History Internal - Represents the internal XFS representation of per-section history.
- Physical
Cash Unit - Represents a XFS physical cash unit and its parameters.
- Physical
Cash Unit Items - Physical
Cash Unit List - Represents a list of PhysicalCashUnits.
- Position
Status - Status of a CDR stacker.
- Positioner
Count - Represents the positioner count.
- Positioning
Failed Count - Represents the positioning failed count.
- Power
Down With Bill Stopped Count - Represents the power down with bill stopped count.
- Power
Supply Voltage - Represents a device power supply voltage.
- Power
UpCount - Represents the power up count.
- Recognition
Reject Count - Represents the recognition reject count.
- Recognition
Reject Details - Represents the details of recognition reject events.
- Recognition
Sensor Cover Count - Represents the recognition sensor cover count.
- Recognition
Sensor Temperatures - Represents the device recognition sensor temperatures.
- Recognition
Sensor Type - Recognition sensor type identification. Always ‘B’ in the BNR.
- Recognition
System Count - Represents the recognition system count.
- Refill
- Can the BNR be refilled by placing bills of the same size on the stack of the Loader. Always TRUE in the BNR.
- Refusal
- Specifies whether refused notes can be moved to this position during cash_in command.
- Reject
Count - Represents the reject count.
- Reject
ViaOutlet - Specifies whether measured but unknown or inhibited notes are rejected via the BNR’s Outlet instead of the Inlet. Default value is FALSE.
- Removed
Count - Represents the removed count.
- Report
UsbConsumption - Specifies whether real max USB line consumption is reported on usb configuration descriptor instead of 0mA. Default value is FALSE.
- Reset
With Cover Open Count - Represents the reset with cover open count.
- Reset
With Interlock Open Count - Represents the reset with interlock open count.
- Retract
- The cash dispenser can retract presented bills. Always TRUE in the BNR since FW v1.3.0, FALSE with previous versions.
- Retracted
Count - Represents the retracted count.
- Rollback
- Specifies whether this position can be used as target forcash_in_rollback command.
- Safe
Door Cmd - This device supports a safe door command. Always FALSE in the BNR.
- Security
Level - Represents the security level for acceptance of a denomination specified by a [DenominationInfo].
- Sensor
Temperature - Represents a device sensor temperature.
- Shutter
Cmd - The shutter be accessed by commands. Allways FALSE in the BNR.
- Shutter
Status Supported - Specifies whether shutter status reporting is supported.
- Size
- Represents the size of a list.
- Slot
Number - Represents the slot number.
- Slots
- Represents a list of LoaderSlotAcceptanceHistory items.
- Spine
Count - Represents the spine count.
- Spine
Cover Count - Represents the spine cover count.
- Stacked
While Recycler Full Count - Represents the stacked while recycler full count.
- Stained
Count - Represents the stained count.
- Status
- Represents the status of a CU module.
- String
Detection Count - Represents the string detection count.
- Study
Version - Represents the study version of a denomination specified by a DenominationInfo.
- Superimposed
Count - Represents the superimposed count.
- Suspect
Count - Represents the suspect count.
- System
Cycle Count - Represents the device system cycle count.
- System
Event Count - Represents the system event count.
- System
Failure History - Represents the history of system failure events.
- System
Failure History Internal - Alternative internal representation the history of system failure events.
- System
Opening Count - Represents the system opening count.
- System
Opening Details - Represents the system opening details.
- System
Restart History - Represents the history of system restart events.
- System
Temperature - Represents the device system temperature.
- System
UseHistory - Represents the system use history.
- Threshold
- Structure that defines the levels determining a physical cash unit ThresholdStatus.
- Threshold
Empty - The PCU ThresholdStatus becomes Empty when the bill count is lower or equal to this value.
- Threshold
Full - The PCU ThresholdStatus becomes Full when the bill count is greater or equal to this value.
- Threshold
High - The PCU ThresholdStatus becomes High when the bill count is greater than this value.
- Threshold
Low - The PCU ThresholdStatus becomes Low when the bill count is lower to this value.
- Time
Since Operational - Represents the device time since operational.
- TooLong
Count - Represents the too long count.
- TooMany
Bills Count - Represents the too many bills count.
- TooThick
Count - Represents the too thick count.
- Total
UpTime - Represents the device total up time.
- Transport
Count - Represents the transport count.
- Transport
Error Count - Represents the transport error count.
- Transport
Event Count - Represents the transport event count.
- Transport
Reject Count - Represents the transport reject count.
- Transport
Reject Details - Represents the details of transport reject events.
- Trusted
User - Reserved for future use.
- Unfit
- Euro Article 6, Unfit classification
- Unit
- Represents a denomination unit.
- UnitId
- Represents the ID of an LCU and/or PCU.
- Unknown
Count - Represents the unknown count.
- Unknown
Reject Count - Represents the unknown reject count.
- Unnamed
Count - Represents an unnamed count.
- UpTime
- Represents the device up time.
- Valid
Count - Represents the valid count.
- Valid
Unfit Count - Represents the valid unfit count.
- Value
- Represents the value of a CashType.
- Variant
- Represents the variant of a CashType.
- Version
- Simple version structure, used in version requirements.
- Version
Requirement - Represents a version requirement.
- With
Bill Stopped Count - Represents the with bill stopped count.
Enums§
- Anti
Fishing Level - Defines the sensitivity level of string detection at Inlet.
- BnrError
- Represents BNR error codes.
- CdrPosition
- Represents a CDR position
- CdrType
- Types of CDR units.
- Content
Status - Represents content status values.
- CuKind
- Specifies, if cash unit can dispense, deposit cash or both.
- CuType
- Type of cash unit.
- Default
Rollback Position - Represents a CDR position
- Device
Status - Represents CDR device status values.
- Dispenser
Status - Represents CDR dispenser status values.
- Error
- An error type for the crate.
- Hardware
Status - Represents the overall status of the CDR hardware.
- Intermediate
Event - Cash Module intermediate event.
- Intermediate
Stacker Status - Represents intermediate stacker status values.
- LCU
- Represents the logical cash unit in the CDR.
- MixNumber
- Represents variants for mixing algorithms in different contexts of CDR operation.
- Reporting
Mode - Defines the kind of error report to be generated when a failure is detected whith no bill being transported.
- Safe
Door Status - Represents safe door status values.
- Secured
Comm Level - Values for indication of the security level in communication between Host and BNR.
- Self
Test Mode - Defines how the BNR perform the self tests.
- Shutter
Status - Represents shutter status values.
- Threshold
Mode - Threshold mode used to determine the [ThresholdStatus] of a PCU.
- Threshold
Status - Filling status of a cash unit.
- Transport
Status - Represents transport status values.
- UsbError
- Represents USB error codes.
Constants§
- BILLSET_
ID_ LIST_ LEN - BNR_
CALLBACK_ CALL_ EP - BNR USB endpoint for device-to-host asynchronous callback calls.
- BNR_
CALLBACK_ RESPONSE_ EP - BNR USB endpoint for host-to-device asynchronous callback responses.
- BNR_
CALL_ EP - BNR USB endpoint for host-to-device XfsMethodCalls.
- BNR_PID
- BNR USB Product ID.
- BNR_
RESPONSE_ EP - BNR USB endpoint for device-to-host XfsMethodResponses.
- BNR_VID
- BNR USB Vendor ID.
- CASH_
AVAILABLE - CASH_
TAKEN - CASH_
TYPE_ HISTORY_ DEFAULT - CASH_
TYPE_ HISTORY_ LIST_ LEN - CASH_
TYPE_ LIST_ LEN - CASH_
TYPE_ RECYCLE_ DEFAULT - CASH_
TYPE_ RECYCLE_ LIST_ LEN - CASH_
UNIT_ CHANGED - CASH_
UNIT_ CONFIG_ CHANGED - CASH_
UNIT_ OK - CASH_
UNIT_ STATE - CASH_
UNIT_ STOP - CASH_
UNIT_ THRESHOLD - CASH_
UNIT_ UNKNOWN - CDR_
IS_ EMPTY - CDR_
IS_ NOT_ EMPTY - CDR_
IS_ UNKNOWN - CDR_
POS_ BOTTOM - CDR_
POS_ CAP_ LIST_ LEN - CDR_
POS_ TOP - CT_
EMPTY - CT_
NOT_ EMPTY - DENOMINATION_
LIST_ LEN - DENOM_
ITEM_ LEN - DEVICE_
STATUS_ CHANGED - HARDWARE_
ERROR - LCU_
BAIT_ TRAP - LCU_
BILL_ CASSETTE - LCU_
COIN_ CYLINDER - LCU_
COIN_ DISPENSER - LCU_
COUPON - LCU_
CURRENCY_ CASSETTE - LCU_
DEPOSIT - LCU_
DISPENSE - LCU_
DOCUMENT - LCU_
EMPTY - LCU_
ESCROW - LCU_
FULL - LCU_
HIGH - LCU_
INOP - LCU_
LIST_ LEN - Maximum number of LogicalCashUnits that can be present on a device.
- LCU_LOW
- LCU_
MISSING - LCU_NA
- LCU_
NOT_ DISPENSABLE - LCU_
NO_ REF - LCU_
NO_ VALUE - LCU_OK
- LCU_
OVERFLOW_ CASSETTE - LCU_
RECYCLE - LCU_
REJECT_ CASSETTE - LCU_
RETRACT_ CASSETTE - LCU_
UNKNOWN - LOADER_
SLOT_ DEFAULT - OFF_
LINE - ON_LINE
- PCU_
LIST_ LEN - Maximum number of PhysicalCashUnits that can be present on a device.
- PCU_
NAME_ LEN - POS_
STATUS_ LIST_ LEN - SD_
LOCKED - SD_OPEN
- SD_
UNKNOWN - SHT_
CLOSED - SHT_
NOT_ SUPPORTED - SHT_
OPEN - SHT_
UNKNOWN - SLOT_
HISTORY_ LIST_ LEN - TRANSPORT_
CHANGED - TRANSPORT_
INOP - TRANSPORT_
OK - TRANSPORT_
UNKNOWN - UNIT_
ID_ LEN - URB_LEN
- Length of the URB (USB Request Block) header length on Linux.
- USER_
ERROR
Traits§
- Callback
Arg - Trait for arguments to state change callbacks used by the XFS API.
Functions§
- with_
handle - Locks the global DeviceHandle instance, and calls the provided callback.
Type Aliases§
- Intermediate
Occurred Fn - Function signature for the
Intermediate Occurredcallback used by the XFS API. - Operation
Completed Fn - Function signature for the
Operation Completedcallback used by the XFS API. - Result
- Convenience alias for a
Resulttype for the crate. - Status
Occurred Fn - Function signature for the
Status Occuredcallback used by the XFS API.