FreeCalypso > hg > fc-pcsc-tools
comparison simtool/miscadm.c @ 68:105aa3d1a494
fc-simtool write-iccid command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 15 Feb 2021 00:36:56 +0000 |
parents | 3ef90bd13fbe |
children | 63b640562e21 |
comparison
equal
deleted
inserted
replaced
67:9ff7ee99346f | 68:105aa3d1a494 |
---|---|
6 | 6 |
7 #include <sys/types.h> | 7 #include <sys/types.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include "curfile.h" | 9 #include "curfile.h" |
10 #include "file_id.h" | 10 #include "file_id.h" |
11 | |
12 cmd_write_iccid(argc, argv) | |
13 char **argv; | |
14 { | |
15 int rc; | |
16 u_char nibbles[20], binrec[10]; | |
17 | |
18 rc = parse_decimal_string_arg(argv[1], nibbles, 20); | |
19 if (rc < 0) | |
20 return(rc); | |
21 pack_reversed_nibbles(nibbles, binrec, 10); | |
22 rc = select_op(FILEID_MF); | |
23 if (rc < 0) | |
24 return(rc); | |
25 rc = select_op(EF_ICCID); | |
26 if (rc < 0) | |
27 return(rc); | |
28 rc = parse_ef_select_response(); | |
29 if (rc < 0) | |
30 return(rc); | |
31 if (curfile_structure != 0x00 || curfile_total_size != 10) { | |
32 fprintf(stderr, | |
33 "error: EF_ICCID is not a transparent EF of 10 bytes\n"); | |
34 return(-1); | |
35 } | |
36 return update_bin_op(0, binrec, 10); | |
37 } | |
11 | 38 |
12 cmd_write_imsi(argc, argv) | 39 cmd_write_imsi(argc, argv) |
13 char **argv; | 40 char **argv; |
14 { | 41 { |
15 int rc; | 42 int rc; |