Fix error in serial init caused by the last commit

This commit is contained in:
Collin Kidder
2015-05-13 20:20:16 -04:00
parent b634024fb2
commit 61eb9e2421
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -596,7 +596,7 @@ void MainWindow::connButtonPress()
{ {
if (ports.at(x).portName() == ui->cbSerialPorts->currentText()) if (ports.at(x).portName() == ui->cbSerialPorts->currentText())
{ {
emit sendSerialPort(ports[x]); emit sendSerialPort(&ports[x]);
return; return;
} }
} }
+1 -1
View File
@@ -38,7 +38,7 @@ public slots:
void gotFrame(CANFrame *frame); void gotFrame(CANFrame *frame);
signals: signals:
void sendSerialPort(QSerialPortInfo &port); void sendSerialPort(QSerialPortInfo *port);
void updateBaudRates(int, int); void updateBaudRates(int, int);
void sendCANFrame(const CANFrame *, int); void sendCANFrame(const CANFrame *, int);
+3 -3
View File
@@ -16,7 +16,7 @@ SerialWorker::~SerialWorker()
if (serial != NULL) delete serial; if (serial != NULL) delete serial;
} }
void SerialWorker::setSerialPort(QSerialPortInfo &port) void SerialWorker::setSerialPort(QSerialPortInfo *port)
{ {
if (!(serial == NULL)) if (!(serial == NULL))
{ {
@@ -27,9 +27,9 @@ void SerialWorker::setSerialPort(QSerialPortInfo &port)
delete serial; 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); serial->open(QIODevice::ReadWrite);
QByteArray output; QByteArray output;
output.append(0xE7); output.append(0xE7);
+1 -1
View File
@@ -34,7 +34,7 @@ private slots: //we receive things in slots
void readSerialData(); void readSerialData();
public slots: public slots:
void setSerialPort(QSerialPortInfo&); void setSerialPort(QSerialPortInfo*);
void sendFrame(const CANFrame *, int); void sendFrame(const CANFrame *, int);
void updateBaudRates(int, int); void updateBaudRates(int, int);