FileDocCategorySizeDatePackage
NfcV.javaAPI DocAndroid 5.1 API4194Thu Mar 12 22:22:10 GMT 2015android.nfc.tech

NfcV

public final class NfcV extends BasicTagTechnology
Provides access to NFC-V (ISO 15693) properties and I/O operations on a {@link Tag}.

Acquire a {@link NfcV} object using {@link #get}.

The primary NFC-V I/O operation is {@link #transceive}. Applications must implement their own protocol stack on top of {@link #transceive}.

Note: Methods that perform I/O operations require the {@link android.Manifest.permission#NFC} permission.

Fields Summary
public static final String
EXTRA_RESP_FLAGS
public static final String
EXTRA_DSFID
private byte
mRespFlags
private byte
mDsfId
Constructors Summary
public NfcV(android.nfc.Tag tag)

hide

        super(tag, TagTechnology.NFC_V);
        Bundle extras = tag.getTechExtras(TagTechnology.NFC_V);
        mRespFlags = extras.getByte(EXTRA_RESP_FLAGS);
        mDsfId = extras.getByte(EXTRA_DSFID);
    
Methods Summary
public static android.nfc.tech.NfcVget(android.nfc.Tag tag)
Get an instance of {@link NfcV} for the given tag.

Returns null if {@link NfcV} was not enumerated in {@link Tag#getTechList}. This indicates the tag does not support NFC-V.

Does not cause any RF activity and does not block.

param
tag an NFC-V compatible tag
return
NFC-V object


                                                         
         
        if (!tag.hasTech(TagTechnology.NFC_V)) return null;
        try {
            return new NfcV(tag);
        } catch (RemoteException e) {
            return null;
        }
    
public bytegetDsfId()
Return the DSF ID bytes from tag discovery.

Does not cause any RF activity and does not block.

return
DSF ID bytes

        return mDsfId;
    
public intgetMaxTransceiveLength()
Return the maximum number of bytes that can be sent with {@link #transceive}.

return
the maximum number of bytes that can be sent with {@link #transceive}.

        return getMaxTransceiveLengthInternal();
    
public bytegetResponseFlags()
Return the Response Flag bytes from tag discovery.

Does not cause any RF activity and does not block.

return
Response Flag bytes

        return mRespFlags;
    
public byte[]transceive(byte[] data)
Send raw NFC-V commands to the tag and receive the response.

Applications must not append the CRC to the payload, it will be automatically calculated. The application does provide FLAGS, CMD and PARAMETER bytes.

Use {@link #getMaxTransceiveLength} to retrieve the maximum amount of bytes that can be sent with {@link #transceive}.

This is an I/O operation and will block until complete. It must not be called from the main application thread. A blocked call will be canceled with {@link IOException} if {@link #close} is called from another thread.

Requires the {@link android.Manifest.permission#NFC} permission.

param
data bytes to send
return
bytes received in response
throws
TagLostException if the tag leaves the field
throws
IOException if there is an I/O failure, or this operation is canceled

        return transceive(data, true);