Commit Graph

133 Commits

Author SHA1 Message Date
Santiago Gimeno
0a3eaafb2b src: fix reader disconnection logic
- A reader disconnection can't be detected by SCardGetStatusChange in the reader
  (cardreader.cpp) but by detecting that the reader doesn't appear in the list of
  readers retrieved in pcsclite.cpp.
- The list of readers is now stored in an object where the keys are the names of
  the readers. When a reader disconnection is detected, the reader is closed
  triggering the 'end' event. Then the reader is removed from the readers list.
2015-09-26 14:35:59 +02:00
Sebastian Arena
8f3309520d src: check dwEventState and not dwCurrentState
- As the new state is returned in the former.
2015-09-26 14:35:50 +02:00
Santiago Gimeno
32d0cb0289 src: fix cardreader thread synchronization
- Make sure while handling AsyncResult in HandleReaderStatusChange
  (JS thread), the AsyncResult is not overwritten in HandlerFunction
  (SCardGetStatusChange thread).
2015-09-26 14:32:02 +02:00
Santiago Gimeno
1ca9670420 src: fix sign-compare warnings in OSX
- Cast SCARD_E_TIMEOUT and SCARD_E_NO_READERS_AVAILABLE to LONG

PR-URL: https://github.com/santigimeno/node-pcsclite/pull/44
2015-09-18 07:02:43 +02:00
Santiago Gimeno
83be0bdf61 src: fix snprintf format for OSX
- As LONG is defined as a int32_t in OSX.

PR-URL: https://github.com/santigimeno/node-pcsclite/pull/44
2015-09-18 07:02:38 +02:00
Ludovic Rousseau
1956507f27 pkg: update description to use PC/SC
Since version 0.4.0 of node-pcsclite all systems Linux, Mac OS X and
Windows are supported.
The wrapper is no more limited to pcsclite but to any implementation of
PC/SC.
2015-09-13 14:25:53 +02:00
Santiago Gimeno
e19f31571a Version 0.4.2 2015-09-01 14:52:21 +02:00
Santiago Gimeno
b373413669 src: fix double free crashes
- After upgrading to nan2 the buffers returned in some of the functions were
  being released because of Nan:NewBuffer. See:
  https://github.com/nodejs/nan/blob/master/doc/buffers.md#api_nan_new_buffer
2015-09-01 14:47:23 +02:00
Florian Ramillien
806a6b397c src: set pioRecvPci in SCardTransmit to NULL
- It fixes an error on SCardTransmit for windows: RPC_X_BAD_STUB_DATA / 0x06F7
  and does not affect other platforms.

PR-URL: https://github.com/santigimeno/node-pcsclite/pull/38
Reviewed-By: Ludovic Rousseau <ludovic.rousseau+github@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2015-09-01 14:32:47 +02:00
Santiago Gimeno
52a22bf68b Version 0.4.1 2015-08-12 12:13:38 +02:00
Santiago Gimeno
9faa4fccb5 pkg: update engine with supported node versions 2015-08-12 12:13:26 +02:00
Santiago Gimeno
37b557fe56 src: upgrade to nan@2.x.x
- To support nodejs/iojs@3.x.x
2015-08-12 12:07:51 +02:00
Santiago Gimeno
6b412ec427 Version 0.4.0 2015-05-27 16:10:31 +02:00
Santiago Gimeno
f1a012cdd2 doc: update README.md with supported OS's 2015-05-27 16:09:29 +02:00
Fozi
399d837ae8 src: Windows compile fixes 2015-05-27 16:09:29 +02:00
Fozi
c8425ceb8a src: implement error_msg for Windows 2015-05-27 16:09:29 +02:00
Santiago Gimeno
1a3c7dec1c src: multiple Windows fixes
- Cross platform implementations of sleep and snprintf.
2015-05-27 16:09:29 +02:00
Santiago Gimeno
0c5e07e0e5 src: migrate pthreads to uv_threads
- So it can be compatible in every platform supported by libuv.
- Use attached threads instead of detached.
- Remove all CardReader 'status' listeners before emitting the
  'end' event.
