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

Empty Data #136

Open
cfontana0 opened this issue Nov 16, 2022 · 0 comments
Open

Empty Data #136

cfontana0 opened this issue Nov 16, 2022 · 0 comments

Comments

@cfontana0
Copy link

Hey folks!
I'm trying to use the HCE feature on Android to transmit data from the phone to an ACR122 reader.
I was able to read the sent information from the Android phone with another phone, so, that means that it's transmitting correctly.
However, when I try to read the information using the ACR122 reader, I receive this as a data: {"type":"Buffer","data":[]}.

Any idea?

I'm running the following code:

const { NFC } = require('nfc-pcsc');
const nfc = new NFC(); // optionally you can pass logger

nfc.on('reader', reader => {
	console.log(`${reader.reader.name}  device attached`);
	reader.aid = 'D2760000850101'; // I got this from the app

	reader.on('card', card => {
		console.log(`${reader.reader.name}  card detected`, card);
		console.log("card.data: ", JSON.stringify(card.data));
	});

	reader.on('error', err => {
		console.log(`${reader.reader.name}  an error occurred`, err);
	});

	reader.on('end', () => {
		console.log(`${reader.reader.name}  device removed`);
	});

	reader.on('status', async status => {
		console.log('status ', status)
	});
});

nfc.on('error', err => {
	console.log('an error occurred', err);
});
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

1 participant