CardReader status event should return the ATR
- Of the inserted card. - Refactoring of the code that creates a Buffer instance into a separate function. - Update the example and README - It fixes bug #2
This commit is contained in:
@@ -36,12 +36,17 @@ module.exports = function() {
|
||||
var r = new CardReader(name);
|
||||
readers_aux.push(r);
|
||||
p.emit('reader', r);
|
||||
r.get_status(function(e, status) {
|
||||
r.get_status(function(e, state, atr) {
|
||||
if (e) {
|
||||
r.emit('error', e);
|
||||
} else {
|
||||
var status = { state : state };
|
||||
if (atr) {
|
||||
status.atr = atr;
|
||||
}
|
||||
|
||||
r.emit('status', status);
|
||||
r.status = status;
|
||||
r.state = state;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user