kopia lustrzana https://gitlab.com/eliggett/wfview
Add baud rate detection for remote rigs
rodzic
07060d1f78
commit
b669605e11
|
@ -125,6 +125,7 @@ void rigCommander::commSetup(unsigned char rigCivAddr, udpPreferences prefs, QSt
|
|||
|
||||
connect(this, SIGNAL(haveChangeLatency(quint16)), udp, SLOT(changeLatency(quint16)));
|
||||
connect(this, SIGNAL(haveSetVolume(unsigned char)), udp, SLOT(setVolume(unsigned char)));
|
||||
connect(udp, SIGNAL(haveBaudRate(quint32)), this, SLOT(receiveBaudRate(quint32)));
|
||||
|
||||
// Connect for errors/alerts
|
||||
connect(udp, SIGNAL(haveNetworkError(QString, QString)), this, SLOT(handleSerialPortError(QString, QString)));
|
||||
|
@ -206,6 +207,10 @@ bool rigCommander::usingLAN()
|
|||
return usingNativeLAN;
|
||||
}
|
||||
|
||||
void rigCommander::receiveBaudRate(quint32 baudrate) {
|
||||
emit haveBaudRate(baudrate);
|
||||
}
|
||||
|
||||
void rigCommander::findRigs()
|
||||
{
|
||||
// This function sends data to 0x00 ("broadcast") to look for any connected rig.
|
||||
|
|
|
@ -234,6 +234,7 @@ public slots:
|
|||
void handleSerialPortError(const QString port, const QString errorText);
|
||||
void changeLatency(const quint16 value);
|
||||
void dataFromServer(QByteArray data);
|
||||
void receiveBaudRate(quint32 baudrate);
|
||||
|
||||
// Speech:
|
||||
void sayFrequency();
|
||||
|
@ -257,6 +258,7 @@ signals:
|
|||
void haveAudioData(audioPacket data);
|
||||
void initUdpHandler();
|
||||
void haveSetVolume(unsigned char level);
|
||||
void haveBaudRate(quint32 baudrate);
|
||||
|
||||
// Spectrum:
|
||||
void haveSpectrumData(QByteArray spectrum, double startFreq, double endFreq); // pass along data to UI
|
||||
|
|
|
@ -369,6 +369,7 @@ void udpHandler::dataReceived()
|
|||
civId = in->civ;
|
||||
rxSampleRates = in->rxsample;
|
||||
txSampleRates = in->txsample;
|
||||
emit haveBaudRate(qFromBigEndian(in->baudrate));
|
||||
//replyId = r.mid(0x42, 16);
|
||||
qInfo(logUdp()) << this->metaObject()->className() << "Received radio capabilities, Name:" <<
|
||||
devName << " Audio:" <<
|
||||
|
|
|
@ -254,6 +254,7 @@ signals:
|
|||
void haveChangeLatency(quint16 value);
|
||||
void haveSetVolume(unsigned char value);
|
||||
void haveNetworkStatus(QString);
|
||||
void haveBaudRate(quint32 baudrate);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -1015,7 +1015,7 @@ void udpServer::sendCapabilities(CLIENT* c)
|
|||
}
|
||||
|
||||
p.civ = rigCaps.civ;
|
||||
p.baudrate = (quint32)qToBigEndian(19200);
|
||||
p.baudrate = (quint32)qToBigEndian(config.baudRate);
|
||||
/*
|
||||
0x80 = 12K only
|
||||
0x40 = 44.1K only
|
||||
|
|
|
@ -23,6 +23,7 @@ struct SERVERCONFIG {
|
|||
QString audioOutput;
|
||||
QString audioInput;
|
||||
quint8 resampleQuality;
|
||||
quint32 baudRate;
|
||||
|
||||
QList <SERVERUSER> users;
|
||||
};
|
||||
|
|
12
wfmain.cpp
12
wfmain.cpp
|
@ -265,6 +265,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, const QString s
|
|||
serverConfig.resampleQuality = udpPrefs.resampleQuality;
|
||||
serverConfig.audioInput = udpPrefs.audioInput;
|
||||
serverConfig.audioOutput = udpPrefs.audioOutput;
|
||||
serverConfig.baudRate = prefs.serialPortBaud;
|
||||
}
|
||||
udp = new udpServer(serverConfig);
|
||||
|
||||
|
@ -724,14 +725,17 @@ void wfmain::openRig()
|
|||
connect(rig, SIGNAL(haveSerialPortError(QString, QString)), this, SLOT(receiveSerialPortError(QString, QString)));
|
||||
connect(rig, SIGNAL(haveStatusUpdate(QString)), this, SLOT(receiveStatusUpdate(QString)));
|
||||
|
||||
connect(this, SIGNAL(sendCommSetup(unsigned char, udpPreferences,QString)), rig, SLOT(commSetup(unsigned char, udpPreferences,QString)));
|
||||
connect(this, SIGNAL(sendCommSetup(unsigned char, udpPreferences, QString)), rig, SLOT(commSetup(unsigned char, udpPreferences, QString)));
|
||||
connect(this, SIGNAL(sendCommSetup(unsigned char, QString, quint32,QString)), rig, SLOT(commSetup(unsigned char, QString, quint32,QString)));
|
||||
|
||||
connect(rig, SIGNAL(haveBaudRate(quint32)), this, SLOT(receiveBaudRate(quint32)));
|
||||
|
||||
connect(this, SIGNAL(sendCloseComm()), rig, SLOT(closeComm()));
|
||||
connect(this, SIGNAL(sendChangeLatency(quint16)), rig, SLOT(changeLatency(quint16)));
|
||||
connect(this, SIGNAL(getRigCIV()), rig, SLOT(findRigs()));
|
||||
connect(rig, SIGNAL(discoveredRigID(rigCapabilities)), this, SLOT(receiveFoundRigID(rigCapabilities)));
|
||||
connect(rig, SIGNAL(commReady()), this, SLOT(receiveCommReady()));
|
||||
|
||||
if (rigCtl != Q_NULLPTR) {
|
||||
connect(rig, SIGNAL(stateInfo(rigStateStruct*)), rigCtl, SLOT(receiveStateInfo(rigStateStruct*)));
|
||||
connect(rigCtl, SIGNAL(setFrequency(freqt)), rig, SLOT(setFrequency(freqt)));
|
||||
|
@ -4119,6 +4123,12 @@ void wfmain::receiveSpectrumSpan(freqt freqspan, bool isSub)
|
|||
}
|
||||
}
|
||||
|
||||
void wfmain::receiveBaudRate(quint32 baud)
|
||||
{
|
||||
qInfo() << "Received serial port baud rate from remote server:" << baud;
|
||||
prefs.serialPortBaud = baud;
|
||||
}
|
||||
|
||||
void wfmain::on_rigPowerOnBtn_clicked()
|
||||
{
|
||||
powerRigOn();
|
||||
|
|
1
wfmain.h
1
wfmain.h
|
@ -234,6 +234,7 @@ private slots:
|
|||
void runPeriodicCommands();
|
||||
void showStatusBarText(QString text);
|
||||
void serverConfigRequested(SERVERCONFIG conf, bool store);
|
||||
void receiveBaudRate(quint32 baudrate);
|
||||
|
||||
// void on_getFreqBtn_clicked();
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue