Smiley Secure Protocol nodejs implementation
Introduction
This library allows you to manipulate bill acceptors and note validators under SSP. Written by Innovative Technologies SSP manual
Maintained devices:
- NV10
- NV9 //preparing
Installation
npm install ssp
Usage
var ssp = ;var notes = 1:"200KZT" 2:"500KZT" 3:"1000KZT" 4:"2000KZT" 5:"5000KZT" 6:"10000KZT";ssp = device: '/dev/ttyACM0' //device address type: "nv10usb" //device type currencies:011110 //currencies types acceptable. Here all but 200KZT; ssp;
Properties
- commands - Generated on creation command-interface for sending command or stack of commands to device
Methods
- init([enableOnInit],[callback]) - Initializes device, in case of an error emits error event. Can take boolean as a first argument which defines whether enable or not a device on init, second argument is callback, which has possible exception;
- enable([callback]) - Enables device. Callback may be as an argument to supply asynchrony
- disable([callback]) - Disables device. Callback may be as an argument to supply asynchrony
- commands.{command} - device`s commands binds as a methods to commands interface and can be chained in execution stack like ssp.commands.enable().display_off().event_ack() and then executed via exec method
- commands.exec([command], [callback]) - executes command stack. Method has optional command parameter which if passed made to the end of command stack, and a callback.
Events
- ready - emits when device is ready for data.
- close - emits on device closes. e.g. disconnected
- error - emits when error occures. Has error object as an argument of a callback
- other events supported by SSP protocol like slave_reset, read_note, credit_note, note_rejecting, note_stacking, disabled et.c.
Thanks to
Contributors: