public interface MSRTrackData
MSRTrackData
interface represents the data object of a track from a Magnetic Stripe Reader (MSR) device.
This interface provides methods to retrieve raw track data and error information specific to individual tracks.Modifier and Type | Field and Description |
---|---|
static int |
LRC_ERROR
Error constant indicating an LRC (Longitudinal Redundancy Check) error detected in the track data.
|
static int |
NO_DATA
Error constant indicating that no track data was found, only sentinel characters were present.
|
static int |
NO_ERROR
Error constant indicating that no errors were encountered during the track reading process.
|
static int |
NO_STRIPE
Represents an error where no encoded track signal is detected on the magnetic stripe.
|
static int |
NON_SPECIFIC_ERROR
Error constant indicating a non-specific error encountered during the track reading process.
|
static int |
PARITY_ERROR
Error constant indicating a parity error detected in one or more characters of the track data.
|
static int |
READ_ERROR
Error constant indicating that a read error occurred due to one or more invalid or corrupt characters in the track data.
|
static int |
TRACK_NO_0
Track number 0.
|
static int |
TRACK_NO_1
Track number 1.
|
static int |
TRACK_NO_2
Track number 2.
|
static int |
TRACK_NOT_SUPPORTED
Error constant indicating that the MSR could not read the track because it is not supported by the reader.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getTrackData(int trackNo)
Retrieves a buffer containing the raw data read from a specified track.
|
int |
getTrackError(int trackNo)
Returns the error status for a specific track.
|
static final int TRACK_NO_0
static final int TRACK_NO_1
static final int TRACK_NO_2
static final int NO_ERROR
This error constant is returned by getTrackError()
when the track is read successfully without any errors.
static final int NON_SPECIFIC_ERROR
This error constant is returned by getTrackError()
when a general, unspecified error occurs while reading the track data.
static final int TRACK_NOT_SUPPORTED
This error constant is returned by getTrackError()
when it encounters a track that is not supported by the reader.
static final int READ_ERROR
This error constant is returned by getTrackError()
when such a read error is encountered in the track data.
static final int PARITY_ERROR
This error constant is returned by getTrackError()
when a parity error is detected in the track data.
static final int LRC_ERROR
This error constant is returned by getTrackError()
when an LRC error is encountered during track data reading.
static final int NO_DATA
This error constant is returned by getTrackError()
to indicate the absence of track data.
static final int NO_STRIPE
This error constant is returned by getTrackError()
when it encounters such a scenario.
byte[] getTrackData(int trackNo)
References: ISO 7811-2 and JIS X 6302.
Track 1 (ISO and JIS Type I cards): - ISO format: Up to 79 bytes of 6-bit alphanumeric characters. Start sentinel 0x05, end sentinel (before LRC) 0x1F. - JIS Type I (Format A, B, C): Similar to ISO Track 1 with the same character set, sentinels, and character limit. Format C (similar to JIS II) has up to 72 bytes of 7-bit characters with 0x7F as start and end sentinels.
Track 2 (ISO and JIS Type I cards): - Up to 40 bytes of 4-bit numeric characters. Begins with 0x0B, ends with 0x0F before the LRC.
Track 3 (ISO and JIS Type I cards): - ISO format: Up to 107 bytes of 4-bit numeric characters, including control characters and an LRC. - JIS Type I: May have the same format as ISO Track 3 or as Track 1 Format C (JIS II card format).
int getTrackError(int trackNo)
trackNo
- The track number for which to retrieve the error status.NO_ERROR
,
NON_SPECIFIC_ERROR
,
TRACK_NOT_SUPPORTED
,
READ_ERROR
,
PARITY_ERROR
,
LRC_ERROR
,
NO_DATA
,
NO_STRIPE