arekinath / erlang-pcsc Goto Github PK
View Code? Open in Web Editor NEWlibpcsc NIF binding for erlang
License: Other
libpcsc NIF binding for erlang
License: Other
When no smart card reader is connected I get (using rebar3 shell
):
$ rebar3 shell
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling blog
Erlang/OTP 24 [erts-12.3.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]
Eshell V12.3.1 (abort with ^G)
1> ===> Booted syntax_tools
===> Booted compiler
===> Booted goldrush
===> Booted lager
===> Booted pcsc
===> Booted blog
16:51:31.667 [warning] got pcsc_reader_error: {error,{pcsc_error,-2146435026,no_readers,"Cannot find a smart card reader."}}; restarted ok
16:51:31.721 [warning] got pcsc_reader_error: {error,{pcsc_error,-2146435026,no_readers,"Cannot find a smart card reader."}}; restarted ok
16:51:31.775 [warning] got pcsc_reader_error: {error,{pcsc_error,-2146435026,no_readers,"Cannot find a smart card reader."}}; restarted ok
16:51:31.831 [warning] got pcsc_reader_error: {error,{pcsc_error,-2146435026,no_readers,"Cannot find a smart card reader."}}; restarted ok
16:51:31.887 [warning] got pcsc_reader_error: {error,{pcsc_error,-2146435026,no_readers,"Cannot find a smart card reader."}}; restarted ok
16:51:31.945 [warning] got pcsc_reader_error: {error,{pcsc_error,-2146435026,no_readers,"Cannot find a smart card reader."}}; restarted ok
16:51:32.008 [warning] got pcsc_reader_error: {error,{pcsc_error,-2146435026,no_readers,"Cannot find a smart card reader."}}; restarted ok
Error -2146435026 is SCARD_E_NO_READERS_AVAILABLE and is not really an error.
If I connect a smart card reader the warning/error is no more present, as expected.
Maybe you should filter this error that is not really an error and do not log the warning message?
I'm trying to compile this NIF and it's throwing the error that
fatal error: wintypes.h: No such file or directory
43 | #include <wintypes.h>
| ^~~~~~~~~~~~
I already have libpcsclite-dev installed in my system but it's in /usr/includes/PCSC anyway for me to add this folder to the includes for the compile?
when there is no pcscd
is running to connect to (or whenever SCardEstablishContext(...)
in pcsc_nif_new_context(...)
returns something other than SCARD_S_SUCCESS
), the enif_release_resource(ctx)
call will lead to pcsc_nif_ctx_dtor()
being run.
Since the ctx->pnc_mtx
has not been created yet, trying to lock it does crash the beam vm:
Fatal error in erl_drv_mutex_lock(): Invalid argument [22]
Abort trap (core dumped)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.