/QMK-Groundstation/branches/own_com_lib/com/Communication.h |
---|
11,9 → 11,9 |
class Communication{ |
public: |
//connect to MK |
virtual void connectMK(string) {}; |
virtual void connect_MK(string) {}; |
//send command to MK |
virtual bool sendCmd(char, int, char[150],unsigned int, bool) { return false; }; |
virtual void stopReSend() {}; |
virtual bool send_cmd(char, int, char[150],unsigned int, bool) { return false; }; |
virtual void stop_resend() {}; |
}; |
#endif |
/QMK-Groundstation/branches/own_com_lib/com/Handler.cpp |
---|
13,7 → 13,7 |
void Handler::read_mixer() { |
char tx_data[1] = {0}; |
//com->log("read motor mixer"); |
com->sendCmd('n', ADDRESS_FC, tx_data, 1, true); |
com->send_cmd('n', ADDRESS_FC, tx_data, 1, true); |
} |
void Handler::get_motor_config() { |
31,7 → 31,7 |
case 'N' : |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
if (RX.decode[0] == VERSION_MIXER) |
{ |
43,7 → 43,7 |
case 'M' : |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
if (RX.decode[0] == 1) |
{ |
70,7 → 70,7 |
case 'Q' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
if (RX.decode[1] == VERSION_SETTINGS) |
{ |
101,7 → 101,7 |
break; |
// Settings written |
case 'S' : // DONE 0.71g |
com->stopReSend(); |
com->stop_resend(); |
//TODO: QMessagebox("settings written successful") ? |
break; |
} |
126,7 → 126,7 |
case 'L' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
/*int LCD[150]; |
memcpy(LCD,RX.decode, sizeof(RX.decode)); |
142,7 → 142,7 |
case 'A' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
int Position = RX.decode[0]; |
if (Position != 31) |
185,7 → 185,7 |
case 'V' : // DONE 0.71h |
if (Parser::decode64(RX)) |
{ |
com->stopReSend(); |
com->stop_resend(); |
/* |
Mode.ID = HardwareID; |
Mode.VERSION_MAJOR = RX.decode[0]; |
/QMK-Groundstation/branches/own_com_lib/com/QTCommunication.cpp |
---|
1,13 → 1,19 |
#include <QTCommunication.h> |
void QTCommunication::connectMK(string addr) { |
/** |
* connect to Mikrokopter |
*/ |
void QTCommunication::connect_MK(string addr) { |
}; |
bool QTCommunication::sendCmd(char cmd, int address, char data[150], unsigned int length, bool resend) { |
/** |
* send command to Mikrokopter |
*/ |
bool QTCommunication::send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend) { |
return true; |
}; |
void QTCommunication::stopReSend() { |
void QTCommunication::stop_resend() { |
}; |
/QMK-Groundstation/branches/own_com_lib/com/QTCommunication.h |
---|
14,8 → 14,8 |
class QTCommunication : public Communication { |
public: |
void connectMK(string addr); |
bool sendCmd(char cmd, int address, char data[150], unsigned int length, bool resend); |
void stopReSend(); |
void connect_MK(string addr); |
bool send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend); |
void stop_resend(); |
}; |
#endif |