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:
Santiago Gimeno
2013-07-04 22:50:18 +02:00
parent c98f7bc2de
commit 3f2a1b5e4e
5 changed files with 42 additions and 18 deletions

View File

@@ -41,6 +41,8 @@ class CardReader: public node::ObjectWrap {
struct AsyncResult {
LONG result;
unsigned long status;
unsigned char atr[MAX_ATR_SIZE];
unsigned long atrlen;
bool do_exit;
};
@@ -80,6 +82,8 @@ class CardReader: public node::ObjectWrap {
static void AfterTransmit(uv_work_t* req);
static void CloseCallback(uv_handle_t *handle);
static v8::Handle<v8::Value> CreateBufferInstance(char* data, unsigned long size);
private:
SCARDCONTEXT m_card_context;