Expand range of commands.
This commit is contained in:
parent
a3aaffd280
commit
b43a354343
|
@ -929,9 +929,27 @@ int CMMDVMHost::run()
|
|||
if (remoteControl != NULL) {
|
||||
REMOTE_COMMAND command = remoteControl->getCommand();
|
||||
switch(command) {
|
||||
case RC_FORCE_IDLE:
|
||||
case RC_MODE_IDLE:
|
||||
setMode(MODE_IDLE);
|
||||
break;
|
||||
case RC_MODE_LOCKOUT:
|
||||
setMode(MODE_LOCKOUT);
|
||||
break;
|
||||
case RC_MODE_DSTAR:
|
||||
setMode(MODE_DSTAR);
|
||||
break;
|
||||
case RC_MODE_DMR:
|
||||
setMode(MODE_DMR);
|
||||
break;
|
||||
case RC_MODE_YSF:
|
||||
setMode(MODE_YSF);
|
||||
break;
|
||||
case RC_MODE_P25:
|
||||
setMode(MODE_P25);
|
||||
break;
|
||||
case RC_MODE_NXDN:
|
||||
setMode(MODE_NXDN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -47,8 +47,20 @@ REMOTE_COMMAND CRemoteControl::getCommand()
|
|||
unsigned int port;
|
||||
int ret = m_socket.read(buffer, BUFFER_LENGTH, address, port);
|
||||
if (ret > 0) {
|
||||
if (::memcmp(buffer, "0", 1U) == 0)
|
||||
command = RC_FORCE_IDLE;
|
||||
if (::memcmp(buffer, "mode idle", 9U) == 0)
|
||||
command = RC_MODE_IDLE;
|
||||
else if (::memcmp(buffer, "mode lockout", 12U) == 0)
|
||||
command = RC_MODE_LOCKOUT;
|
||||
else if (::memcmp(buffer, "mode dstar", 10U) == 0)
|
||||
command = RC_MODE_DSTAR;
|
||||
else if (::memcmp(buffer, "mode dmr", 8U) == 0)
|
||||
command = RC_MODE_DMR;
|
||||
else if (::memcmp(buffer, "mode ysf", 8U) == 0)
|
||||
command = RC_MODE_YSF;
|
||||
else if (::memcmp(buffer, "mode p25", 8U) == 0)
|
||||
command = RC_MODE_P25;
|
||||
else if (::memcmp(buffer, "mode nxdn", 9U) == 0)
|
||||
command = RC_MODE_NXDN;
|
||||
}
|
||||
|
||||
return command;
|
||||
|
|
|
@ -23,7 +23,13 @@
|
|||
|
||||
enum REMOTE_COMMAND {
|
||||
RC_NONE,
|
||||
RC_FORCE_IDLE
|
||||
RC_MODE_IDLE,
|
||||
RC_MODE_LOCKOUT,
|
||||
RC_MODE_DSTAR,
|
||||
RC_MODE_DMR,
|
||||
RC_MODE_YSF,
|
||||
RC_MODE_P25,
|
||||
RC_MODE_NXDN
|
||||
};
|
||||
|
||||
class CRemoteControl {
|
||||
|
|
Loading…
Reference in a new issue