"use strict";

// #############
// Logs cards' uid
// #############

import NFC, { TAG_ISO_14443_3, TAG_ISO_14443_4, KEY_TYPE_A, KEY_TYPE_B } from '../src/NFC';


const nfc = new NFC();

nfc.on('reader', reader => {


	reader.on('card', card => {
		console.log(card.uid);
	});

	reader.on('error', err => {
		console.error(err);
	});

	reader.on('end', () => {

	});


});

nfc.on('error', err => {
	console.error(err);
});

@@ -76,70 +76,8 @@
  NFC
-, %7B TAG_ISO_14443_3, TAG_ISO_14443_4, KEY_TYPE_A, KEY_TYPE_B %7D
  fro
@@ -148,16 +148,87 @@
 r =%3E %7B%0A%0A
+%09console.log(reader.name + ' reader attached, waiting for cards ...');%0A
 %0A%09reader
@@ -321,24 +321,40 @@
 nsole.error(
+'reader error', 
 err);%0A%09%7D);%0A%0A
@@ -379,16 +379,69 @@
 () =%3E %7B%0A
+%09%09console.log(reader.name + ' reader disconnected.');
 %0A%09%7D);%0A%0A%0A

Improve uid-logger example