Add AR Cluster support

half-duplex
Phil Taylor 2022-10-31 12:15:42 +00:00
rodzic d47b9be7e1
commit b46dfb8f3e
2 zmienionych plików z 52 dodań i 38 usunięć

Wyświetl plik

@ -72,6 +72,7 @@ void dxClusterClient::enableTcp(bool enable)
tcpCleanupTimer->setInterval(1000 * 10); // Run once a minute
connect(tcpCleanupTimer, SIGNAL(timeout()), this, SLOT(tcpCleanup()));
tcpCleanupTimer->start();
authenticated = false;
}
}
else {
@ -169,7 +170,8 @@ void dxClusterClient::tcpDataReceived()
QString data = QString(tcpSocket->readAll());
emit sendOutput(data);
if (data.contains("login:")) {
if (!authenticated) {
if (data.contains("login:") || data.contains("call:") || data.contains("callsign:")) {
sendTcpData(QString("%1\n").arg(tcpUserName));
return;
}
@ -177,7 +179,11 @@ void dxClusterClient::tcpDataReceived()
sendTcpData(QString("%1\n").arg(tcpPassword));
return;
}
if (data.contains("Hello")) {
authenticated = true;
}
}
else {
QRegularExpressionMatchIterator i = tcpRegex.globalMatch(data);
while (i.hasNext()) {
QRegularExpressionMatch match = i.next();
@ -209,6 +215,7 @@ void dxClusterClient::tcpDataReceived()
}
}
updateSpots();
}
}

Wyświetl plik

@ -816,6 +816,9 @@ void rigCtlClient::socketReadyRead()
else if (command[1] == "BAL") {
resp.append(QString("%1").arg((float)rigState->getChar(BAL) / 255.0));
}
else if (command[1] == "KEYSPD") {
resp.append(QString("%1").arg(rigState->getChar(KEYSPD)));
}
else {
resp.append(QString("%1").arg(value));
}
@ -906,6 +909,10 @@ void rigCtlClient::socketReadyRead()
value = command[2].toFloat() * 255;
rigState->set(BAL, quint8(value), true);
}
else if (command[1] == "KEYSPD") {
value = command[2].toInt();
rigState->set(IF, quint8(value), true);
}
qInfo(logRigCtlD()) << "Setting:" << command[1] << command[2] << value;