From dc628230357e1e4d8587d6bc95d1dbfa3c7d65ca Mon Sep 17 00:00:00 2001 From: Ed Gonzalez Date: Thu, 30 Jul 2015 15:16:02 -0500 Subject: [PATCH] Waveform now subscribes to slice status messages and sets parameters when a slice enters the waveform mode --- DSP_API/SmartSDR_Interface/status_processor.c | 7 +++++-- DSP_API/SmartSDR_Interface/traffic_cop.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DSP_API/SmartSDR_Interface/status_processor.c b/DSP_API/SmartSDR_Interface/status_processor.c index efc8f4e..be14691 100644 --- a/DSP_API/SmartSDR_Interface/status_processor.c +++ b/DSP_API/SmartSDR_Interface/status_processor.c @@ -74,10 +74,13 @@ static void _handle_status(char* string) { errno = 0; char* smode = argv[i]+strlen("mode")+1; - if (strncmp(smode,"FDV",3) == 0) + if (strncmp(smode,"D*FM",3) == 0) { // we are now in FDV mode output(ANSI_MAGENTA "slice %d is now in FDV mode\n",slc); + char cmd[512] = {0}; + sprintf(cmd, "slice s %d fm_deviation=1250 post_demod_low=0 post_demod_high=6000 dfm_pre_de_emphasis=0 post_demod_bypass=1 squelch=0", slc); + tc_sendSmartSDRcommand(cmd,FALSE, NULL); } else { @@ -95,7 +98,7 @@ static void _handle_status(char* string) } } - if(strncmp(argv[i], "tx", strlen("tx")) == 0) + if(strncmp(argv[i], "tx", strlen("tx")) == 0 && (strlen(argv[i]) == 2)) { errno = 0; int tx = strtoul(argv[i]+strlen("tx")+1, NULL, 0); diff --git a/DSP_API/SmartSDR_Interface/traffic_cop.c b/DSP_API/SmartSDR_Interface/traffic_cop.c index d3367d3..d654547 100644 --- a/DSP_API/SmartSDR_Interface/traffic_cop.c +++ b/DSP_API/SmartSDR_Interface/traffic_cop.c @@ -359,6 +359,8 @@ static void* _tc_thread(void* arg) tc_abort(); } + tc_sendSmartSDRcommand("sub slice all", FALSE, NULL); + /* Initialize UDP connections for TX */ vita_output_Init(_hostname);