1.1.0 • Published 2 years ago

node-anviz v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

node-anviz

NPM package to communicate with Anviz devices.

The aim of this project is to implement the TC_B Communication Protocol (V2.15) provided by anviz via e-mail on April 2019 (See dev/tcb_communications_protocol2.5.pdf).

The protocol is not completely implemented, but it's usable.

Want to contribute? Great!

I'm accepting PR's if anyone wants to jump in.

Usage

Install the module

npm install node-anviz

Call a supported method:

const anviz = require("node-anviz");
let request = new anviz.Request("<device ip>");
request.execute("getInformation1", 1).then((res, raw) => {
    console.info(res, raw);
    request.close();
}, (err) => {
    console.info("ERROR", err);
});

Notes

Calling a method returns a Promise.

You should implement your own mutex/sync logic and should only execute one command at a time: The library tries to prevent you from doing it but don't really enforce, it should be up to the implementer to assure proper syncing of calls.

I believe the best way to implement this library is to implement it on an async/await fashion, I've included example files async-downloadRecords.js and async-example.js to help illustrate my point.

Documentation

This project has been a bit sidetracked for years, I implement methods as I need them (to use them on my devices & projects). All implemented methods are documented on the examples folder, with one example per method. So if you want to call a method you'll find a valid call there.

Methods status:

PLEASE NOTE: The method descriptions were taken out DIRECTLY from the protocol document (check the pdf on the dev/ folder); Do not make me questions about the descriptions, some of them are incomprehensible.

IDMethod DescriptionCommandStatusNameTested On Device
1Get Device Configuration 10x30:white_check_mark:getInformation1:white_check_mark:
2Set Device Configuration 10x31:white_check_mark:setInformation1:red_circle:
3Get Device Configuration 20x32:white_check_mark:getInformation2:white_check_mark:
4Set Device Configuration 20x33:red_circle:
5Get Device Date/Time0x38:white_check_mark:getDateTime:white_check_mark:
6Set Device Date/Time0x39:white_check_mark:setDateTime:white_check_mark:
7Get Network Configuration0x3A:white_check_mark:getNetworkConfiguration:white_check_mark:
8Set Network Configuration0x3B:red_circle:
9Get Records Info0x3C:white_check_mark:getRecordInformation:white_check_mark:
10Download T&A Records0x40:white_check_mark:downloadAttendanceRecords:white_check_mark:
11Upload T&A Record0x41:white_check_mark:uploadRecord:red_circle:
12Download User's Info0x42:red_circle:
13Upload User’s Info0x43:red_circle:
14Download FP Template0x44:red_circle:
15Upload FP Template0x45:red_circle:
16Get Device ID0x46:red_circle:
17Set Device ID0x47:red_circle:
18Get Device Model code0x48:white_check_mark:getDeviceModel:white_check_mark:
19Set Device Model Code0x49:red_circle:
20Get Manufacture Code0x4A:red_circle:
21Set Manufacture Code0x4B:red_circle:
22Delete Designated User Data0x4C:red_circle:
23Initialize User Profile0x4D:red_circle:
24Erase all Records/ New Records Flag0x4E:white_check_mark:eraseNewRecordsFlag:white_check_mark:
25Initialize System0x4F:red_circle:
26Get Timezone0x50:red_circle:
27Set Timezone0x51:red_circle:
28Get Group Info0x52:red_circle:
29Set Group Information0x53:red_circle:
30Get Alarm Setting0x54:red_circle:
31Set Alarm0x55:red_circle:
32Get Indexed Messages0x56:red_circle:
33Add Index Message0x57:red_circle:
34Get Headers of All Index MSG0x58:red_circle:
35Delete Index Message0x59:red_circle:
36Get T&A Status Parameters List0x5A:red_circle:
37Set T&A Status Parameters List0x5B:red_circle:
38Enroll Fingerprint Online0x5C:red_circle:
39Get Device Capacity Parameter0x5D:red_circle:
40Unlock Door Without Authentication0x5E:red_circle:
41Output T&A Records in Real Time0x5F:red_circle:
42Get Customized T&A Statuses0x70:red_circle:
43Set Customized T&A Statuses0x71:red_circle:
44Download User Data Extended0x72:red_circle:
45Upload User Data Extended0x73:red_circle:
46Get Communication Device ID0x74:red_circle:
47Modify Communication Device ID0x75:red_circle:
48Clear Admin Flag0x3D:red_circle:
49Get Time Stamp0x3E:red_circle:
50Set Time Stamp0x3F:red_circle:
51Get Random Number0x76:red_circle:
52Encrypt Device Model and Language Options with a Random Number0x77:red_circle:
53Get Specified Index Message0x26:red_circle:
54Add a Indexed Message0x27:red_circle:
55Get Headers of a Ranged Message0x28:red_circle:
56Delete a indexed Message0x29:red_circle:
57Get T&A Status Auto Switching Setting0x20:red_circle:
58Set T&A Status Auto Switching Setting0x21:red_circle:
59Get the Number of Daily Remaining Attempts of a Specified User0x10:red_circle:
60Set Daily Attempts Number of a Specified User0x10:red_circle:
61Download User Data Extended0x22:red_circle:
62Upload User Data Extended0x23:red_circle:
63Get Device Serial Number0x24:red_circle:
64Modify Device Serial Number0x25:red_circle:
65Get Special State0x2F:red_circle:
66Get Number of All Images0x2A:red_circle:
67Get Image Headers0x2B:red_circle:
68Get a Specified Image File0x2C:red_circle:
69Delete a Specified Image0x2D:red_circle:
70Update Firmware/Image/Voice0x10:red_circle:
71Directory Operation0x12:red_circle:
72Download Log Files0x13:red_circle:
73Get Admin Card ID/ Password0x1C:red_circle:
74Set Admin Card ID/ Password0x1D:red_circle:
75Get Daylight Saving Parameters0x1A:red_circle:
76Set Daylight Saving Parameters0x1B:red_circle:
77Get Language Options0x18:red_circle:
78Set Language Options0x19:red_circle:
79Send Feature Value/ Card ID to T&A Device0x78:red_circle:
80Get GPRS Parameters0x16:red_circle:
81Set GPRS Parameters0x17:red_circle:
82Get Device Extended Info0x7A:red_circle:
83Modify Device Extended Info0x7B:red_circle:
84Get Card Number0x7E:red_circle:
85Get Reboot Time0x14:red_circle:
86Set Reboot Time0x15:red_circle:
87Extended Commands0x2E:red_circle:
88UDP Search Device0x02:red_circle:
89UDP Set Device Parameter0x03:red_circle:
90Heartbeat Package0x7F:red_circle:
91Data Modification Alert0x7D:red_circle:
92Download Personnel Change Records0x64:red_circle:
93Download User’s Information Extended0x65:red_circle:
94Clear Change of Personnel Records/ Flags0x1E:red_circle:
95Get Device Configuration 30x34:red_circle:
96set Device Configuration 30x35:red_circle:
97Connection Authentication0x04:red_circle:
98Get Device Configuration40x36:red_circle:
99Add Department0x61:red_circle:
100Delete Department0x62:red_circle:
101Download a Specified User’s Templates/Images0x66:red_circle:
102Batch Download Users’ Images0x67:red_circle:
103Get Result of Last Authentication Pass/Fail0x79:red_circle:
104Get Timezone Mode Status0x68:red_circle:
105Set Timezone Mode Status0x69:red_circle:
106Upload User’s images0x6D:red_circle:
107Add BT Device/User0x6A:red_circle:
108Delete Specific Address of Bluetooth Device0x6B:red_circle:
109Get Information of All Bluetooth Devices0x6C:red_circle:
110Get IEEE802.11 Network Setting0x6E:red_circle:
111Set IEEE 802.11 Network setting0x6F:red_circle:
112Get Authorization Code0x05:red_circle:
113Authorize0x06:red_circle:
114UDP Start Video0x07:red_circle:
115UDP Stop Video0x08:red_circle:
116UDP Command0x09:red_circle:
117Get Server URL0x0A:white_check_mark:getServerURL:white_check_mark:
118Set Server URL0x0B:white_check_mark:setServerURL:red_circle:
119Test User0x0C:red_circle:

License

MIT

1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

5 years ago