changeset 727:ed983d4040a8

tiffs IVA: decode pcm-IMEI added
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 28 Aug 2020 03:45:03 +0000
parents d68275d47a32
children 8e7f6cca385b
files ffstools/tiffs-rd/decode.c
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ffstools/tiffs-rd/decode.c	Fri Aug 28 03:11:16 2020 +0000
+++ b/ffstools/tiffs-rd/decode.c	Fri Aug 28 03:45:03 2020 +0000
@@ -26,6 +26,20 @@
 extern void write_rx_caltemp_table();
 extern void write_rx_agcparams_table();
 
+static void
+pcm_IMEI_decode(bin, outf)
+	u8 *bin;
+	FILE *outf;
+{
+	u8 rev[8];
+	unsigned n;
+
+	for (n = 0; n < 8; n++)
+		rev[n] = ((bin[n] & 0xF0) >> 4) | ((bin[n] & 0x0F) << 4);
+	fprintf(outf, "%02X%02X%02X%02X-%02X%02X%02X-%02X\n", rev[0], rev[1],
+		rev[2], rev[3], rev[4], rev[5], rev[6], rev[7]);
+}
+
 static struct map {
 	char		*req_name;
 	char		*pathname;
@@ -44,6 +58,7 @@
   {"rx-calchan",   "/gsm/rf/rx/calchan.%s",   1,  40, write_rx_calchan_table},
   {"rx-caltemp",   "/gsm/rf/rx/caltemp.%s",   1,  44, write_rx_caltemp_table},
   {"rx-agcparams", "/gsm/rf/rx/agcparams.%s", 1,   8, write_rx_agcparams_table},
+  {"pcm-IMEI",     "/pcm/IMEI",               0,   8, pcm_IMEI_decode},
   {0,              0,                         0,   0, 0}
 };