Subversion Repositories Projects

Rev

Rev 440 | Rev 450 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
449 Brean 1
#include "QTSerialCommunication.h"
2
#include "../libMK/Parser.h"
392 Brean 3
 
397 Brean 4
/**
449 Brean 5
 * initiate connection and stuff
6
 */
7
QTSerialCommunication::QTSerialCommunication() {
8
    serial = new ManageSerialPort();
9
    serial->setBaudRate(BAUD57600);   //BaudRate
10
    serial->setDataBits(DATA_8);      //DataBits
11
    serial->setParity(PAR_NONE);      //Parity
12
    serial->setStopBits(STOP_1);      //StopBits
13
    serial->setFlowControl(FLOW_OFF); //FlowControl
14
 
15
    serial->setTimeout(0, 10);
16
    serial->enableSending();
17
    serial->enableReceiving();
18
}
19
 
20
/**
397 Brean 21
 * connect to Mikrokopter
22
 */
449 Brean 23
void QTSerialCommunication::connect_MK(string addr) {
392 Brean 24
 
25
};
26
 
397 Brean 27
/**
28
 * send command to Mikrokopter
29
 */
449 Brean 30
bool QTSerialCommunication::send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend) {
31
    if (is_connected()) {
32
        //a valid command starts
33
    }
397 Brean 34
    return true;
396 Brean 35
};
36
 
399 Brean 37
/**
38
 * stop sending commands to Mikrokopter
39
 * stop timer
40
 */
449 Brean 41
void QTSerialCommunication::stop_resend() {
396 Brean 42
 
392 Brean 43
};