changeset 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 b98aebd94d1f
children 5f23cb3f0f8d
files efrtest/dlcap-gsmx.c
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/efrtest/dlcap-gsmx.c	Thu Dec 15 23:47:12 2022 +0000
+++ b/efrtest/dlcap-gsmx.c	Fri Dec 16 02:21:41 2022 +0000
@@ -2,7 +2,7 @@
  * This program reads a TCH/EFS downlink capture produced with FreeCalypso tools
  * (fw version with TCH downlink sniffing feature and fc-shell tch record)
  * and converts it into our extended-libgsm binary format, to be further
- * fed to gsmefr-decode.
+ * fed to gsmefr-decode or other tools.
  */
 
 #include <ctype.h>
@@ -62,16 +62,15 @@
 		} else
 			goto invalid;
 		/*
-		 * Bit 15 of status word 0 is buffer validity flag,
-		 * bit 2 is BFI.
+		 * DSP flags will be documented in ../doc/Calypso-TCH-downlink
 		 */
-		if (!(status_words[0] & 0x8000) || (status_words[0] & 0x0004)) {
+		if ((status_words[0] & 0xC204) == 0xC000) {
+			efr_tidsp_to_std(tidsp_bytes, efr_bytes);
+			fwrite(efr_bytes, 1, 31, outf);
+		} else {
 			bfi[0] = 0xBF;
 			bfi[1] = fn_mod_104 == 60;
 			fwrite(bfi, 1, 2, outf);
-		} else {
-			efr_tidsp_to_std(tidsp_bytes, efr_bytes);
-			fwrite(efr_bytes, 1, 31, outf);
 		}
 	}
 	exit(0);