From c742d3b3ff99e43e73b4ae3ac0a7aa9b9cd41548 Mon Sep 17 00:00:00 2001 From: Ed Gonzalez Date: Mon, 24 Aug 2015 15:05:03 -0500 Subject: [PATCH] Add mechanism that allows the waveform to know when the radio is unkeying. This is needed so that DSTAR can encode it's end bits. --- DSP_API/SmartSDR_Interface/sched_waveform.c | 9 +++++++++ DSP_API/SmartSDR_Interface/sched_waveform.h | 1 + DSP_API/SmartSDR_Interface/status_processor.c | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/DSP_API/SmartSDR_Interface/sched_waveform.c b/DSP_API/SmartSDR_Interface/sched_waveform.c index 6e87769..d0bffea 100644 --- a/DSP_API/SmartSDR_Interface/sched_waveform.c +++ b/DSP_API/SmartSDR_Interface/sched_waveform.c @@ -201,6 +201,9 @@ static int _dv_serial_fd = 0; static GMSK_DEMOD _gmsk_demod = NULL; static GMSK_MOD _gmsk_mod = NULL; static DSTAR_MACHINE _dstar = NULL; +static _end_of_transmission = FALSE; + + #define FREEDV_NSAMPLES 160 @@ -345,6 +348,12 @@ void sched_waveform_setFD(int fd) _dv_serial_fd = fd; } +void sched_waveform_setEndOfTX(BOOL end_of_transmission) +{ + _end_of_transmission = TRUE; +} + + static void* _sched_waveform_thread(void* param) { int nout; diff --git a/DSP_API/SmartSDR_Interface/sched_waveform.h b/DSP_API/SmartSDR_Interface/sched_waveform.h index f62ec01..adb614f 100644 --- a/DSP_API/SmartSDR_Interface/sched_waveform.h +++ b/DSP_API/SmartSDR_Interface/sched_waveform.h @@ -49,4 +49,5 @@ void sched_waveform_setOwnCall2(uint32 slice , const char * owncall2 ); void sched_waveform_sendStatus(uint32 slice); void sched_waveform_setFD(int fd); +void sched_waveform_setEndOfTX(BOOL end_of_transmission); #endif /* SCHED_WAVEFORM_H_ */ diff --git a/DSP_API/SmartSDR_Interface/status_processor.c b/DSP_API/SmartSDR_Interface/status_processor.c index 85c87a0..62d63e9 100644 --- a/DSP_API/SmartSDR_Interface/status_processor.c +++ b/DSP_API/SmartSDR_Interface/status_processor.c @@ -37,6 +37,7 @@ #include "common.h" #include "traffic_cop.h" +#include "sched_waveform.h" static void _handle_status(char* string) { @@ -140,6 +141,12 @@ static void _handle_status(char* string) { output(ANSI_MAGENTA "we are receiving\n"); } + else if ( strncmp(state, "UNKEY_REQUESTED", strlen("UNKEY_REQUESTED")) == 0 ) + { + output(ANSI_MAGENTA "unkey requested - sending end bits\n"); + sched_waveform_setEndOfTX(TRUE); + } + } }