Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 391 → Rev 392

/QMK-Groundstation/branches/own_com_lib/com/Communication.h
0,0 → 1,18
#ifndef COMMUNICATION_H
#define COMMUNICATION_H
#include <string>
 
/**
* communication interface for Mikrokopter (MK) USART connection
*/
 
using namespace std;
 
class Communication {
public:
//connect to MK
virtual void connectMK(string) {};
//send command to MK
virtual bool sendCmd(char, int, char[150],unsigned int, bool) {};
};
#endif
/QMK-Groundstation/branches/own_com_lib/com/Handler.cpp
1,9 → 1,16
#include<Handler.h>
 
/**
* Constructor that gets a communication instance
*/
Handler::Handler(Communication * com) {
this->com = com;
}
 
/**
* read mixer values from FlightCtrl
*/
void Handler::read_mixer() {
TX_Data[0] = 0;
o_Connection->send_Cmd('n', ADDRESS_FC, TX_Data, 1, true);
com->send_cmd('n', ADDRESS_FC, TX_Data, 1, true);
}
/QMK-Groundstation/branches/own_com_lib/com/Handler.h
2,6 → 2,7
#define HANDLER_H
#include <string>
#include <Parser.h>
#include <Communication.h>
 
/**
* The Handler handels commands that are send from/to the Mikrokopter
9,7 → 10,10
*/
 
class Handler {
private:
Communication * com;
public:
Handler(Communication * com);
void read_mixer();
};
 
/QMK-Groundstation/branches/own_com_lib/com/QTCommunication.cpp
0,0 → 1,9
#include <QTCommunication.h>
 
void QTCommunication::connectMK(string addr) {
};
 
bool QTCommunication::sendCmd(char cmd, int address, char data[150], unsigned int length, bool resend) {
};
/QMK-Groundstation/branches/own_com_lib/com/QTCommunication.h
0,0 → 1,18
#ifndef QT_COMMUNICATION_H
#define QT_COMMUNICATION_H
#include <Communication.h>
 
/**
* QT specific communication class
* based on the communication interface
* using the SerialPort implementation
* by VIANNEY-LIAUD Philippe
* ( philippe.vianney.liaud gmail.com )
*/
 
class QTCommunication : public Communication {
public:
void connectMK(string addr);
bool sendCmd(char cmd, int address, char data[150], unsigned int length, bool resend);
};
#endif