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.
This commit is contained in:
Ed Gonzalez 2015-08-24 15:05:03 -05:00
parent edd809c269
commit c742d3b3ff
3 changed files with 17 additions and 0 deletions

View file

@ -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;

View file

@ -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_ */

View file

@ -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);
}
}
}