Fix gvret code to work with single bus adapters (such as Macchina A0), small change to UDP receiver
This commit is contained in:
@@ -70,7 +70,7 @@ ConnectionWindow::ConnectionWindow(QWidget *parent) :
|
|||||||
rxBroadcast = new QUdpSocket(this);
|
rxBroadcast = new QUdpSocket(this);
|
||||||
//Need to make sure it tries to share the address in case there are
|
//Need to make sure it tries to share the address in case there are
|
||||||
//multiple instances of SavvyCAN running.
|
//multiple instances of SavvyCAN running.
|
||||||
rxBroadcast->bind(QHostAddress::AnyIPv4, 17222, QAbstractSocket::ShareAddress);
|
rxBroadcast->bind(QHostAddress::Any, 17222, QAbstractSocket::ShareAddress);
|
||||||
|
|
||||||
connect(rxBroadcast, SIGNAL(readyRead()), this, SLOT(readPendingDatagrams()));
|
connect(rxBroadcast, SIGNAL(readyRead()), this, SLOT(readPendingDatagrams()));
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ void ConnectionWindow::readPendingDatagrams()
|
|||||||
if (!remoteDeviceIP.contains(datagram.senderAddress().toString()))
|
if (!remoteDeviceIP.contains(datagram.senderAddress().toString()))
|
||||||
{
|
{
|
||||||
remoteDeviceIP.append(datagram.senderAddress().toString());
|
remoteDeviceIP.append(datagram.senderAddress().toString());
|
||||||
//qDebug() << "Add new remote IP " << datagram.senderAddress().toString();
|
qDebug() << "Add new remote IP " << datagram.senderAddress().toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -819,11 +819,14 @@ void GVRetSerial::procRXChar(unsigned char c)
|
|||||||
qDebug() << "Baud 0 = " << can0Baud;
|
qDebug() << "Baud 0 = " << can0Baud;
|
||||||
qDebug() << "Baud 1 = " << can1Baud;
|
qDebug() << "Baud 1 = " << can1Baud;
|
||||||
mBusData[0].mBus.setSpeed(can0Baud);
|
mBusData[0].mBus.setSpeed(can0Baud);
|
||||||
mBusData[1].mBus.setSpeed(can1Baud);
|
|
||||||
mBusData[0].mBus.setActive(can0Enabled);
|
mBusData[0].mBus.setActive(can0Enabled);
|
||||||
mBusData[1].mBus.setActive(can1Enabled);
|
|
||||||
mBusData[0].mConfigured = true;
|
mBusData[0].mConfigured = true;
|
||||||
mBusData[1].mConfigured = true;
|
if (mBusData.count() > 1)
|
||||||
|
{
|
||||||
|
mBusData[1].mBus.setSpeed(can1Baud);
|
||||||
|
mBusData[1].mBus.setActive(can1Enabled);
|
||||||
|
mBusData[1].mConfigured = true;
|
||||||
|
}
|
||||||
|
|
||||||
can0Baud |= 0x80000000;
|
can0Baud |= 0x80000000;
|
||||||
if (can0Enabled) can0Baud |= 0x40000000;
|
if (can0Enabled) can0Baud |= 0x40000000;
|
||||||
|
|||||||
Reference in New Issue
Block a user