diff frtest/dlcap-gsmx.c @ 166:500f3e93964f

gsmfr-dlcap-gsmx: handle DSP flags consistently with EFR version
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Dec 2022 08:23:32 +0000
parents ef3ea52a190f
children 6e39fc0134da
line wrap: on
line diff
--- a/frtest/dlcap-gsmx.c	Fri Dec 16 04:09:03 2022 +0000
+++ b/frtest/dlcap-gsmx.c	Fri Dec 16 08:23:32 2022 +0000
@@ -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] & 0xC004) == 0xC000) {
+			gsm0610_tidsp_to_libgsm(tidsp_bytes, libgsm_bytes);
+			fwrite(libgsm_bytes, 1, 33, outf);
+		} else {
 			bfi[0] = 0xBF;
 			bfi[1] = fn_mod_104 == 60;
 			fwrite(bfi, 1, 2, outf);
-		} else {
-			gsm0610_tidsp_to_libgsm(tidsp_bytes, libgsm_bytes);
-			fwrite(libgsm_bytes, 1, 33, outf);
 		}
 	}
 	exit(0);