Skip to content

Commit

Permalink
small changes ot Card
Browse files Browse the repository at this point in the history
  • Loading branch information
a2800276 committed Nov 26, 2009
1 parent 4b7c4c0 commit 557478f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/java/de/kuriositaet/iso7816/Main.java
@@ -0,0 +1,37 @@
package de.kuriositaet.iso7816;

import de.kuriositaet.iso7816.apdu.SELECT;
import de.kuriositaet.pcsc.Card;

public class Main {
public static void main (String [] args) {

int i = 0;
byte b = (byte)0xff;
i = b;
char c = 0xff;
System.out.println(b);
System.out.println(c);
b = (byte)c;
System.out.println(b);
System.out.println(b < 0 ? b+256 : b);
int j = 200;
System.out.println((byte)i);
}

public void demo () {

// Session ses = new Session();
// ses.add(SELECT);
// ses.add(GET_PO, new POST<GET_PO>(GET_PO getpo) {
// byte [] rec_ids = getpo.getRecordIds();
// getpo.getSession().insertAfter(getpo, new READ_RECORD(rec_ids);
// });

Card c = new Card();
SELECT sel = new SELECT();
byte[] result = c.transmit(sel.getBytes());


}
}
8 changes: 8 additions & 0 deletions src/java/de/kuriositaet/pcsc/Card.java
Expand Up @@ -7,6 +7,10 @@
import com.sun.jna.NativeLong;
import com.sun.jna.ptr.NativeLongByReference;




import de.kuriositaet.iso7816.APDU;
import de.kuriositaet.pcsc.ffi.Constants;
import de.kuriositaet.pcsc.ffi.PCSC_FFI;

Expand Down Expand Up @@ -306,6 +310,10 @@ public byte[] transmit(byte [] bytes) {
return recvBuffer.getByteArray(0, bytesReceived.getValue().intValue());
}

public byte[] transmit(APDU apdu) {
return transmit(apdu.getBytes());
}

public static void main (String [] args) {
Context ctx = null;
Card card = null;
Expand Down

0 comments on commit 557478f

Please sign in to comment.