public class SAM
extends java.lang.Object
Example Usage: List<SAM> connectedSAMList = samManager.enumerateSAMs(); SAM sam = connectedSAMList.get(0); SAMType samType = sam.getSamType(); SAMType SAMStatus = sam.getSamStatus(); sam.connect(); sam.transceive(byte[],short,boolean); sam.disconnect();
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connects to the SAM.
|
void |
disconnect()
Disconnects from SAM.
|
int |
getSamIndex()
This method will return the slot index of the SAM.
|
SAMType |
getSamType()
This method will return the type of the SAM (i.e MIFARE, CALYPSO, FELICA)
|
boolean |
isConnected()
This method will return the current SAM status whether the SAM is connected or not.
|
byte[] |
transceive(byte[] apdu,
short responseLength,
boolean userFormattedProtocolFrame)
The method will be used to send the APDUs to the SAM.
|
public void connect() throws SAMException
Example Usage: sam.connect();
SAMException
- The exception will thrown if the connection to the SAM fails.public void disconnect()
Example Usage: sam.disconnect();
public byte[] transceive(byte[] apdu, short responseLength, boolean userFormattedProtocolFrame) throws SAMException
Example Usage: sam.transceive(byte[],short,boolean);
apdu
- Command APDUresponseLength
- Length of expected response. Pass this parameter as 0, when expected response length is unknown while calling this API.userFormattedProtocolFrame
- This parameter applicable for only T1 protocol. Typically user will provide this parameter as false. true: User provides frame header, Command APDU (C-APDU) and trailer. false: User provides only Command APDU (C-APDU). Typically user will provide this parameter as false.SAMException
- Exception will be thrown if any error occurs while executing transceive callpublic boolean isConnected()
public SAMType getSamType()
public int getSamIndex()