SimIoResultpublic class SimIoResult extends Object
Fields Summary |
---|
int | sw1 | int | sw2 | byte[] | payload |
Constructors Summary |
---|
public SimIoResult(int sw1, int sw2, byte[] payload)
this.sw1 = sw1;
this.sw2 = sw2;
this.payload = payload;
| public SimIoResult(int sw1, int sw2, String hexString)
this(sw1, sw2, SimUtils.hexStringToBytes(hexString));
|
Methods Summary |
---|
public SimException | getException()Returns exception on error or null if success
if (success()) return null;
switch (sw1) {
case 0x94:
if (sw2 == 0x08) {
return new SimFileTypeMismatch();
} else {
return new SimFileNotFound();
}
default:
return new SimException("sw1:" + sw1 + " sw2:" + sw2);
}
| public boolean | success()true if this operation was successful
See GSM 11.11 Section 9.4
(the fun stuff is absent in 51.011)
return sw1 == 0x90 || sw1 == 0x91 || sw1 == 0x9e || sw1 == 0x9f;
| public java.lang.String | toString()
return "SimIoResponse sw1:0x" + Integer.toHexString(sw1) + " sw2:0x"
+ Integer.toHexString(sw2);
|
|