public class IsoDep
- Object
- TagTechnology
- IsoDep
ISO 14443-4 / ISO 7816-4 technology view: send APDU command-response
pairs to a contactless smart card (EMV payment, ePassport, government
ID, transit). Backed by IsoDep on Android and by NFCISO7816Tag on
iOS.
A typical SELECT-then-READ exchange:
IsoDep iso = tag.getIsoDep();
if (iso == null) {
// tag is not ISO-DEP capable
return;
}
byte[] selectAid = new byte[] {
0x00, (byte) 0xA4, 0x04, 0x00, 0x07,
(byte) 0xA0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10
};
iso.transceive(selectAid).onResult((sw, err) -> {
// last two bytes of sw are the ISO 7816 SW1/SW2 status word
});
All response bytes (including the terminating SW1/SW2 status word) are
returned verbatim. Use [#isSuccess(byte[])] to test for the canonical
90 00 success word without slicing.
Constructors
public IsoDep() |
Methods
public byte[] getHistoricalBytes() | Historical bytes returned during ISO-DEP activation (Android IsoDep.getHistoricalBytes()). |
public int getMaxTransceiveLength() | Largest single transceive payload the underlying transport accepts. |
public boolean isExtendedLengthSupported() | true when this view exchanges extended-length APDUs (Lc / Le up to 65535). |
public final TagType getType() | The technology variant this view represents. |
public static boolean isSuccess(byte[] response) | Returns true when the last two bytes of response are the ISO 7816 success status word (90 00). |
public AsyncResource<byte[]> transceive(byte[] apdu) | Sends the given raw bytes to the tag and resolves with the response. |
Inherited methods
Constructor details
IsoDep
public IsoDep()Method details
getHistoricalBytes
public byte[] getHistoricalBytes()Historical bytes returned during ISO-DEP activation (Android
IsoDep.getHistoricalBytes()). Empty when the platform does not
surface them.getMaxTransceiveLength
public int getMaxTransceiveLength()Largest single transceive payload the underlying transport accepts.
Some Android implementations top out at 253 bytes for short APDU
frames; Core NFC fragments at 256. Use as an upper bound when
chunking large
READ BINARY exchanges.isExtendedLengthSupported
public boolean isExtendedLengthSupported()true when this view exchanges extended-length APDUs (Lc / Le up to
65535). Most Android devices report true; iOS Core NFC reports
false.getType
public final TagType getType()The technology variant this view represents.
isSuccess
public static boolean isSuccess(byte[] response)Returns
true when the last two bytes of response are the ISO
7816 success status word (90 00). Useful as a quick check after
[#transceive(byte[])].transceive
public AsyncResource<byte[]> transceive(byte[] apdu)Sends the given raw bytes to the tag and resolves with the response.
The base class reports
NfcError.UNSUPPORTED_TAG – ports override
per technology.