bill-acceptor
rs-232 serial bill acceptor in scala and akka
git clone https://9o.is/git/bill-acceptor.git
README.md
(2125B)
1 # Bill Acceptor RS-232 Library
2
3 Communicates with a bill acceptor using [Flow](https://github.com/jodersky/flow), jodersky's rs232 serial communication library for Akka.
4
5 ----
6 ## which bill acceptors are supported?
7 1. [Apex 7000 Series](http://pyramidacceptors.com/apex-7000/)
8 2. [ID-003 Protocol](ftp://67.205.101.207/Pripherals/BillAcceptors/JCM/ID003/ID-003%20Protocol%20Spec.pdf) *(coming soon)*
9
10 ----
11 ## usage
12
13 Instantiate the acceptor actor inside an Akka parent actor.
14
15 import inc.pyc.bill.acceptor._, Events._, Commands._
16 lazy val acceptor = context.actorOf(BillAcceptor.props(context.system), "BillAcceptor")
17
18 Example of sending bill acceptor a command.
19
20 acceptor ! Listen
21
22 ### commands
23
24 **Listen** : listen to serial port and poll bill acceptor
25 **UnListen** : stop listening to serial port
26 **Inhibit** : accept all bills
27 **UnInhibit**: do not accept bills
28 **Stack** : accept the bill in escrow
29 **Return** : do not accept the bill in escrow
30
31 ### events
32
33 **Disconnected** : not connected to serial port
34 **Ready** : bill acceptor is ready to be used after sending listen command
35 **Inserted(bill: Currency#Value)** : bill was inserted and is waiting in escrow mode
36 **Confirmed(bill: Currency#Value)**: bill is or will be stacked and cannot be returned; safe to give credit
37
38 ----
39 ## configuration
40
41 By default, configuration is not needed, but below is an example that can be added to application.conf in case changes need to be made.
42
43 bill-acceptor {
44 currency = "USD"
45 driver = "inc.pyc.bill.acceptor.apex.Apex"
46 currency = "USD"
47 port = "/dev/ttyUSB0"
48 baud = 9600
49 parity = 2
50 char-size = 7
51 buffer-size = 10
52 two-stop-bits = off
53 }
54
55 **Note**: the only supported currency at the moment is USD.
56
57 ----
58 ## installation
59
60 - flow-native needs to be installed to use serial communication. [Read here for basic instructions](https://github.com/jodersky/flow#basic-usage).
61 - This depends on a separate library: "currency-lib". In the same directory you git cloned this project, run "git clone https://github.com/pyc-inc/currency-lib.git"