Skip to content

Commit

Permalink
doc: document PCSCLite::close, CardReader::close
Browse files Browse the repository at this point in the history
- Update example accordingly.
  • Loading branch information
santigimeno committed Sep 26, 2014
1 parent c560273 commit d7dfb80
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ pcsc.on('reader', function(reader) {
console.log(err);
} else {
console.log('Data received', data);
reader.close();
pcsclite.close();
}
});
}
Expand Down Expand Up @@ -101,6 +103,10 @@ The PCSCLite object is an EventEmitter that notifies the existence of Card Reade

Emitted whenever a new card reader is detected.

#### pcsclite.close()

It frees the resources associated with this PCSCLite instance. At a low level it calls [`SCardCancel`](http://pcsclite.alioth.debian.org/pcsc-lite/node21.html) so it stops watching for new readers.


### Class: CardReader

Expand Down Expand Up @@ -162,3 +168,7 @@ Wrapper around [`SCardTransmit`](http://pcsclite.alioth.debian.org/pcsc-lite/nod
* *output* `Buffer`

Wrapper around [`SCardControl`](http://pcsclite.alioth.debian.org/pcsc-lite/node18.html). Sends a command directly to the IFD Handler (reader driver) to be processed by the reader.

#### reader.close()

It frees the resources associated with this CardReader instance. At a low level it calls [`SCardCancel`](http://pcsclite.alioth.debian.org/pcsc-lite/node21.html) so it stops watching for the reader status changes.
2 changes: 2 additions & 0 deletions examples/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ pcsc.on('reader', function(reader) {
console.log(err);
} else {
console.log('Data received', data);
reader.close();
pcsc.close();
}
});
}
Expand Down

0 comments on commit d7dfb80

Please sign in to comment.