PollingFrame


public final class PollingFrame
extends Object implements Parcelable

java.lang.Object
   ↳ android.nfc.cardemulation.PollingFrame


Polling Frames represent data about individual frames of an NFC polling loop. These frames will be deliverd to subclasses of HostApduService that have registered filters with ERROR(CardEmulation#registerPollingLoopFilterForService(ComponentName, String)/android.nfc.cardemulation.CardEmulation#registerPollingLoopFilterForService(android.content.ComponentName,java.lang.String) CardEmulation#registerPollingLoopFilterForService(ComponentName, String)) that match a given frame in a loop and will be delivered through calls to HostApduService#processPollingFrames(List).

Summary

Constants

int POLLING_LOOP_TYPE_A

POLLING_LOOP_TYPE_A is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop is for NFC-A.

int POLLING_LOOP_TYPE_B

POLLING_LOOP_TYPE_B is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop is for NFC-B.

int POLLING_LOOP_TYPE_F

POLLING_LOOP_TYPE_F is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop is for NFC-F.

int POLLING_LOOP_TYPE_OFF

POLLING_LOOP_TYPE_OFF is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop turns off.

int POLLING_LOOP_TYPE_ON

POLLING_LOOP_TYPE_ON is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop turns on.

int POLLING_LOOP_TYPE_UNKNOWN

POLLING_LOOP_TYPE_UNKNOWN is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop frame isn't recognized.

Inherited constants

Fields

public static final Creator<PollingFrame> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

byte[] getData()

Returns the raw data from the polling type frame.

long getTimestamp()

Returns the timestamp of when the polling loop frame was observed in milliseconds.

boolean getTriggeredAutoTransact()

Returns whether this frame triggered the device to automatically disable observe mode and allow one transaction.

int getType()

Returns the type of frame for this polling loop frame.

int getVendorSpecificGain()

Returns the gain representing the field strength of the NFC field when this polling loop frame was observed.

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

POLLING_LOOP_TYPE_A

public static final int POLLING_LOOP_TYPE_A

POLLING_LOOP_TYPE_A is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop is for NFC-A.

Constant Value: 65 (0x00000041)

POLLING_LOOP_TYPE_B

public static final int POLLING_LOOP_TYPE_B

POLLING_LOOP_TYPE_B is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop is for NFC-B.

Constant Value: 66 (0x00000042)

POLLING_LOOP_TYPE_F

public static final int POLLING_LOOP_TYPE_F

POLLING_LOOP_TYPE_F is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop is for NFC-F.

Constant Value: 70 (0x00000046)

POLLING_LOOP_TYPE_OFF

public static final int POLLING_LOOP_TYPE_OFF

POLLING_LOOP_TYPE_OFF is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop turns off.

Constant Value: 88 (0x00000058)

POLLING_LOOP_TYPE_ON

public static final int POLLING_LOOP_TYPE_ON

POLLING_LOOP_TYPE_ON is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop turns on.

Constant Value: 79 (0x0000004f)

POLLING_LOOP_TYPE_UNKNOWN

public static final int POLLING_LOOP_TYPE_UNKNOWN

POLLING_LOOP_TYPE_UNKNOWN is the value associated with the key POLLING_LOOP_TYPE in the Bundle passed to HostApduService#processPollingFrames(List) when the polling loop frame isn't recognized.

Constant Value: 85 (0x00000055)

Fields

CREATOR

public static final Creator<PollingFrame> CREATOR

Public methods

describeContents

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getData

public byte[] getData ()

Returns the raw data from the polling type frame.

Returns
byte[] This value cannot be null.

getTimestamp

public long getTimestamp ()

Returns the timestamp of when the polling loop frame was observed in milliseconds. These timestamps are relative and not absolute and should only be used for comparing the timing of frames relative to each other.
Value is a non-negative duration in milliseconds.

Returns
long the timestamp in milliseconds Value is a non-negative duration in milliseconds.

getTriggeredAutoTransact

public boolean getTriggeredAutoTransact ()

Returns whether this frame triggered the device to automatically disable observe mode and allow one transaction.

Returns
boolean

getVendorSpecificGain

public int getVendorSpecificGain ()

Returns the gain representing the field strength of the NFC field when this polling loop frame was observed.

Returns
int the gain or -1 if there is no gain measurement associated with this frame.

toString

public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES