kopia lustrzana https://gitlab.com/eliggett/wfview
Add better detection of ci-v transceive disable
rodzic
97e5ff9ff8
commit
67c80c2510
|
@ -217,9 +217,8 @@ void pttyHandler::receiveDataIn(int fd) {
|
|||
civId = (quint8)inPortData[lastFE + 2];
|
||||
qInfo(logSerial()) << "pty remote CI-V changed:" << hex << (quint8)civId;
|
||||
}
|
||||
|
||||
// filter 1A 05 01 12/27 = C-IV transceive command before forwarding on.
|
||||
if (inPortData.contains(QByteArrayLiteral("\x1a\x05\x01\x12")) || inPortData.contains(QByteArrayLiteral("\x1a\x05\x01\x27")))
|
||||
// filter C-IV transceive command before forwarding on.
|
||||
if (inPortData.contains(rigCaps.transceiveCommand))
|
||||
{
|
||||
//qInfo(logSerial()) << "Filtered transceive command";
|
||||
//printHex(inPortData, false, true);
|
||||
|
@ -330,4 +329,10 @@ void pttyHandler::printHex(const QByteArray& pdata, bool printVert, bool printHo
|
|||
qDebug(logSerial()) << "----- End hex dump -----";
|
||||
}
|
||||
|
||||
void pttyHandler::receiveFoundRigID(rigCapabilities rigCaps) {
|
||||
this->rigCaps = rigCaps;
|
||||
qInfo(logSerial) << "Received rigCapabilities for" << rigCaps.modelName;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#include <QSocketNotifier>
|
||||
#include <QtSerialPort/QSerialPort>
|
||||
|
||||
#include "rigidentities.h"
|
||||
|
||||
// This class abstracts the comm port in a useful way and connects to
|
||||
// the command creator and command parser.
|
||||
|
||||
|
@ -27,6 +29,7 @@ private slots:
|
|||
void receiveDataIn(int fd); // from physical port
|
||||
void receiveDataFromRigToPtty(const QByteArray& data);
|
||||
void debugThis();
|
||||
void receiveFoundRigID(rigCapabilities rigCaps);
|
||||
|
||||
signals:
|
||||
void haveTextMessage(QString message); // status, debug only
|
||||
|
@ -66,8 +69,9 @@ private:
|
|||
mutable QMutex mutex;
|
||||
void printHex(const QByteArray& pdata, bool printVert, bool printHoriz);
|
||||
bool disableTransceive = false;
|
||||
QSocketNotifier *ptReader = nullptr;
|
||||
QSocketNotifier *ptReader = Q_NULLPTR;
|
||||
quint8 civId=0;
|
||||
rigCapabilities rigCaps;
|
||||
};
|
||||
|
||||
#endif // PTTYHANDLER_H
|
||||
|
|
|
@ -61,7 +61,6 @@ void rigCommander::commSetup(unsigned char rigCivAddr, QString rigSerialPort, qu
|
|||
|
||||
// data from the ptty to the rig:
|
||||
connect(ptty, SIGNAL(haveDataFromPort(QByteArray)), comm, SLOT(receiveDataFromUserToRig(QByteArray)));
|
||||
|
||||
// data from the program to the comm port:
|
||||
connect(this, SIGNAL(dataForComm(QByteArray)), comm, SLOT(receiveDataFromUserToRig(QByteArray)));
|
||||
|
||||
|
@ -73,6 +72,9 @@ void rigCommander::commSetup(unsigned char rigCivAddr, QString rigSerialPort, qu
|
|||
|
||||
connect(this, SIGNAL(getMoreDebug()), comm, SLOT(debugThis()));
|
||||
connect(this, SIGNAL(getMoreDebug()), ptty, SLOT(debugThis()));
|
||||
|
||||
connect(this, SIGNAL(discoveredRigID(rigCapabilities)), ptty, SLOT(receiveFoundRigID(rigCapabilities)));
|
||||
|
||||
emit commReady();
|
||||
|
||||
}
|
||||
|
@ -137,6 +139,8 @@ void rigCommander::commSetup(unsigned char rigCivAddr, udpPreferences prefs, aud
|
|||
connect(ptty, SIGNAL(haveSerialPortError(QString, QString)), this, SLOT(handleSerialPortError(QString, QString)));
|
||||
connect(this, SIGNAL(getMoreDebug()), ptty, SLOT(debugThis()));
|
||||
|
||||
connect(this, SIGNAL(discoveredRigID(rigCapabilities)), ptty, SLOT(receiveFoundRigID(rigCapabilities)));
|
||||
|
||||
emit haveAfGain(rxSetup.localAFgain);
|
||||
}
|
||||
|
||||
|
@ -2880,6 +2884,8 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.push_back(band630m);
|
||||
rigCaps.bands.push_back(band2200m);
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x71");
|
||||
|
||||
break;
|
||||
case modelR8600:
|
||||
rigCaps.modelName = QString("IC-R8600");
|
||||
|
@ -2915,6 +2921,7 @@ void rigCommander::determineRigCaps()
|
|||
createMode(modeNXDN_VN, 0x19, "NXDN-VN"), createMode(modeNXDN_N, 0x20, "NXDN-N"),
|
||||
createMode(modeDCR, 0x21, "DCR")});
|
||||
rigCaps.scopeCenterSpans.insert(rigCaps.scopeCenterSpans.end(), {createScopeCenter(cs1M, "±1M"), createScopeCenter(cs2p5M, "±2.5M")});
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x92");
|
||||
break;
|
||||
case model9700:
|
||||
rigCaps.modelName = QString("IC-9700");
|
||||
|
@ -2943,6 +2950,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modeDV, 0x17, "DV"),
|
||||
createMode(modeDD, 0x22, "DD")});
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x01\x27");
|
||||
break;
|
||||
case model910h:
|
||||
rigCaps.modelName = QString("IC-910H");
|
||||
|
@ -2965,6 +2973,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bsr[band70cm] = 0x02;
|
||||
rigCaps.bsr[band2m] = 0x01;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x58");
|
||||
break;
|
||||
case model7600:
|
||||
rigCaps.modelName = QString("IC-7600");
|
||||
|
@ -2989,6 +2998,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
|
||||
createMode(modePSK_R, 0x13, "PSK-R")});
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x97");
|
||||
break;
|
||||
case model7610:
|
||||
rigCaps.modelName = QString("IC-7610");
|
||||
|
@ -3020,6 +3030,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.push_back(band2200m);
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.hasRXAntenna = true;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x01\x12");
|
||||
break;
|
||||
case model7850:
|
||||
rigCaps.modelName = QString("IC-785x");
|
||||
|
@ -3052,6 +3063,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
|
||||
createMode(modePSK_R, 0x13, "PSK-R")});
|
||||
rigCaps.hasRXAntenna = true;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x01\x55");
|
||||
break;
|
||||
case model705:
|
||||
rigCaps.modelName = QString("IC-705");
|
||||
|
@ -3088,6 +3100,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modeWFM, 0x06, "WFM"),
|
||||
createMode(modeDV, 0x17, "DV")});
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x01\x31");
|
||||
break;
|
||||
case model7000:
|
||||
rigCaps.modelName = QString("IC-7000");
|
||||
|
@ -3110,6 +3123,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bsr[band70cm] = 0x12;
|
||||
rigCaps.bsr[bandGen] = 0x13;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x92");
|
||||
break;
|
||||
case model7410:
|
||||
rigCaps.modelName = QString("IC-7410");
|
||||
|
@ -3131,6 +3145,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x40");
|
||||
break;
|
||||
case model7100:
|
||||
rigCaps.modelName = QString("IC-7100");
|
||||
|
@ -3158,6 +3173,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modeWFM, 0x06, "WFM"),
|
||||
createMode(modeDV, 0x17, "DV")});
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x95");
|
||||
break;
|
||||
case model7200:
|
||||
rigCaps.modelName = QString("IC-7200");
|
||||
|
@ -3178,7 +3194,8 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
break;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x03\x48");
|
||||
break;
|
||||
case model7700:
|
||||
rigCaps.modelName = QString("IC-7700");
|
||||
rigCaps.rigctlModel = 3062;
|
||||
|
@ -3204,6 +3221,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
|
||||
createMode(modePSK_R, 0x13, "PSK-R")});
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x95");
|
||||
break;
|
||||
case model706:
|
||||
rigCaps.modelName = QString("IC-706");
|
||||
|
@ -3223,6 +3241,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), createMode(modeWFM, 0x06, "WFM"));
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
break;
|
||||
case model718:
|
||||
rigCaps.modelName = QString("IC-718");
|
||||
|
@ -3246,6 +3265,7 @@ void rigCommander::determineRigCaps()
|
|||
createMode(modeCW, 0x03, "CW"), createMode(modeCW_R, 0x07, "CW-R"),
|
||||
createMode(modeRTTY, 0x04, "RTTY"), createMode(modeRTTY_R, 0x08, "RTTY-R")
|
||||
};
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
break;
|
||||
case model756pro:
|
||||
rigCaps.modelName = QString("IC-756 Pro");
|
||||
|
@ -3265,6 +3285,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
break;
|
||||
case model756proii:
|
||||
rigCaps.modelName = QString("IC-756 Pro II");
|
||||
|
@ -3284,6 +3305,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
break;
|
||||
case model756proiii:
|
||||
rigCaps.modelName = QString("IC-756 Pro III");
|
||||
|
@ -3303,6 +3325,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
break;
|
||||
default:
|
||||
rigCaps.modelName = QString("IC-0x%1").arg(rigCaps.modelID, 2, 16);
|
||||
|
@ -3324,6 +3347,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), {band23cm, band4m, band630m, band2200m, bandGen});
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
qInfo(logRig()) << "Found unknown rig: 0x" << QString("%1").arg(rigCaps.modelID, 2, 16);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -131,6 +131,8 @@ struct rigCapabilities {
|
|||
unsigned char bsr[20] = {0};
|
||||
|
||||
std::vector <mode_info> modes;
|
||||
|
||||
QByteArray transceiveCommand;
|
||||
};
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue