Skip to content

Commit 494d635

Browse files
authored
Merge pull request #1 from Desionlab/develop
Build v0.0.1
2 parents 3bea725 + c41e8ca commit 494d635

38 files changed

Lines changed: 2391 additions & 2 deletions

.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"mocha": true,
5+
"es6": true
6+
},
7+
"parserOptions": {
8+
"ecmaVersion": 2017
9+
},
10+
"globals": {
11+
"assert": false,
12+
"makeTestFeature": false
13+
},
14+
"rules": {
15+
"no-const-assign": "warn",
16+
"no-this-before-super": "warn",
17+
"no-undef": "warn",
18+
"no-unreachable": "warn",
19+
"no-unused-vars": "warn",
20+
"constructor-super": "warn",
21+
"valid-typeof": "warn"
22+
}
23+
}

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.github/.gitkeep

Whitespace-only changes.

.gitignore

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1+
# Windows file.
2+
# -----------------------------------------------------------------------------
3+
Thumbs.db
4+
ehthumbs.db
5+
6+
# Folder config file
7+
Desktop.ini
8+
9+
# Recycle Bin used on file shares
10+
$RECYCLE.BIN/
11+
12+
# Windows Installer files
13+
*.cab
14+
*.msi
15+
*.msm
16+
*.msp
17+
18+
# Windows shortcuts
19+
*.lnk
20+
21+
22+
# MicrosoftOffice
23+
# -----------------------------------------------------------------------------
24+
*.tmp
25+
26+
# Word temporary
27+
~$*.doc*
28+
29+
# Excel temporary
30+
~$*.xls*
31+
32+
# Excel Backup File
33+
*.xlk
34+
35+
# PowerPoint temporary
36+
~$*.ppt*
37+
38+
# Visio temporary
39+
~$*.~vsdx
40+
41+
42+
# Visual Studio Code
43+
# -----------------------------------------------------------------------------
44+
.history
45+
46+
47+
# Node.
48+
# -----------------------------------------------------------------------------
149
# Logs
250
logs
351
*.log
@@ -56,4 +104,33 @@ typings/
56104

57105
# dotenv environment variables file
58106
.env
107+
package-lock.json
108+
109+
110+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
111+
# -----------------------------------------------------------------------------
112+
*.iml
113+
114+
## Directory-based project format:
115+
.idea/
116+
# if you remove the above rule, at least ignore the following:
117+
118+
## File-based project format:
119+
*.ipr
120+
*.iws
121+
122+
## Plugin-specific files:
123+
124+
# IntelliJ
125+
out/
126+
127+
# mpeltonen/sbt-idea plugin
128+
.idea_modules/
129+
130+
# JIRA plugin
131+
atlassian-ide-plugin.xml
59132

133+
# Crashlytics plugin (for Android Studio and IntelliJ)
134+
com_crashlytics_export_strings.xml
135+
crashlytics.properties
136+
crashlytics-build.properties

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.words": [
3+
"barcode"
4+
]
5+
}

CHANGELOG.md

Whitespace-only changes.

CONTRIBUTING.md

Whitespace-only changes.

Docs/.gitkeep

Whitespace-only changes.

Examples/CCNet/bv-full.js

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
/**
2+
* bv-full.js
3+
*
4+
* @author Desionlab <fenixphp@gmail.com>
5+
* @copyright 2017 - 2018 Desionlab
6+
* @license MIT
7+
*
8+
* Library for working with "CashCode" Bill Validator devices from Node.js app.
9+
*/
10+
11+
/* */
12+
const { CCNet } = require('./../../Source');
13+
14+
/* */
15+
let device = new CCNet.BillValidator('COM6');
16+
17+
/* */
18+
let counter = 0;
19+
20+
/* */
21+
async function init () {
22+
/* */
23+
device.on('status', function (status) {
24+
//console.log('on:status', status);
25+
});
26+
27+
/* ----------------------------------------------------------------------- */
28+
29+
/* */
30+
device.on('power-up', function () {
31+
console.log('on:power-up');
32+
});
33+
34+
/* */
35+
device.on('power-up-with-bill', function () {
36+
console.log('on:power-up-with-bill');
37+
});
38+
39+
/* */
40+
device.on('power-up-with-bill-in-stacker', function () {
41+
console.log('on:power-up-with-bill-in-stacker');
42+
});
43+
44+
/* ----------------------------------------------------------------------- */
45+
46+
/* */
47+
device.on('initialize', function () {
48+
console.log('on:initialize');
49+
});
50+
51+
/* */
52+
device.on('disabled', function () {
53+
console.log('on:disabled');
54+
});
55+
56+
/* */
57+
device.on('holding', function () {
58+
console.log('on:holding');
59+
});
60+
61+
/* ----------------------------------------------------------------------- */
62+
63+
/* */
64+
device.on('cassette-full', function () {
65+
console.log('on:cassette-full');
66+
});
67+
68+
/* */
69+
device.on('cassette-out-of-position', function () {
70+
console.log('on:cassette-out-of-position');
71+
});
72+
73+
/* ----------------------------------------------------------------------- */
74+
75+
/* */
76+
device.on('jammed', function () {
77+
console.log('on:jammed');
78+
});
79+
80+
/* */
81+
device.on('cassette-jammed', function () {
82+
console.log('on:cassette-jammed');
83+
});
84+
85+
/* */
86+
device.on('cheated', function () {
87+
console.log('on:cheated');
88+
});
89+
90+
/* */
91+
device.on('pause', function () {
92+
console.log('on:pause');
93+
});
94+
95+
/* ----------------------------------------------------------------------- */
96+
97+
/* */
98+
device.on('idling', async function () {
99+
/* */
100+
console.log('on:idling');
101+
102+
/* */
103+
if (counter >= 2) {
104+
await device.end();
105+
106+
setTimeout(async function () {
107+
counter = 0;
108+
await device.begin();
109+
}, (60 * 1000) * 5);
110+
}
111+
});
112+
113+
/* */
114+
device.on('accepting', function () {
115+
console.log('on:accepting');
116+
});
117+
118+
/* */
119+
device.on('escrow', async function (bill) {
120+
/* */
121+
console.log('on:escrow:', bill);
122+
123+
if (bill.amount == 50) {
124+
/* */
125+
await device.retrieve();
126+
} else {
127+
/* */
128+
await device.stack();
129+
130+
/* */
131+
counter++;
132+
}
133+
});
134+
135+
/* */
136+
device.on('stacking', function () {
137+
console.log('on:stacking');
138+
});
139+
140+
/* */
141+
device.on('stacked', function (bill) {
142+
console.log('on:stacked:', bill);
143+
});
144+
145+
/* */
146+
device.on('returning', function () {
147+
console.log('on:returning');
148+
});
149+
150+
/* */
151+
device.on('returned', function (bill) {
152+
console.log('on:returned:', bill);
153+
});
154+
155+
/* ----------------------------------------------------------------------- */
156+
157+
/* */
158+
await device.connect();
159+
160+
/* ----------------------------------------------------------------------- */
161+
162+
console.log(device.info);
163+
console.log(device.billTable);
164+
165+
/* ----------------------------------------------------------------------- */
166+
167+
/* */
168+
//await device.begin();
169+
170+
/* */
171+
//await device.close();
172+
}
173+
174+
init()
175+
.then(function () {
176+
console.log('Ok.');
177+
})
178+
.catch(function (error) {
179+
console.error(error);
180+
});
181+
182+
/* End of file bv-full.js */

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Desionlab
3+
Copyright (c) 2017 - 2018 Desionlab
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)