public abstract class TrackData
extends java.lang.Object
TrackData
class represents the track data after swiping a
card from the reader.Modifier and Type | Field and Description |
---|---|
static int |
BATTERY_STATUS_FULL
Battery is full.
|
static int |
BATTERY_STATUS_LOW
Battery is low.
|
protected int |
mBatteryStatus
Battery status.
|
protected int |
mTrack1ErrorCode
Track 1 error code.
|
protected int |
mTrack1Length
Track 1 length.
|
protected int |
mTrack2ErrorCode
Track 2 error code.
|
protected int |
mTrack2Length
Track 2 length.
|
static int |
TRACK_ERROR_ES
Missing or invalid end sentinel on the track.
|
static int |
TRACK_ERROR_LRC
Missing or invalid checksum on the track.
|
static int |
TRACK_ERROR_PARITY
Missing or invalid parity on the track.
|
static int |
TRACK_ERROR_SS
Missing or invalid start sentinel on the track.
|
static int |
TRACK_ERROR_SUCCESS
Success.
|
Constructor and Description |
---|
TrackData()
Creates an instance of
TrackData . |
TrackData(byte[] buffer)
Initializes the track data from the byte array.
|
TrackData(byte[] buffer,
int offset,
int byteCount)
Initializes the track data from the byte array.
|
Modifier and Type | Method and Description |
---|---|
void |
fromByteArray(byte[] buffer)
Initializes the track data from the byte array.
|
abstract void |
fromByteArray(byte[] buffer,
int offset,
int byteCount)
Initializes the track data from the byte array.
|
int |
getBatteryStatus()
Gets the battery status.
|
int |
getTrack1ErrorCode()
Gets the track 1 error code.
|
int |
getTrack1Length()
Gets the track 1 length.
|
int |
getTrack2ErrorCode()
Gets the track 2 error code.
|
int |
getTrack2Length()
Gets the track 2 length.
|
public static final int BATTERY_STATUS_LOW
public static final int BATTERY_STATUS_FULL
public static final int TRACK_ERROR_SUCCESS
public static final int TRACK_ERROR_SS
public static final int TRACK_ERROR_ES
public static final int TRACK_ERROR_LRC
public static final int TRACK_ERROR_PARITY
protected int mBatteryStatus
protected int mTrack1Length
protected int mTrack1ErrorCode
protected int mTrack2Length
protected int mTrack2ErrorCode
public TrackData()
TrackData
.public TrackData(byte[] buffer)
buffer
- the buffer.public TrackData(byte[] buffer, int offset, int byteCount)
buffer
- the buffer.offset
- the offset.byteCount
- the number of bytes.public void fromByteArray(byte[] buffer)
buffer
- the buffer.public abstract void fromByteArray(byte[] buffer, int offset, int byteCount)
buffer
- the buffer.offset
- the offset.byteCount
- the number of bytes.public int getBatteryStatus()
BATTERY_STATUS_LOW
and
BATTERY_STATUS_FULL
.public int getTrack1Length()
public int getTrack1ErrorCode()
TRACK_ERROR_SUCCESS
,
TRACK_ERROR_SS
, TRACK_ERROR_ES
and
TRACK_ERROR_LRC
.public int getTrack2Length()
public int getTrack2ErrorCode()
TRACK_ERROR_SUCCESS
,
TRACK_ERROR_SS
, TRACK_ERROR_ES
and
TRACK_ERROR_LRC
.Copyright © 2013-2018, Advanced Card Systems Ltd. All rights reserved.