Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card returning empty Buffer #54

Open
Egnus opened this issue Feb 29, 2016 · 2 comments
Open

Card returning empty Buffer #54

Egnus opened this issue Feb 29, 2016 · 2 comments

Comments

@Egnus
Copy link

Egnus commented Feb 29, 2016

Basically this is the example code i have used, other examples gives me the same result at the end.

`#!/usr/bin/env node
var pcsc = require('./lib/pcsclite');
var pcsc = pcsc();
pcsc.on('reader', function(reader) {

function exit() {
    reader.close();
    pcsc.close();
}

cmd_select = new Buffer([0x00, 0xA4, 0x04, 0x00, 0x0A, 0xA0, 0x00, 0x00, 0x00, 0x62, 0x03, 0x01, 0x0C, 0x06, 0x01]);
cmd_command = new Buffer([0x00, 0x00, 0x00, 0x00]);

console.log('Using:', reader.name);

reader.connect(function(err, protocol) {
    if (err) {
        console.log(err);
        return exit();
    }
    reader.transmit(cmd_select, 255, protocol, function(err, data) {
        if (err) {
            console.log(err);
            return exit();
        }
        console.log('Data received', data);
        reader.transmit(cmd_command, 255, protocol, function(err, data) {
            if (err) {
                console.log(err);
            } else {
                console.log('Data received', data);
                console.log('Data received', data.toString());

            }
            return exit();
        });
    });
});
});

pcsc.on('error', function(err) {
  console.log('PCSC error', err.message);
});`

But no matter which card i used it gives the same response (Mifare Ultralight and Mifare 1k classic)

Using: ACS ACR122 0
Data received < Buffer >
Data received < Buffer >
Data received

I have not idea what is going on with this.
Im using Windows 10, everything seems to be builded successfully.

@LudovicRousseau
Copy link
Contributor

Try to use SCardSpy to log the PC/SC commands and possible errors
https://www.idrix.fr/Root/content/category/7/25/46/

@jsmrcaga
Copy link

jsmrcaga commented Apr 5, 2016

I'm having an empty buffer retuned when trying to get a FAST_READ from a card. I'm using the command: [0xFF, 0x3A, 0x04, 0x0F] (read from page 4 to 15) from this ref (page 26).

Are there any known records of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants