libnfc-d

git clone git://xatko.vsos.ethz.ch/libnfc-d.git
Log | Files | Refs

main.d (386B)


      1 import nfc;
      2 import std.stdio;
      3 
      4 void main(){
      5 	ubyte[] a = null;
      6 	writeln(a[0..0]);
      7 	
      8 	writeln("libnfc version ", nfcVersion());
      9 	
     10 	Context c=new Context();
     11 	
     12 	auto d = c.open();
     13 	d.init();
     14 	
     15 	writeln("Device name: ", d.name);
     16 	
     17 	Target t;
     18 	t.baud = t.Baud.B106;
     19 	auto params = &t.ISO14443A();
     20 	
     21 	d.selectPassive(t);
     22 	writeln("The following ISO14443A tag was found: ", t.toString());
     23 	
     24 }