Reputation: 7161
I am having a finger print scanner device having USB interface. The device also has compatible drivers, and SDK in C,C++,.NET and Java
I wanted to develop a web application to provide user interface instead of desktop application. However there is no direct Javascript interface SDK provided.
So is following approach correct?
One possible way to achieve this may be using Node.js Addons
Scanner Device <--DRIVER--><--C++ SDK--><--Node.js server--><--Client side JS/HTML-->
Thanks!
Upvotes: 1
Views: 647
Reputation: 9412
yes is correct, there are working applications for this approach like access a RFID reader with rc522 chipset from node.js, see https://github.com/sbrinkmann/rc522-rfid/blob/master/src/rc522.c
you have to install node-gyp
(node.js native addon build tool) and install the device-specific libraries on the machine where the device is attached (see the project in the git above)
however, maybe there are easier and more general solutions that do not require installation of device specific libraries on the target machine. this depends on what USB device class the fingerprint scanner implements:
if it implements a USB HID device (what is common) you can access its output using the npm package node-hid
if it implements a virtual COM port (CDC ACM class) you can use npm package serialport
to access its data
...
you can determine the USB class of the fingerprint scanner on linux by lsusb -v | grep bDeviceClass
(or lsusb -v | grep bInterfaceClass
if defined on interface level) or the graphical tool USBView
on windows
Upvotes: 1