Received data doesn't change the mode.

This commit is contained in:
Jonathan Naylor 2016-02-02 08:00:04 +00:00
parent 7c7515a636
commit 2e43624ea2
2 changed files with 6 additions and 20 deletions

View file

@ -115,9 +115,9 @@ void Log(unsigned int level, const char* fmt, ...)
struct tm* tm = ::gmtime(&now.tv_sec);
::fprintf(m_fpLog, "%c: %04d-%02d-%02d %02d:%02d:%02d.%03u ", LEVELS[level], tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec / 1000U);
::fprintf(m_fpLog, "%c: %04d-%02d-%02d %02d:%02d:%02d.%03lu ", LEVELS[level], tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec / 1000U);
if (m_display)
::fprintf(stdout, "%c: %04d-%02d-%02d %02d:%02d:%02d.%03u ", LEVELS[level], tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec / 1000U);
::fprintf(stdout, "%c: %04d-%02d-%02d %02d:%02d:%02d.%03lu ", LEVELS[level], tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec / 1000U);
#endif
va_list vl;

View file

@ -179,14 +179,8 @@ int CMMDVMHost::run()
len = m_modem->readDStarData(data);
if (dstar != NULL && len > 0U) {
if (mode == MODE_IDLE) {
LogMessage("Mode set to D-Star");
mode = MODE_DSTAR;
m_display->setDStar();
m_modem->setMode(MODE_DSTAR);
if (m_dmrNetwork != NULL)
m_dmrNetwork->enable(false);
}
if (mode == MODE_IDLE)
dstar->writeModem(data);
if (mode == MODE_DSTAR) {
dstar->writeModem(data);
@ -238,16 +232,8 @@ int CMMDVMHost::run()
len = m_modem->readYSFData(data);
if (ysf != NULL && len > 0U) {
if (mode == MODE_IDLE) {
LogMessage("Mode set to System Fusion");
mode = MODE_YSF;
m_display->setFusion();
m_modem->setMode(MODE_YSF);
if (m_dmrNetwork != NULL)
m_dmrNetwork->enable(false);
if (m_dstarNetwork != NULL)
m_dstarNetwork->enable(false);
}
if (mode == MODE_IDLE)
ysf->writeData(data, len);
if (mode == MODE_YSF) {
ysf->writeData(data, len);