Update pcsclite.js
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
var events = require('events');
|
var events = require('events');
|
||||||
var bt = require('buffertools');
|
/****************************************************************************** var bt = require('buffertools'); */
|
||||||
|
|
||||||
/* Make sure we choose the correct build directory */
|
/* Make sure we choose the correct build directory */
|
||||||
var bindings = require('bindings')('pcsclite');
|
var bindings = require('bindings')('pcsclite');
|
||||||
@@ -7,7 +8,7 @@ var PCSCLite = bindings.PCSCLite;
|
|||||||
var CardReader = bindings.CardReader;
|
var CardReader = bindings.CardReader;
|
||||||
inherits(PCSCLite, events.EventEmitter);
|
inherits(PCSCLite, events.EventEmitter);
|
||||||
inherits(CardReader, events.EventEmitter);
|
inherits(CardReader, events.EventEmitter);
|
||||||
|
/**
|
||||||
var parse_readers_string = function(readers_str) {
|
var parse_readers_string = function(readers_str) {
|
||||||
var pos;
|
var pos;
|
||||||
var readers = [];
|
var readers = [];
|
||||||
@@ -19,6 +20,14 @@ var parse_readers_string = function(readers_str) {
|
|||||||
|
|
||||||
return readers;
|
return readers;
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
var parse_readers_string_by_hapet = function(readers_str) {
|
||||||
|
|
||||||
|
// without buffertool module ;)
|
||||||
|
|
||||||
|
return [readers_str];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It returns an array with the elements contained in a that aren't contained in b
|
* It returns an array with the elements contained in a that aren't contained in b
|
||||||
@@ -39,7 +48,8 @@ module.exports = function() {
|
|||||||
return p.emit('error', err);
|
return p.emit('error', err);
|
||||||
}
|
}
|
||||||
|
|
||||||
var names = parse_readers_string(data);
|
/************************************************************* var names = parse_readers_string(data); */
|
||||||
|
var names = parse_readers_string_by_hapet(data);
|
||||||
|
|
||||||
var current_names = Object.keys(readers);
|
var current_names = Object.keys(readers);
|
||||||
var new_names = diff(names, current_names);
|
var new_names = diff(names, current_names);
|
||||||
|
|||||||
Reference in New Issue
Block a user