FreeCalypso > hg > fc-pcsc-tools
comparison uicc/hlread.c @ 56:d4b5a6e547ca
fc-uicc-tool iccid command: same change as in fc-simtool
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 13 Feb 2021 19:45:04 +0000 |
parents | 1b1468869ccf |
children | ede661d78730 |
comparison
equal
deleted
inserted
replaced
55:4c570522de5d | 56:d4b5a6e547ca |
---|---|
9 | 9 |
10 cmd_iccid() | 10 cmd_iccid() |
11 { | 11 { |
12 int rc; | 12 int rc; |
13 unsigned len; | 13 unsigned len; |
14 char buf[21]; | 14 char buf[21], *cp; |
15 | 15 |
16 rc = select_op(FILEID_MF); | 16 rc = select_op(FILEID_MF); |
17 if (rc < 0) | 17 if (rc < 0) |
18 return(rc); | 18 return(rc); |
19 rc = select_op(EF_ICCID); | 19 rc = select_op(EF_ICCID); |
28 } | 28 } |
29 rc = readbin_op(0, 10); | 29 rc = readbin_op(0, 10); |
30 if (rc < 0) | 30 if (rc < 0) |
31 return(rc); | 31 return(rc); |
32 decode_reversed_nibbles(sim_resp_data, 10, buf); | 32 decode_reversed_nibbles(sim_resp_data, 10, buf); |
33 buf[20] = '\0'; | 33 for (cp = buf + 20; (cp > buf + 1) && (cp[-1] == 'F'); cp--) |
34 ; | |
35 *cp = '\0'; | |
34 printf("%s\n", buf); | 36 printf("%s\n", buf); |
35 return(0); | 37 return(0); |
36 } | 38 } |