FreeCalypso > hg > fc-sim-tools
annotate libutil/nibbles2asc.c @ 93:6041c601304d
fcsim1-mkprov: revert OTA key addition
It appears that GrcardSIM2 cards (which is what we got for FCSIM1)
do not support OTA after all, contrary to what we were previously
led to believe by some tech support emails from Grcard - apparently
those support emails and OTA descriptions referred to some other
card model(s).
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 21 Apr 2021 05:38:39 +0000 |
parents | 34bbb0585cab |
children |
rev | line source |
---|---|
8
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module implements a function for turning a nibble array |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * into printable ASCII. |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <sys/types.h> |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 void |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 nibbles_to_ascii(nib, len, out) |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 u_char *nib; |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 unsigned len; |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 char *out; |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 { |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 unsigned n; |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 for (n = 0; n < len; n++) |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 *out++ = encode_hex_digit(*nib++); |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 *out = '\0'; |
34bbb0585cab
libutil: import from previous fc-pcsc-tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 } |