Package org.robolectric.shadows
Class ShadowIsoDep
- java.lang.Object
-
- org.robolectric.shadows.ShadowBasicTagTechnology
-
- org.robolectric.shadows.ShadowIsoDep
-
@Implements(android.nfc.tech.IsoDep.class) public class ShadowIsoDep extends ShadowBasicTagTechnology
Extends IsoDep to allow for testing.Control the allowed packet size with
setExtendedLengthApduSupported(boolean)
andsetMaxTransceiveLength(int)
. Note that extended Apdu packets have a max transceive length of 0x10008 but most hardware implementations will have a lower limit. If extended length apdus are not supported, the theoretical max transceive length is 0x105 but, again, may be lower in practice.Dictate the Apdu response returned in
transceive(byte[])
viasetTransceiveResponse(byte[])
orsetNextTransceiveResponse(byte[])
. The former will be returned with every call to transceive while the later will be returned only once. If neither is set, transceive will throw an IOException.
-
-
Constructor Summary
Constructors Constructor Description ShadowIsoDep()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
__constructor__(Tag tag)
protected int
getMaxTransceiveLength()
protected int
getTimeout()
protected boolean
isExtendedLengthApduSupported()
static IsoDep
newInstance()
void
setExtendedLengthApduSupported(boolean supported)
void
setMaxTransceiveLength(int length)
void
setNextTransceiveResponse(byte[] response)
protected void
setTimeout(int timeoutMillis)
void
setTransceiveResponse(byte[] response)
protected byte[]
transceive(byte[] data)
-
Methods inherited from class org.robolectric.shadows.ShadowBasicTagTechnology
close, connect, isConnected
-
-
-
-
Method Detail
-
newInstance
public static IsoDep newInstance()
-
__constructor__
@Implementation protected void __constructor__(Tag tag)
-
transceive
@Implementation protected byte[] transceive(byte[] data) throws IOException
- Throws:
IOException
-
setTransceiveResponse
public void setTransceiveResponse(byte[] response)
-
setNextTransceiveResponse
public void setNextTransceiveResponse(byte[] response)
-
setTimeout
@Implementation protected void setTimeout(int timeoutMillis)
-
getTimeout
@Implementation protected int getTimeout()
-
getMaxTransceiveLength
@Implementation protected int getMaxTransceiveLength()
-
setMaxTransceiveLength
public void setMaxTransceiveLength(int length)
-
isExtendedLengthApduSupported
@Implementation protected boolean isExtendedLengthApduSupported()
-
setExtendedLengthApduSupported
public void setExtendedLengthApduSupported(boolean supported)
-
-