Fix error in serial init caused by the last commit
This commit is contained in:
+1
-1
@@ -596,7 +596,7 @@ void MainWindow::connButtonPress()
|
||||
{
|
||||
if (ports.at(x).portName() == ui->cbSerialPorts->currentText())
|
||||
{
|
||||
emit sendSerialPort(ports[x]);
|
||||
emit sendSerialPort(&ports[x]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public slots:
|
||||
void gotFrame(CANFrame *frame);
|
||||
|
||||
signals:
|
||||
void sendSerialPort(QSerialPortInfo &port);
|
||||
void sendSerialPort(QSerialPortInfo *port);
|
||||
void updateBaudRates(int, int);
|
||||
void sendCANFrame(const CANFrame *, int);
|
||||
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@ SerialWorker::~SerialWorker()
|
||||
if (serial != NULL) delete serial;
|
||||
}
|
||||
|
||||
void SerialWorker::setSerialPort(QSerialPortInfo &port)
|
||||
void SerialWorker::setSerialPort(QSerialPortInfo *port)
|
||||
{
|
||||
if (!(serial == NULL))
|
||||
{
|
||||
@@ -27,9 +27,9 @@ void SerialWorker::setSerialPort(QSerialPortInfo &port)
|
||||
delete serial;
|
||||
}
|
||||
|
||||
serial = new QSerialPort(port);
|
||||
serial = new QSerialPort(*port);
|
||||
|
||||
qDebug() << "Serial port name is " << port.portName();
|
||||
qDebug() << "Serial port name is " << port->portName();
|
||||
serial->open(QIODevice::ReadWrite);
|
||||
QByteArray output;
|
||||
output.append(0xE7);
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ private slots: //we receive things in slots
|
||||
void readSerialData();
|
||||
|
||||
public slots:
|
||||
void setSerialPort(QSerialPortInfo&);
|
||||
void setSerialPort(QSerialPortInfo*);
|
||||
void sendFrame(const CANFrame *, int);
|
||||
void updateBaudRates(int, int);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user