FreeCalypso > hg > fc-pcsc-tools
comparison libcommon/plmncodes.c @ 53:4eb447be01c0
fc-simtool plmnsel-dump implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 13 Feb 2021 06:26:52 +0000 |
parents | |
children | d2e800abd257 |
comparison
equal
deleted
inserted
replaced
52:2f697a8c5196 | 53:4eb447be01c0 |
---|---|
1 /* | |
2 * This module implements some functions for working with MCC-MNC PLMN codes. | |
3 */ | |
4 | |
5 #include <sys/types.h> | |
6 | |
7 decode_plmn_3bytes(bin, asc, space_pad) | |
8 u_char *bin; | |
9 char *asc; | |
10 { | |
11 asc[0] = encode_hex_digit(bin[0] & 0xF); | |
12 asc[1] = encode_hex_digit(bin[0] >> 4); | |
13 asc[2] = encode_hex_digit(bin[1] & 0xF); | |
14 asc[3] = '-'; | |
15 asc[4] = encode_hex_digit(bin[2] & 0xF); | |
16 asc[5] = encode_hex_digit(bin[2] >> 4); | |
17 asc[6] = encode_hex_digit(bin[1] >> 4); | |
18 asc[7] = '\0'; | |
19 if (asc[6] == 'F') { | |
20 if (space_pad) | |
21 asc[6] = ' '; | |
22 else | |
23 asc[6] = '\0'; | |
24 } | |
25 } |