2015-05-27 16:09:29 +02:00
Santiago Gimeno
da61bae08a src: add SCARD_EJECT_CARD definition
- And remove duplicated SCARD_STATE_CHANGED definition.
2015-05-27 16:08:52 +02:00
mifi
e387cc0edc doc: fix example from README 2015-02-02 17:11:45 +01:00
Santiago Gimeno
980ec45bb5 Version 0.3.6 2015-01-19 10:07:35 +01:00
Santiago Gimeno
86083a3ad0 src: LONG should be converted to v8::Number 2015-01-16 16:21:38 +01:00
Santiago Gimeno
47f443bbf9 Version 0.3.5 2014-11-06 10:59:14 +01:00
Santiago Gimeno
b2513ff119 src: add unistd.h to fix sleep compilation error
- Fix a couple of warnings.
2014-11-06 10:58:24 +01:00
The Gitter Badger
bbe2a1a285 Added Gitter badge 2014-10-15 08:18:12 +00:00
Santiago Gimeno
67714c42c9 Version 0.3.4 2014-10-07 13:12:15 +02:00
Santiago Gimeno
ab882a6975 src: expose CardReader SCARDHANDLE
- In case other C++ addons need access to it.
2014-10-07 13:10:25 +02:00
Santiago Gimeno
d7dfb805a8 doc: document PCSCLite::close, CardReader::close
- Update example accordingly.
2014-09-26 13:14:51 +02:00
Santiago Gimeno
c5602733a4 src: fix PCSCLite.close() for OS X 2014-09-26 13:14:51 +02:00
Santiago Gimeno
674df70a74 Merge pull request #19 from LudovicRousseau/fixes
example: Made the script directly executable
2014-09-25 09:41:30 +02:00
Ludovic Rousseau
266fdfa48f example: Made the script directly executable
Use a #! to start node on the script
2014-09-24 20:59:41 +02:00
Santiago Gimeno
44b0c3e479 example: connect with SHARED share_mode
- This way the example works both in Linux and OS X. See:
  https://github.com/santigimeno/node-pcsclite/issues/14#issuecomment-56665208
2014-09-24 16:15:11 +02:00
Santiago Gimeno
921da53559 Version 0.3.3 2014-09-23 18:36:38 +02:00
Santiago Gimeno
5b10f8519c src: fix for OSs not supporting PnP Notification
- Instead of waiting for the notification, it will poll every second for a new
  card reader.
- Thanks to Ludovic Rousseau for the help. See:
  https://github.com/santigimeno/node-pcsclite/issues/14
2014-09-23 18:35:58 +02:00
Santiago Gimeno
f85250beb0 src: add error_msg to create pretty pcsc errors 2014-09-23 18:31:58 +02:00
Santiago Gimeno
ec0b79562c src: establish context on PCSCLite constructor
- Remove SCardEstablishContext from get_card_readers.
- Initialize m_status_thread to NULL so calling PCSCLite destructor does not
  crash in case the thread has not been launched. For example when
  SCardEstablish context fails
- Thanks to Ludovic Rousseau for pointing that out @
  https://github.com/santigimeno/node-pcsclite/pull/15#issuecomment-56222251.
2014-09-23 18:31:15 +02:00
Santiago Gimeno
2909f5e127 src: return after throwing an exception 2014-09-23 11:32:36 +02:00
Santiago Gimeno
dbc0431295 example: fix connect callback log 2014-09-22 12:50:02 +02:00
Santiago Gimeno
246cbcc7ee Version 0.3.2 2014-09-19 11:22:18 +02:00
Santiago Gimeno
d00d7adb12 doc: add node installation instructions 2014-09-19 11:21:34 +02:00
Santiago Gimeno
bec0c491df tests: adapt test to newer functions signatures
- Specifically _connect and _disconnect.
2014-09-19 11:03:28 +02:00
Santiago Gimeno
b9afcfe74b src: fix typo 2014-09-19 11:03:18 +02:00
Santiago Gimeno
00404f4402 Version 0.3.1 2014-09-12 14:13:08 +02:00
Santiago Gimeno
2693556591 src: fix linux error and a warning 2014-09-11 16:49:22 +02:00
Santiago Gimeno
44a89dbbf6 src: fix OS X compilation issues 2014-09-11 07:32:20 -07:00
Santiago Gimeno
bf15e2eaf1 src: use predefined pcsclite types 2014-09-11 06:48:35 -07:00
Eric Chaves
bd2bf70739 added plataform conditions to binding.gyp\nfixed winsdcard.h references on apple platform 2014-08-25 21:48:27 -03:00
Santiago Gimeno
f6978a685d doc: fix copy/paste typo 2014-08-06 12:47:51 +02:00
Santiago Gimeno
9fe4b23d9c Version 0.3.0 2014-08-06 12:07:11 +02:00
Santiago Gimeno
3c8b2c9f4b src: add disposition parameter to disconnect 2014-08-06 12:06:17 +02:00