Skip to content

Commit

Permalink
Support for logical channels
Browse files Browse the repository at this point in the history
  • Loading branch information
koh-osug committed Jan 16, 2019
1 parent ac1572f commit 82e79aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ public int transmit(ByteBuffer byteBuffer, ByteBuffer byteBuffer2) throws CardEx

@Override
public void close() throws CardException {
if (channelNr == 0) {
throw new CardException("Can not close basic channel");
}
}
}

Expand Down Expand Up @@ -191,7 +193,7 @@ public CardChannel getBasicChannel() {

@Override
public CardChannel openLogicalChannel() throws CardException {
throw new CardException("Logical channel not supported");
return new CardChannelImpl(this, 1);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/licel/jcardsim/smartcardio/JCSCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public CardChannel getBasicChannel() {
}

/**
* Always returns basic channel with id = 0
* Always returns logical channel with id = 1
*/
public CardChannel openLogicalChannel() throws CardException {
return basicChannel;
return new JCSCardChannel(this, 1);
}

/**
Expand Down

0 comments on commit 82e79aa

Please sign in to comment.