diff --git a/src/include/Air_Ground_CEC/mainwindow.hpp b/src/include/Air_Ground_CEC/mainwindow.hpp index 23ff0e4..8ecaa7b 100644 --- a/src/include/Air_Ground_CEC/mainwindow.hpp +++ b/src/include/Air_Ground_CEC/mainwindow.hpp @@ -57,6 +57,8 @@ private slots: private slots: void on_Open_receive_clicked(); + void on_ConnectTello_clicked(); + private: Ui::MainWindow *ui; QNode qnode; diff --git a/src/main/mainwindow.cpp b/src/main/mainwindow.cpp index 3e6936b..fd5b287 100644 --- a/src/main/mainwindow.cpp +++ b/src/main/mainwindow.cpp @@ -1,6 +1,7 @@ +#define TELLODISCONNECTION 274 #include "../include/Air_Ground_CEC/mainwindow.hpp" #include - +#include MainWindow::MainWindow(int argc, char **argv, QWidget *parent) : QMainWindow(parent), qnode(argc, argv), @@ -395,3 +396,17 @@ void MainWindow::on_Stop_receive_clicked() timer->stop(); capture.release(); } + +void MainWindow::on_ConnectTello_clicked() +{ + Tello T("192.168.10.1"); + int socket_fd, err; + + if((socket_fd = socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP))==-1) + { + cout << "initialized error" << endl; + cout << 0; + exit(TELLODISCONNECTION); + } +} + diff --git a/src/ui/mainwindow.ui b/src/ui/mainwindow.ui index 91c85f2..5ad082a 100644 --- a/src/ui/mainwindow.ui +++ b/src/ui/mainwindow.ui @@ -203,7 +203,7 @@ margin:0px 0px 0px 0px; - 2 + 1 @@ -310,6 +310,19 @@ margin:0px 0px 0px 0px; + + + + + 211 + 71 + + + + Connect + + +