annotate calypso/targetfd.c @ 99:97ba63d9361a

scripts/fcsim1-sst: turn off STK & OTA services In the initial unprogrammed state of the cards from Grcard, SST has services 25 through 29 set to allocated and activated. However, these cards appear to not actually support OTA, ENVELOPE commands do nothing (just return SW 9000), and they were never observed issuing any proactive SIM commands, even after a feature-generous TERMINAL PROFILE. Therefore, let's list these STK & OTA services as allocated, but not activated in our FCSIM1 SST.
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 05 May 2021 04:26:07 +0000
parents deeeef558279
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #include <stdio.h>
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 #include <stdlib.h>
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 #include <unistd.h>
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 int target_fd;
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 parse_target_fd_opt(argc, argv)
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 char **argv;
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 {
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 extern char *optarg;
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 int c;
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 while ((c = getopt(argc, argv, "C:")) != EOF) {
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 switch (c) {
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 case 'C':
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 target_fd = atoi(optarg);
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 continue;
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 case '?':
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 default:
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 /* error msg already printed */
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 exit(1);
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 }
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 }
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 if (!target_fd) {
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 fprintf(stderr, "error: target fd must be given with -C\n");
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 exit(1);
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 }
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 return(0);
deeeef558279 fcsim-calypso-be put together
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 }