Merge of local changes, including rejection of brodcast echos.

Merge branch 'lan-alpha' of gitlab.com:eliggett/wfview into lan-alpha
merge-requests/1/head
Elliott Liggett 2021-02-03 22:04:50 -08:00
commit a1a1a03580
5 zmienionych plików z 25 dodań i 11 usunięć

Wyświetl plik

@ -10,7 +10,6 @@ commHandler::commHandler()
// grab baud rate and other comm port details
// if they need to be changed later, please
// destroy this and create a new one.
port = new QSerialPort();
@ -89,6 +88,9 @@ void commHandler::openPtPort()
success = pseudoterm->open(QIODevice::ReadWrite);
if(success)
{
#ifndef Q_OS_WIN
qDebug() << "Opened pt device, attempting to grant pt status";
ptfd = pseudoterm->handle();
qDebug() << "ptfd: " << ptfd;
@ -116,6 +118,7 @@ void commHandler::openPtPort()
{
qDebug() << "Received error from pseudo-terminal symlink command: code: [" << sysResult << "]" << " command: [" << ptLinkCmd << "]";
}
#endif
} else {
ptfd = 0;

Wyświetl plik

@ -637,6 +637,7 @@ void rigCommander::parseCommand()
// printHex(payloadIn, false, true);
model = determineRadioModel(payloadIn[2]); // verify this is the model not the CIV
//model = determineRadioModel(0xa2); //testing by forcing model to 9700.
determineRigCaps();
qDebug() << "Have rig ID: decimal: " << (unsigned int)model;
@ -963,6 +964,7 @@ void rigCommander::determineRigCaps()
//TODO: Add if(usingNativeLAN) condition
//TODO: Determine available bands (low priority, rig will reject out of band requests anyway)
rigCaps.model = model;
rigCaps.modelID = model; // may delete later
rigCaps.civ = incomingCIVAddr;
@ -1134,7 +1136,7 @@ void rigCommander::parseSpectrum()
if (payloadIn.length() > 400) // Must be a LAN packet.
{
payloadIn.chop(1);
spectrumLine.append(payloadIn.mid(5,475)); // write over the FD, last one doesn't, oh well.
spectrumLine.append(payloadIn.mid(17,475)); // write over the FD, last one doesn't, oh well.
emit haveSpectrumData(spectrumLine, spectrumStartFreq, spectrumEndFreq);
}
} else if ((sequence > 1) && (sequence < rigCaps.spectSeqMax))

Wyświetl plik

@ -50,7 +50,11 @@ udpHandler::~udpHandler()
SendPacketDisconnect();
}
<<<<<<< HEAD
//msleep(100);
=======
//_sleep(100);
>>>>>>> f18d0f3e2b7f1654d64ae9845d804f1dce4e56e6
udp->close();
delete udp;
qDebug() << "Closing udpHandler";
@ -225,8 +229,8 @@ void udpHandler::DataReceived()
authID[4] = r[30];
authID[5] = r[31];
serial = new udpSerial(radioIP, sport);
audio = new udpAudio(radioIP, aport);
serial = new udpSerial(localIP, radioIP, sport);
audio = new udpAudio(localIP, radioIP, aport);
QObject::connect(serial, SIGNAL(Receive(QByteArray)), this, SLOT(receiveFromSerialStream(QByteArray)));
@ -373,7 +377,7 @@ qint64 udpHandler::SendPacketAuth(uint8_t magic)
// (pseudo) serial class
udpSerial::udpSerial(QHostAddress ip, int sport) {
udpSerial::udpSerial(QHostAddress local, QHostAddress ip, int sport) {
qDebug() << "Starting udpSerial";
port = sport;
radioIP = ip;
@ -383,8 +387,7 @@ udpSerial::udpSerial(QHostAddress ip, int sport) {
localPort = udp->localPort();
qDebug() << "Serial Stream bound to local port:" << localPort << " remote port:" << port;
uint32_t addr = QHostAddress("192.168.99.149").toIPv4Address();
uint32_t addr =local.toIPv4Address();
localSID = (addr >> 8 & 0xff) << 24 | (addr & 0xff) << 16 | (localPort & 0xffff);
QUdpSocket::connect(udp, &QUdpSocket::readyRead, this, &udpSerial::DataReceived);
@ -581,7 +584,7 @@ void udpSerial::DataReceived()
// Audio stream
udpAudio::udpAudio(QHostAddress ip, int aport)
udpAudio::udpAudio(QHostAddress local, QHostAddress ip, int aport)
{
qDebug() << "Starting udpAudio";
port = aport;
@ -591,7 +594,7 @@ udpAudio::udpAudio(QHostAddress ip, int aport)
localPort = udp->localPort();
qDebug() << "Audio Stream bound to local port:" << localPort << " remote port:" << port;
QUdpSocket::connect(udp, &QUdpSocket::readyRead, this, &udpAudio::DataReceived);
uint32_t addr = QHostAddress("192.168.99.149").toIPv4Address();
uint32_t addr = local.toIPv4Address();
localSID = (addr >> 8 & 0xff) << 24 | (addr & 0xff) << 16 | (localPort & 0xffff);
SendPacketConnect(); // First connect packet
@ -627,6 +630,10 @@ udpAudio::~udpAudio()
{
qDebug() << "Closing udpAudio";
SendPacketDisconnect();
<<<<<<< HEAD
=======
//_sleep(100);
>>>>>>> f18d0f3e2b7f1654d64ae9845d804f1dce4e56e6
udp->close();
delete udp;

Wyświetl plik

@ -81,7 +81,7 @@ class udpSerial : public udpBase
Q_OBJECT
public:
udpSerial(QHostAddress ip, int sport);
udpSerial(QHostAddress local, QHostAddress ip, int sport);
~udpSerial();
QMutex serialmutex;
@ -107,7 +107,7 @@ class udpAudio : public udpBase
Q_OBJECT
public:
udpAudio(QHostAddress ip, int aport);
udpAudio(QHostAddress local, QHostAddress ip, int aport);
~udpAudio();
private:

Wyświetl plik

@ -355,7 +355,9 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
wfmain::~wfmain()
{
#ifdef Q_OS_WIN // Prevent crash on exit in Windows.
delete rig;
rigThread->quit();
rigThread->wait();
#endif
delete ui;
}