Revision d7f18920
Added by osmith about 4 years ago
sim-applet/src/org/osmocom/IMSIPseudo/IMSIPseudo.java | ||
---|---|---|
91 | 91 |
return; |
92 | 92 |
} |
93 | 93 |
|
94 |
private void showError(short code) { |
|
95 |
byte[] msg = new byte[] {'E', '?', '?'}; |
|
96 |
msg[1] = (byte)('0' + code / 10); |
|
97 |
msg[2] = (byte)('0' + code % 10); |
|
98 |
showMsg(msg); |
|
99 |
} |
|
100 |
|
|
94 | 101 |
private void showIMSI() { |
95 | 102 |
/* 3GPP TS 31.102 4.2.2: IMSI */ |
96 | 103 |
byte[] IMSI = new byte[9]; |
... | ... | |
99 | 106 |
|
100 | 107 |
gsmFile.select((short) SIMView.FID_DF_GSM); |
101 | 108 |
gsmFile.select((short) SIMView.FID_EF_IMSI); |
102 |
gsmFile.readBinary((short)0, IMSI, (short)0, (short)9); |
|
109 |
|
|
110 |
try { |
|
111 |
gsmFile.readBinary((short)0, IMSI, (short)0, (short)9); |
|
112 |
} catch (SIMViewException e) { |
|
113 |
showError(e.getReason()); |
|
114 |
} |
|
103 | 115 |
|
104 | 116 |
for (byte i = (byte)0; i < (byte)15; i++) { |
105 | 117 |
byte msg_i = (byte)(14 + i); |
... | ... | |
110 | 122 |
} else { |
111 | 123 |
msg[msg_i] = (byte)('0' + (IMSI[i / (byte)2] >>> 4)); |
112 | 124 |
} |
125 |
showMsg(msg); /* DEBUG */ |
|
113 | 126 |
} |
114 | 127 |
showMsg(msg); |
115 | 128 |
} |
Also available in: Unified diff
IMSIPseudo.java: show exception error code
Current code gives E03 (AC_NOT_FULFILLED). The error codes are explained
in TS_101_476/Annex_A_HTML/sim/access/SIMViewException.html.