1,9 → 1,26 |
#include <QTCommunication.h> |
#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 QTCommunication::connect_MK(string addr) { |
void QTSerialCommunication::connect_MK(string addr) { |
|
}; |
|
10,7 → 27,10 |
/** |
* send command to Mikrokopter |
*/ |
bool QTCommunication::send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend) { |
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; |
}; |
|
18,6 → 38,6 |
* stop sending commands to Mikrokopter |
* stop timer |
*/ |
void QTCommunication::stop_resend() { |
void QTSerialCommunication::stop_resend() { |
|
}; |