Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# ufr-online-nodejs-websocket-master-mode-server
Node.js WebSocket Master mode Server example.
## Install
$ npm install --save ws express
## Run
Put uFR Online Reader in Master mode and enter Server URL.
Run server using: $ npm start
Put card on reader and wait for beep and green light.
## uFR Class usage
Create uFR class object **const uFR = new uFRClass();**
On WebSocket message event call **uFR.setRequest(data);** where **data** is incoming message.
Optional get incoming parameters for example card UID **uFR.getCardId**
Set response action for example Beep signal **uFR.readerUISignal(uFR.UFR1, 1,1);**
Get generated outgoing message using **uFR.getResponse** and send to uFR Online using WebSocket client for example **ws.send(uFR.getResponse);**
## uFR Class public methods
**getSerialNumber** - Returns uFR NFC reader serial number
**getOnlineSerialNumber** - Returns uFR Online serial number
**getCardId** - Returns Card UID
**getReader** - Returns 1 if internal reader is used or 2 if external.
**readerUISignal(readerNumber, light, beep)** - Set Reader User interface signal
**setTemplate(readerNumber, template)** - Set Barrier control template (not used for uFR Online)
**lockOpen(readerNumber, lockNumber, duration)** - Open Barrier control lock (not used for uFR Online)
**dlioOpen(readerNumber, lockNumber)** - Open DLIO lock (not used for uFR Online)
**ledRingRGB(readerNumber, red, green, blue)** - Turn on uFR NFC reader RGB ring, all LEDs same color (if connected)
**ledRingArray(readerNumber, array)** - Turn on uFR NFC reader RGB ring, supported up to 24 LEDs (if connected)
**onlineRGB(readerNumber, red, green, blue, duration)** - Turn on uFR Online internal RGB LEDs. Both LEDs same color
**onlineRGBDual(readerNumber, red, green, blue, red1, green1, blue1, duration)** - Turn on uFR Online internal RGB LEDs. LEDs colors separated
**gpioControl(readerNumber, gpio, state)** - Set external uFR Online GPIO state (0 - LOW, 1 - HIGH, 2 - INPUT)
**blinkingControl(readerNumber, state)** - Turn off/on uFR NFC reader blinking LEDs
**pause(readerNumber, duration)** - Add pause between commands.
## ReaderNumber parameter
**uFR.ONLINE** - Send command to uFR Online
**uFR.UFR1** - Send command to first connected uFR NFC reader
**uFR.UFR2** - Send command to second (external) connected uFR NFC reader
**uFR.BARRIER** - Send command to barrier controller (if available)
**uFR.BARRIER** - Send command to DLIO controller (if available)