Skip to content

Commit

Permalink
DummyTerminal.java: internalOpenLogicalChannel(aid) throws NoSuchElem…
Browse files Browse the repository at this point in the history
…entException if selection of ACA is attempted
  • Loading branch information
[email protected] committed May 22, 2012
1 parent f26927a commit 8adb024
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package org.simalliance.openmobileapi.service.terminals.SamplePluginTerminal;

import java.util.Arrays;
import java.util.NoSuchElementException;

import android.content.Context;
import android.util.Log;


public class DummyTerminal {

private static final String LOG_TAG = "SamplePluginTerminal";

static final byte[] AID_ACA = {(byte)0xd2, (byte)0x76, (byte)0x00, (byte)0x01, (byte)0x18, (byte)0xaa, (byte)0xff, (byte)0xff, (byte)0x49, (byte)0x10, (byte)0x48, (byte)0x89, (byte)0x01};

private int channelNr = 0x00;

Expand Down Expand Up @@ -58,6 +63,8 @@ public int internalOpenLogicalChannel() {

public int internalOpenLogicalChannel(byte[] aid) {
Log.v(LOG_TAG, "internalOpenLogicalChannel: " + bytesToString(aid));
if (Arrays.equals(aid, AID_ACA))
throw new NoSuchElementException("ACA not available");
return ++channelNr;
}

Expand Down

0 comments on commit 8adb024

Please sign in to comment.