Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 450 → Rev 451

/QMK-Groundstation/branches/libMK/libMK/QTSerialCommunication.cpp
6,6 → 6,7
* initiate connection and stuff
*/
QTSerialCommunication::QTSerialCommunication() {
connection_lost();
serial = new ManageSerialPort();
serial->setBaudRate(BAUD57600); //BaudRate
serial->setDataBits(DATA_8); //DataBits
39,6 → 40,11
};
 
/**
* received new data from MK
*/
 
 
/**
* send command to Mikrokopter
*/
void QTSerialCommunication::send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend) {
45,10 → 51,14
if (is_connected()) {
Parser::create_frame(cmd, address, data, length);
if (resend) {
//FIXME: start timer...?
//resend evrey 2 seconds
resendTimer.start(2000);
resendData = data;
}
QByteArray temp(data);
serial->sendData(temp);
} else {
//FIXME: Error message: not connected
}
};
 
58,4 → 68,10
*/
void QTSerialCommunication::stop_resend() {
};
};
 
/**
* resend timer timout
*/
void QTSerialCommunication::slot_resend_timer() {
}