view rvinterf/lowlevel/tchhide.c @ 1014:961efadd530a default tip

fc-shell TCH DL handler: add support for CSD modes TCH DL capture mechanism in FC Tourmaline firmware has been extended to support CSD modes in addition to speech - add the necessary support on the host tools side. It needs to be noted that this mechanism in its present state does NOT provide the debug utility value that was sought: as we learned only after the code was implemented, TI's DSP has a misfeature in that the buffer we are reading (a_dd_0[]) is zeroed out when the IDS block is enabled, i.e., we are reading all zeros and not the real DL bits we were after. But since the code has already been written, we are keeping it - perhaps we can do some tests with IDS disabled.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 26 Nov 2024 06:27:43 +0000
parents a1065c17429c
children
line wrap: on
line source

/*
 * One of several FreeCalypso extensions to RVTMUX is TCH bit access
 * logical channel, and we would like to handle it specially in rvinterf
 * because it's extremely chatty, sending a frame every 20 ms.  If we
 * were to output every TCH frame in our regular log, that log output
 * becomes useless as everything else is drowned out.  Therefore, we
 * implement a hiding mode by default: we only count how many TCH packets
 * were exchanged in between other messages of interest, and report these
 * counts.
 */

#include <stdio.h>

extern void (*output_hook)();

unsigned tch_rx_count, tch_tx_count;

static void
tch_report_hook()
{
	char msgbuf[80];

	output_hook = 0;
	if (tch_rx_count) {
		sprintf(msgbuf, "TCH: received %u packet%s", tch_rx_count,
			tch_rx_count != 1 ? "s" : "");
		output_line(msgbuf);
		tch_rx_count = 0;
	}
	if (tch_tx_count) {
		sprintf(msgbuf, "TCH: sent %u packet%s", tch_tx_count,
			tch_tx_count != 1 ? "s" : "");
		output_line(msgbuf);
		tch_tx_count = 0;
	}
}

void
tch_inc_count_rx()
{
	tch_rx_count++;
	output_hook = tch_report_hook;
}

void
tch_inc_count_tx()
{
	tch_tx_count++;
	output_hook = tch_report_hook;
}