FreeCalypso > hg > fc-pcsc-tools
diff simtool/miscadm.c @ 183:2545dd27ca38
fc-simtool write-imsi-sh command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 06 Mar 2021 05:24:26 +0000 |
parents | f4edccd4b583 |
children | 9797417ececa |
line wrap: on
line diff
--- a/simtool/miscadm.c Sat Mar 06 05:07:46 2021 +0000 +++ b/simtool/miscadm.c Sat Mar 06 05:24:26 2021 +0000 @@ -120,3 +120,18 @@ pack_reversed_nibbles(nibbles, binrec + 1, 8); return write_imsi_bin(binrec); } + +cmd_write_imsi_sh(argc, argv) + char **argv; +{ + int rc; + u_char nibbles[16], binrec[9]; + + rc = parse_decimal_shorthand(argv[1], nibbles + 1, 15); + if (rc < 0) + return(rc); + nibbles[0] = 9; + binrec[0] = 8; + pack_reversed_nibbles(nibbles, binrec + 1, 8); + return write_imsi_bin(binrec); +}