Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 451 → Rev 450

/QMK-Groundstation/branches/libMK/libMK/QTSerialCommunication.cpp
6,7 → 6,6
* initiate connection and stuff
*/
QTSerialCommunication::QTSerialCommunication() {
connection_lost();
serial = new ManageSerialPort();
serial->setBaudRate(BAUD57600); //BaudRate
serial->setDataBits(DATA_8); //DataBits
40,11 → 39,6
};
 
/**
* 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) {
51,14 → 45,10
if (is_connected()) {
Parser::create_frame(cmd, address, data, length);
if (resend) {
//resend evrey 2 seconds
resendTimer.start(2000);
resendData = data;
//FIXME: start timer...?
}
QByteArray temp(data);
serial->sendData(temp);
} else {
//FIXME: Error message: not connected
}
};
 
68,10 → 58,4
*/
void QTSerialCommunication::stop_resend() {
};
 
/**
* resend timer timout
*/
void QTSerialCommunication::slot_resend_timer() {
}
};