|
|
@ -322,46 +322,51 @@ int CYSFGateway::run()
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// XXX call reset() on end of transmission.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (status) {
|
|
|
|
switch (status) {
|
|
|
|
case WXS_CONNECT: {
|
|
|
|
case WXS_CONNECT: {
|
|
|
|
unsigned int refl = m_dtmf->getReflector();
|
|
|
|
std::string refl = m_dtmf->getReflector();
|
|
|
|
// XXX validate reflector
|
|
|
|
CYSFReflector* reflector = m_wiresX->getReflector(refl);
|
|
|
|
// XXX Inform Wires-X
|
|
|
|
if (reflector != NULL) {
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
m_wiresX->processConnect(reflector);
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CYSFReflector* reflector = m_wiresX->getReflector();
|
|
|
|
if (m_linked) {
|
|
|
|
LogMessage("Connect to %5.5s has been requested by %10.10s", reflector->m_id.c_str(), buffer + 14U);
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_netNetwork->setDestination(reflector->m_address, reflector->m_port);
|
|
|
|
LogMessage("Connect via DTMF to %5.5s has been requested by %10.10s", reflector->m_id.c_str(), buffer + 14U);
|
|
|
|
m_netNetwork->writePoll();
|
|
|
|
|
|
|
|
m_netNetwork->writePoll();
|
|
|
|
m_netNetwork->setDestination(reflector->m_address, reflector->m_port);
|
|
|
|
m_netNetwork->writePoll();
|
|
|
|
m_netNetwork->writePoll();
|
|
|
|
|
|
|
|
m_netNetwork->writePoll();
|
|
|
|
|
|
|
|
m_netNetwork->writePoll();
|
|
|
|
|
|
|
|
|
|
|
|
inactivityTimer.start();
|
|
|
|
inactivityTimer.start();
|
|
|
|
lostTimer.start();
|
|
|
|
lostTimer.start();
|
|
|
|
pollTimer.start();
|
|
|
|
pollTimer.start();
|
|
|
|
|
|
|
|
|
|
|
|
m_linked = true;
|
|
|
|
m_linked = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case WXS_DISCONNECT:
|
|
|
|
case WXS_DISCONNECT:
|
|
|
|
// XXX Inform Wires-X
|
|
|
|
if (m_linked) {
|
|
|
|
LogMessage("Disconnect has been requested by %10.10s", buffer + 14U);
|
|
|
|
m_wiresX->processDisconnect();
|
|
|
|
|
|
|
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
LogMessage("Disconnect via DTMF has been requested by %10.10s", buffer + 14U);
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
|
|
|
m_netNetwork->clearDestination();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inactivityTimer.stop();
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
lostTimer.stop();
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
pollTimer.stop();
|
|
|
|
m_netNetwork->writeUnlink();
|
|
|
|
|
|
|
|
m_netNetwork->clearDestination();
|
|
|
|
|
|
|
|
|
|
|
|
m_linked = false;
|
|
|
|
inactivityTimer.stop();
|
|
|
|
|
|
|
|
lostTimer.stop();
|
|
|
|
|
|
|
|
pollTimer.stop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_linked = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -381,6 +386,8 @@ int CYSFGateway::run()
|
|
|
|
if ((buffer[34U] & 0x01U) == 0x01U) {
|
|
|
|
if ((buffer[34U] & 0x01U) == 0x01U) {
|
|
|
|
if (m_gps != NULL)
|
|
|
|
if (m_gps != NULL)
|
|
|
|
m_gps->reset();
|
|
|
|
m_gps->reset();
|
|
|
|
|
|
|
|
if (m_dtmf != NULL)
|
|
|
|
|
|
|
|
m_dtmf->reset();
|
|
|
|
m_exclude = false;
|
|
|
|
m_exclude = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|