acr122u: fixes escape ioctl under linux & make it OS-dependent, to be tested on other OSes!
This commit is contained in:
parent
d75e25d29d
commit
69fba08661
1 changed files with 13 additions and 3 deletions
|
@ -37,15 +37,25 @@
|
||||||
// Bus
|
// Bus
|
||||||
#include <winscard.h>
|
#include <winscard.h>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
// XXX: Some review from users cross-compiling is welcome!
|
||||||
|
#if defined (_WIN32)
|
||||||
|
# define IOCTL_CCID_ESCAPE_SCARD_CTL_CODE SCARD_CTL_CODE(3500)
|
||||||
|
#elif defined(__APPLE__)
|
||||||
# include <wintypes.h>
|
# include <wintypes.h>
|
||||||
|
# define IOCTL_CCID_ESCAPE_SCARD_CTL_CODE (((0x31) << 16) | ((3500) << 2))
|
||||||
|
#elif defined (__FreeBSD__) || defined (__OpenBSD__)
|
||||||
|
# define IOCTL_CCID_ESCAPE_SCARD_CTL_CODE (((0x31) << 16) | ((3500) << 2))
|
||||||
|
#elif defined (__linux__)
|
||||||
|
# include <reader.h>
|
||||||
|
// Escape IOCTL tested successfully:
|
||||||
|
# define IOCTL_CCID_ESCAPE_SCARD_CTL_CODE SCARD_CTL_CODE(1)
|
||||||
|
#else
|
||||||
|
# error "Can't determine serial string for your system"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <nfc/nfc.h>
|
#include <nfc/nfc.h>
|
||||||
#include <nfc/nfc-messages.h>
|
#include <nfc/nfc-messages.h>
|
||||||
|
|
||||||
// WINDOWS: #define IOCTL_CCID_ESCAPE_SCARD_CTL_CODE SCARD_CTL_CODE(3500)
|
|
||||||
#define IOCTL_CCID_ESCAPE_SCARD_CTL_CODE (((0x31) << 16) | ((3500) << 2))
|
|
||||||
#define SCARD_OPERATION_SUCCESS 0x61
|
#define SCARD_OPERATION_SUCCESS 0x61
|
||||||
#define SCARD_OPERATION_ERROR 0x63
|
#define SCARD_OPERATION_ERROR 0x63
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue