1
0
Fork 0

Merge pull request #284 from f1rmb/network_status

Add new remote command:
master
Jonathan Naylor 3 years ago committed by GitHub
commit 1344f545e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -977,6 +977,13 @@ void CYSFGateway::processRemoteCommands()
m_lostTimer.stop(); m_lostTimer.stop();
m_linkType = LINK_NONE; 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 { } else {
CUtils::dump("Invalid remote command received", buffer, res); CUtils::dump("Invalid remote command received", buffer, res);
} }

Loading…
Cancel
Save