https://github.com/kybarg/ssp
Node.JS implementation of Encrypted Smiley ® Secure Protocol (eSSP, SSP)
https://github.com/kybarg/ssp
bv100 bv20 bv50 encrypted-smiley-secure-protocol essp itl nv10usb nv11 nv200 nv22 nv9 nv9usb smart-hopper smart-payout smiley-secure-protocol ssp
Last synced: about 1 year ago
JSON representation
Node.JS implementation of Encrypted Smiley ® Secure Protocol (eSSP, SSP)
- Host: GitHub
- URL: https://github.com/kybarg/ssp
- Owner: kybarg
- License: mit
- Created: 2024-04-24T12:48:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-03T07:19:55.000Z (over 1 year ago)
- Last Synced: 2025-03-17T04:18:50.107Z (about 1 year ago)
- Topics: bv100, bv20, bv50, encrypted-smiley-secure-protocol, essp, itl, nv10usb, nv11, nv200, nv22, nv9, nv9usb, smart-hopper, smart-payout, smiley-secure-protocol, ssp
- Language: JavaScript
- Homepage:
- Size: 93.8 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://npmjs.com/@kybarg/ssp) [](https://codecov.io/gh/kybarg/ssp) [
](https://github.com/kybarg/ssp/actions/workflows/node.js.yml) [](https://github.com/kybarg/ssp/blob/main/LICENSE)
# @kybarg/ssp
Node.JS implemenation of Encrypted Smiley ® Secure Protocol (eSSP, SSP)
**Supported devices:** NV9USB, NV10USB, BV20, BV50, BV100, NV200, NV200 Spectral, SMART Hopper, SMART Payout, NV11, NV22
> [!WARNING]
>
> **NV11** is not fully tested and supported. Maintainer is required.
## Table of Contents
1. [Basis usage](#basis-usage)
2. [Methods](#methods)
3. [Documentation](docs/readme.md)
## Basis usage
```js
const sspLib = require('@kybarg/ssp')
let eSSP = new sspLib({
id: 0x00,
timeout: 3000,
fixedKey: '0123456701234567',
})
eSSP.on('READ_NOTE', result => {
console.log('READ_NOTE', result)
})
eSSP.command('GET_SERIAL_NUMBER').then(result => {
console.log('Serial number:', result.info.serial_number)
return
})
const portOptions = { baudRate: 9600 }
eSSP.open('COM1', portOptions)
```
## Config values
```javascript
const options = {
fixedKey: '123', // device internal encryption key
encryptAllCommand: true, // should command commands also be encrypted
id: 0, // device id in case multiple acceptors connected to the host
timeout: 1000, // command response timeout after wich command considered failed
commandRetries: 20, // how many time to retry before throwing error or emitting ERROR event
pollingInterval: 300, // interval between poll messages
}
```
## Methods
All methods return Promise
- `eSSP.open('COM1')` - Connect device
- `eSSP.close()` - Disconnect device
- `eSSP.initEncryption()` - Initializing Diffie-Hellman key exchange and enable encryption
- `eSSP.enable()` - Enable device and start listen events
- `eSSP.disable()` - Disable device and stop listen events
- `eSSP.poll()` - Start/Stop polling the device
- `eSSP.command('COMMAND_NAME')` - Execute command and get answer
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.