SerialWorker now asks for device info from GVRET. Also, fixed a bug. Lastly, the connection attempt will now time out after 1 second.

This commit is contained in:
Collin Kidder
2015-05-20 19:22:30 -04:00
parent 40fc10d197
commit 07c6046b2c
2 changed files with 55 additions and 3 deletions
+7 -1
View File
@@ -16,7 +16,8 @@ enum STATE //keep this enum synchronized with the Arduino firmware project
GET_ANALOG_INPUTS,
SET_DIG_OUTPUTS,
SETUP_CANBUS,
GET_CANBUS_PARAMS
GET_CANBUS_PARAMS,
GET_DEVICE_INFO
};
class SerialWorker : public QObject
@@ -32,9 +33,11 @@ signals: //we emit signals
void receivedFrame(CANFrame *);
void connectionSuccess(int, int);
void connectionFailure();
void deviceInfo(int, int);
private slots: //we receive things in slots
void readSerialData();
void connectionTimeout();
public slots:
void setSerialPort(QSerialPortInfo*);
@@ -44,12 +47,15 @@ public slots:
private:
QString portName;
bool quit;
bool connected;
QSerialPort *serial;
STATE rx_state;
int rx_step;
CANFrame *buildFrame;
int can0Baud, can1Baud;
bool can0Enabled, can1Enabled;
int deviceBuildNum;
int deviceSingleWireMode;
void procRXChar(unsigned char);
};