NodeJS library to work with coin and bill acceptors under SSP protocol. Based on the work by soulman-is-good.
- NV10
- NV9 (not tested)
You are always welcome to add implementation to another device. Theoritically, you just need to add commands list to src/commands
, a device name to SSPType
type and check out event codes in src/events.ts
.
npm install ts-ssp
open: () => Promise<void>
- initializes connection to deviceclose: () => Promise<void>
- stops connection to deviceenable: () => Promise<void>
- enables money receivingdisable: () => Promise<void>
- disabled money receivingcommands.exec: (commandName?: string, ...commandArguments: number[]) => Promise<void>
- Adds a command to command stack and execute it. If no commandName is passed, just executes the command stackon: (eventName: string, eventHandler: (...args: number[])) => void
- Attaches event handleroff: (eventName: string, eventHandler: (...args: number[])) => void
- Dettaches event handlerisOpened: () => boolean
- is connection to device openedisEnabled: () => boolean
- is money receiving enabled
start
- emits after device is initializedclose
- emits after device is disconnectederror
- emits when any error occured- other events supported by SSP protocol like
slave_reset
,read_note
,credit_note
,note_rejecting
,note_stacking
,disabled
- Basic example with ILS (
npm run examples:ils-default
to run it)
There are a lot of things we need to finish to make this project great again:
- Add support of more devices
- Add support of encrypted layer
- Write some tests and refactoring
Contributions are always welcome!