Merge pull request #284 from f1rmb/network_status
Add new remote command:
This commit is contained in:
commit
1344f545e9
1 changed files with 7 additions and 0 deletions
|
@ -977,6 +977,13 @@ void CYSFGateway::processRemoteCommands()
|
|||
m_lostTimer.stop();
|
||||
m_linkType = LINK_NONE;
|
||||
}
|
||||
} else if (::memcmp(buffer + 0U, "status", 6U) == 0) {
|
||||
std::string state = std::string("ysf:") + (((m_ysfNetwork == NULL) && (m_fcsNetwork == NULL)) ? "n/a" : ((m_linkType != LINK_NONE) ? "conn" : "disc"));
|
||||
m_remoteSocket->write((unsigned char*)state.c_str(), (unsigned int)state.length(), addr, addrLen);
|
||||
} else if (::memcmp(buffer + 0U, "host", 4U) == 0) {
|
||||
std::string ref = ((((m_ysfNetwork == NULL) && (m_fcsNetwork == NULL)) || (m_linkType == LINK_NONE)) ? "NONE" : m_current);
|
||||
std::string host = std::string("ysf:\"") + ref + "\"";
|
||||
m_remoteSocket->write((unsigned char*)host.c_str(), (unsigned int)host.length(), addr, addrLen);
|
||||
} else {
|
||||
CUtils::dump("Invalid remote command received", buffer, res);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue