Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 448 → Rev 449

/QMK-Groundstation/branches/libMK/libMK/QTSerialCommunication.cpp
0,0 → 1,43
#include "QTSerialCommunication.h"
#include "../libMK/Parser.h"
 
/**
* initiate connection and stuff
*/
QTSerialCommunication::QTSerialCommunication() {
serial = new ManageSerialPort();
serial->setBaudRate(BAUD57600); //BaudRate
serial->setDataBits(DATA_8); //DataBits
serial->setParity(PAR_NONE); //Parity
serial->setStopBits(STOP_1); //StopBits
serial->setFlowControl(FLOW_OFF); //FlowControl
 
serial->setTimeout(0, 10);
serial->enableSending();
serial->enableReceiving();
}
 
/**
* connect to Mikrokopter
*/
void QTSerialCommunication::connect_MK(string addr) {
};
 
/**
* send command to Mikrokopter
*/
bool QTSerialCommunication::send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend) {
if (is_connected()) {
//a valid command starts
}
return true;
};
 
/**
* stop sending commands to Mikrokopter
* stop timer
*/
void QTSerialCommunication::stop_resend() {
};