FreeCalypso > hg > gsm-codec-lib
comparison efrtest/dlcap-gsmx.c @ 163:3bbb16015a79
gsmefr-dlcap-gsmx: logic change for updated understanding of DSP flags
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 16 Dec 2022 02:21:41 +0000 |
parents | 5efc377326da |
children | 6e39fc0134da |
comparison
equal
deleted
inserted
replaced
162:b98aebd94d1f | 163:3bbb16015a79 |
---|---|
1 /* | 1 /* |
2 * This program reads a TCH/EFS downlink capture produced with FreeCalypso tools | 2 * This program reads a TCH/EFS downlink capture produced with FreeCalypso tools |
3 * (fw version with TCH downlink sniffing feature and fc-shell tch record) | 3 * (fw version with TCH downlink sniffing feature and fc-shell tch record) |
4 * and converts it into our extended-libgsm binary format, to be further | 4 * and converts it into our extended-libgsm binary format, to be further |
5 * fed to gsmefr-decode. | 5 * fed to gsmefr-decode or other tools. |
6 */ | 6 */ |
7 | 7 |
8 #include <ctype.h> | 8 #include <ctype.h> |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
60 goto invalid; | 60 goto invalid; |
61 fn_mod_104 = strtoul(linebuf + 86, 0, 10); | 61 fn_mod_104 = strtoul(linebuf + 86, 0, 10); |
62 } else | 62 } else |
63 goto invalid; | 63 goto invalid; |
64 /* | 64 /* |
65 * Bit 15 of status word 0 is buffer validity flag, | 65 * DSP flags will be documented in ../doc/Calypso-TCH-downlink |
66 * bit 2 is BFI. | |
67 */ | 66 */ |
68 if (!(status_words[0] & 0x8000) || (status_words[0] & 0x0004)) { | 67 if ((status_words[0] & 0xC204) == 0xC000) { |
68 efr_tidsp_to_std(tidsp_bytes, efr_bytes); | |
69 fwrite(efr_bytes, 1, 31, outf); | |
70 } else { | |
69 bfi[0] = 0xBF; | 71 bfi[0] = 0xBF; |
70 bfi[1] = fn_mod_104 == 60; | 72 bfi[1] = fn_mod_104 == 60; |
71 fwrite(bfi, 1, 2, outf); | 73 fwrite(bfi, 1, 2, outf); |
72 } else { | |
73 efr_tidsp_to_std(tidsp_bytes, efr_bytes); | |
74 fwrite(efr_bytes, 1, 31, outf); | |
75 } | 74 } |
76 } | 75 } |
77 exit(0); | 76 exit(0); |
78 } | 77 } |