FreeCalypso > hg > fc-pcsc-tools
comparison libcommon/apducmd.c @ 121:8e70ee7c194f
fc-simtool & fc-uicc-tool: raw apdu command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 20 Feb 2021 00:48:22 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
120:a98992e9fe82 | 121:8e70ee7c194f |
---|---|
1 /* | |
2 * This module implements a low-level debug command | |
3 * for users to manually send arbitrary APDUs. | |
4 */ | |
5 | |
6 #include <sys/types.h> | |
7 #include <stdio.h> | |
8 #include "simresp.h" | |
9 | |
10 cmd_apdu(argc, argv) | |
11 char **argv; | |
12 { | |
13 u_char cmd[260]; | |
14 int rc; | |
15 unsigned len; | |
16 | |
17 rc = decode_hex_data_from_string(argv[1], cmd, 5, 260); | |
18 if (rc < 0) | |
19 return(rc); | |
20 len = rc; | |
21 rc = apdu_exchange(cmd, len); | |
22 if (rc < 0) | |
23 return(rc); | |
24 printf("%04X\n", sim_resp_sw); | |
25 return(0); | |
26 } |