Add more intelligence to the remote control.

This commit is contained in:
Jonathan Naylor 2019-01-15 21:45:29 +00:00
parent 455755328a
commit 76badb28f1
7 changed files with 27 additions and 13 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX * Copyright (C) 2015-2019 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -136,6 +136,9 @@ bool CDMRNetwork::open()
void CDMRNetwork::enable(bool enabled) void CDMRNetwork::enable(bool enabled)
{ {
if (!enabled && m_enabled)
m_rxData.clear();
m_enabled = enabled; m_enabled = enabled;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2014,2016 by Jonathan Naylor G4KLX * Copyright (C) 2009-2014,2016,2019 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -320,6 +320,8 @@ void CDStarNetwork::enable(bool enabled)
{ {
if (enabled && !m_enabled) if (enabled && !m_enabled)
reset(); reset();
else if (!enabled && m_enabled)
m_buffer.clear();
m_enabled = enabled; m_enabled = enabled;
} }

View file

@ -1684,31 +1684,31 @@ void CMMDVMHost::remoteControl()
REMOTE_COMMAND command = m_remoteControl->getCommand(); REMOTE_COMMAND command = m_remoteControl->getCommand();
switch(command) { switch(command) {
case RCD_MODE_IDLE: case RCD_MODE_IDLE:
if (!isBusy()) if (m_mode != MODE_IDLE)
setMode(MODE_IDLE); setMode(MODE_IDLE);
break; break;
case RCD_MODE_LOCKOUT: case RCD_MODE_LOCKOUT:
if (!isBusy()) if (m_mode != MODE_LOCKOUT)
setMode(MODE_LOCKOUT); setMode(MODE_LOCKOUT);
break; break;
case RCD_MODE_DSTAR: case RCD_MODE_DSTAR:
if (!isBusy()) if (m_dstar != NULL && m_mode != MODE_DSTAR)
setMode(MODE_DSTAR); setMode(MODE_DSTAR);
break; break;
case RCD_MODE_DMR: case RCD_MODE_DMR:
if (!isBusy()) if (m_dmr != NULL && m_mode != MODE_DMR)
setMode(MODE_DMR); setMode(MODE_DMR);
break; break;
case RCD_MODE_YSF: case RCD_MODE_YSF:
if (!isBusy()) if (m_ysf != NULL && m_mode != MODE_YSF)
setMode(MODE_YSF); setMode(MODE_YSF);
break; break;
case RCD_MODE_P25: case RCD_MODE_P25:
if (!isBusy()) if (m_p25 != NULL && m_mode != MODE_P25)
setMode(MODE_P25); setMode(MODE_P25);
break; break;
case RCD_MODE_NXDN: case RCD_MODE_NXDN:
if (!isBusy()) if (m_nxdn != NULL && m_mode != MODE_NXDN)
setMode(MODE_NXDN); setMode(MODE_NXDN);
break; break;
default: default:

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2014,2016,2018 by Jonathan Naylor G4KLX * Copyright (C) 2009-2014,2016,2018,2019 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -162,6 +162,8 @@ void CNXDNNetwork::enable(bool enabled)
{ {
if (enabled && !m_enabled) if (enabled && !m_enabled)
reset(); reset();
else if (!enabled && m_enabled)
m_buffer.clear();
m_enabled = enabled; m_enabled = enabled;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2014,2016 by Jonathan Naylor G4KLX * Copyright (C) 2009-2014,2016,2019 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -431,5 +431,8 @@ void CP25Network::close()
void CP25Network::enable(bool enabled) void CP25Network::enable(bool enabled)
{ {
if (!enabled && m_enabled)
m_buffer.clear();
m_enabled = enabled; m_enabled = enabled;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018 by Jonathan Naylor G4KLX * Copyright (C) 2018,2019 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -113,6 +113,8 @@ void CPOCSAGNetwork::enable(bool enabled)
{ {
if (enabled && !m_enabled) if (enabled && !m_enabled)
reset(); reset();
else if (!enabled && m_enabled)
m_buffer.clear();
unsigned char c = enabled ? 0x00U : 0xFFU; unsigned char c = enabled ? 0x00U : 0xFFU;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2014,2016 by Jonathan Naylor G4KLX * Copyright (C) 2009-2014,2016,2019 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -196,6 +196,8 @@ void CYSFNetwork::enable(bool enabled)
{ {
if (enabled && !m_enabled) if (enabled && !m_enabled)
reset(); reset();
else if (!enabled && m_enabled)
m_buffer.clear();
m_enabled = enabled; m_enabled = enabled;
} }