Index: branches/mavlink/tools/Controller/Mavlink/src/Config.h
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/Config.h	(revision 71)
+++ branches/mavlink/tools/Controller/Mavlink/src/Config.h	(revision 71)
@@ -0,0 +1,21 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   Config.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Globals for configuration of MavPlanner
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_CONFIG_H
+#define MAVPLANNER_CONFIG_H
+
+#endif // MAVPLANNER_CONFIG_H
Index: branches/mavlink/tools/Controller/Mavlink/src/Forwarder.cpp
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/Forwarder.cpp	(revision 71)
+++ branches/mavlink/tools/Controller/Mavlink/src/Forwarder.cpp	(revision 71)
@@ -0,0 +1,66 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   Forwarder.cpp
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Forward input data to output data, using sockets
+//
+//
+/*********************************************************************/
+
+#include "Forwarder.h"
+
+#include <Socket.h>
+#include <Thread.h>
+#include <FrameworkManager.h>
+
+//todo remove for tests
+#include <iostream>
+
+using namespace std;
+using namespace flair::core;
+
+Forwarder::Forwarder(const FrameworkManager *parent, string name, string &inputAddress,
+					 int inputPort, string &outputAddress, int outputPort):
+					 Thread(parent, name, 6), inputAddress(inputAddress), 
+					 inputPort(inputPort), outputAddress(outputAddress),
+					 outputPort(outputPort) {
+  cout << "MavPlanner Forwarder constructor" << endl;
+
+  // string tmpOutput = outputAddress + ":" + to_string(outputPort);
+  // cout << "MavPlanner Forwarder output address : " << tmpOutput << endl;
+
+  cout << "input socket : " << inputAddress + ":" + to_string(inputPort) << endl;
+  cout << "output socket : " << outputAddress + ":" + to_string(outputPort) << endl;
+
+  inputSocket = new Socket((Thread *)this, "input socket", inputAddress + ":" + to_string(inputPort));
+  outputSocket = new Socket((Thread *)this, "output socket", outputAddress + ":" + to_string(outputPort));
+}
+
+Forwarder::~Forwarder() {
+
+}
+
+void Forwarder::Run() {
+  if (getFrameworkManager()->ErrorOccured()) {
+    SafeStop();
+    Thread::Err("An error occurred, we don't launch the Run loop.\n");
+  }
+  int recvDataSize = 0;
+  char* srcBuffer;
+  size_t srcSize;
+  while (!ToBeStopped()) {
+    // Thread::SleepMS(2000);
+    // TIME_NONBLOCK
+    recvDataSize = inputSocket->RecvMessage(inputBuffer, 200, 5000000000, srcBuffer, &srcSize);
+    cout << "Forwarder message received, size="<< recvDataSize << endl;
+	outputSocket->SendMessage(inputBuffer, recvDataSize);
+  }
+}
Index: branches/mavlink/tools/Controller/Mavlink/src/Forwarder.h
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/Forwarder.h	(revision 71)
+++ branches/mavlink/tools/Controller/Mavlink/src/Forwarder.h	(revision 71)
@@ -0,0 +1,56 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   Forwarder.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Forward input data to output data, using sockets
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_FORWARDER_H
+#define MAVPLANNER_FORWARDER_H
+
+#include <string>
+
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+  class FrameworkManager;
+  class Socket;
+}
+}
+
+class Forwarder : public flair::core::Thread {
+public:
+
+  Forwarder(const flair::core::FrameworkManager *parent, std::string name,
+  			std::string &inputAddress, int inputPort,
+  			std::string &outputAddress, int outputPort);
+  ~Forwarder();
+
+private:
+  // reimplement the run of the Thread class
+  void Run();
+
+  flair::core::Socket *inputSocket;
+  std::string inputAddress;
+  int inputPort;
+  char *inputBuffer;
+  const int inputBufferSize = 200;
+
+  flair::core::Socket *outputSocket;
+  std::string outputAddress;
+  int outputPort;
+
+};
+
+#endif // MAVPLANNER_FORWARDER_H
Index: branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.cpp
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.cpp	(revision 71)
+++ branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.cpp	(revision 71)
@@ -0,0 +1,65 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiFlair.cpp
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Implementation of GuiInterface using Flair
+//  			communication mechanism
+//
+//
+/*********************************************************************/
+
+#include "GuiFlair.h"
+#include "GuiInterface.h"
+
+//todo remove for tests
+#include <iostream>
+
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+
+GuiFlair::GuiFlair(const FrameworkManager *parent, string name):
+				   GuiInterface(parent, name) {
+	cout << "MavPlanner GuiFlair constructor" << endl;				   	
+}
+
+GuiFlair::~GuiFlair() {
+
+}
+
+void GuiFlair::MissionInitialize() {
+	cout << "MavPlanner GuiFlair MissionInitialize" << endl;
+}
+
+void GuiFlair::MissionStart() {
+	cout << "MavPlanner GuiFlair MissionStart" << endl;
+}
+
+void GuiFlair::MissionStop() {
+	cout << "MavPlanner GuiFlair MissionStop" << endl;
+}
+
+void GuiFlair::MissionKill() {
+	cout << "MavPlanner GuiFlair MissionKill" << endl;
+}
+
+void GuiFlair::WptSend() {
+	cout << "MavPlanner GuiFlair WptSend" << endl;
+}
+
+void GuiFlair::WptClear() {
+	cout << "MavPlanner GuiFlair WptClear" << endl;
+}
+
+void GuiFlair::WptLoopSend() {
+	cout << "MavPlanner GuiFlair WptLoopSend" << endl;
+}
Index: branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.h
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.h	(revision 71)
+++ branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.h	(revision 71)
@@ -0,0 +1,49 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiFlair.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Implementation of GuiInterface using Flair
+//  			communication mechanism
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_GUI_FLAIR_H
+#define MAVPLANNER_GUI_FLAIR_H
+
+#include <string>
+
+#include "GuiInterface.h"
+
+namespace flair {
+namespace core {
+  class FrameworkManager;
+}
+}
+
+class GuiFlair : public GuiInterface {
+public:
+
+  GuiFlair(const flair::core::FrameworkManager *parent, std::string name);
+  ~GuiFlair();
+
+protected:
+
+  virtual void MissionInitialize();
+  virtual void MissionStart();
+  virtual void MissionStop();
+  virtual void MissionKill();
+  virtual void WptSend();
+  virtual void WptClear();
+  virtual void WptLoopSend();
+};
+
+#endif // MAVPLANNER_GUI_FLAIR_H
Index: branches/mavlink/tools/Controller/Mavlink/src/GuiGcs.cpp
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/GuiGcs.cpp	(revision 71)
+++ branches/mavlink/tools/Controller/Mavlink/src/GuiGcs.cpp	(revision 71)
@@ -0,0 +1,72 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiGcs.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Implementation of GuiInterface, using sockets
+//
+//
+/*********************************************************************/
+
+#include "GuiGcs.h"
+#include "GuiInterface.h"
+
+#include <Socket.h>
+#include <FrameworkManager.h>
+
+//todo remove for tests
+#include <iostream>
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+
+GuiGcs::GuiGcs(const FrameworkManager *parent, string name,
+  		 	   std::string &outputAddress, int outputPort):
+			   GuiInterface(parent, name) {
+  cout << "MavPlanner GuiGcs constructor" << endl;
+  outputSocket = new Socket((Thread *)this, "output socket", outputAddress + ":" + to_string(outputPort));
+}
+
+GuiGcs::~GuiGcs() {
+
+}
+
+void GuiGcs::MissionInitialize() {
+  cout << "MavPlanner GuiGcs MissionInitialize" << endl;
+  outputSocket->SendMessage("MavPlanner GuiGcs MissionInitialize");
+}
+
+void GuiGcs::MissionStart() {
+  cout << "MavPlanner GuiGcs MissionStart" << endl;
+  outputSocket->SendMessage("MavPlanner GuiGcs MissionStart");
+}
+
+void GuiGcs::MissionStop() {
+  cout << "MavPlanner GuiGcs MissionStop" << endl;
+  outputSocket->SendMessage("MavPlanner GuiGcs MissionStop");
+}
+
+void GuiGcs::MissionKill() {
+  cout << "MavPlanner GuiGcs MissionKill" << endl;
+  outputSocket->SendMessage("MavPlanner GuiGcs MissionKill");
+}
+
+void GuiGcs::WptSend() {
+  cout << "MavPlanner GuiGcs WptSend" << endl;
+}
+
+void GuiGcs::WptClear() {
+  cout << "MavPlanner GuiGcs WptClear" << endl;
+}
+
+void GuiGcs::WptLoopSend() {
+  cout << "MavPlanner GuiGcs WptLoopSend" << endl;
+}
Index: branches/mavlink/tools/Controller/Mavlink/src/GuiGcs.h
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/GuiGcs.h	(revision 71)
+++ branches/mavlink/tools/Controller/Mavlink/src/GuiGcs.h	(revision 71)
@@ -0,0 +1,55 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiGcs.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Implementation of GuiInterface, using sockets
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_GUI_GCS_H
+#define MAVPLANNER_GUI_GCS_H
+
+#include <string>
+
+#include "GuiInterface.h"
+
+namespace flair {
+namespace core {
+  class FrameworkManager;
+  class Socket;
+}
+}
+
+class GuiGcs : public GuiInterface {
+public:
+
+  GuiGcs(const flair::core::FrameworkManager *parent, std::string name,
+  		 std::string &outputAddress, int outputPort);
+  ~GuiGcs();
+
+protected:
+
+  virtual void MissionInitialize();
+  virtual void MissionStart();
+  virtual void MissionStop();
+  virtual void MissionKill();
+  virtual void WptSend();
+  virtual void WptClear();
+  virtual void WptLoopSend();
+
+private:
+  flair::core::Socket *outputSocket;
+  std::string outputAddress;
+  int outputPort;
+};
+
+#endif // MAVPLANNER_GUI_GCS_H
Index: branches/mavlink/tools/Controller/Mavlink/src/GuiInterface.cpp
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/GuiInterface.cpp	(revision 71)
+++ branches/mavlink/tools/Controller/Mavlink/src/GuiInterface.cpp	(revision 71)
@@ -0,0 +1,149 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiInterface.cpp
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Create the GUI and give an abstract interface to it
+//
+//
+/*********************************************************************/
+
+#include "GuiInterface.h"
+
+#include <cvmatrix.h>
+#include <FrameworkManager.h>
+#include <Socket.h>
+#include <Thread.h>
+
+#include <Tab.h>
+#include <TabWidget.h>
+#include <DoubleSpinBox.h>
+#include <PushButton.h>
+#include <GroupBox.h>
+#include <ListWidget.h>
+
+#include <string>
+#include <sstream>
+
+using namespace flair::core;
+using namespace flair::gui;
+using namespace std;
+
+GuiInterface::GuiInterface(const FrameworkManager *parent, string name)
+                  : Thread(parent, name, 6),
+                  mainTab(new Tab(parent->GetTabWidget(), name)) {
+
+  tabWidget = new TabWidget(mainTab->NewRow(), name);
+
+  // Main tab
+  Tab* settingsTab = new Tab(tabWidget, "Settings");
+  
+  // Controls group
+  controlsGroupBox = new GroupBox(settingsTab->NewRow(), "Controls");
+  btnInitialize = new PushButton(controlsGroupBox->LastRowLastCol(), "Initialize");
+  btnStartMission = new PushButton(controlsGroupBox->LastRowLastCol(), "Start mission");
+  btnStopMission = new PushButton(controlsGroupBox->LastRowLastCol(), "Stop mission");
+  btnKill = new PushButton(controlsGroupBox->LastRowLastCol(), "Kill");
+
+  // Add wpt group
+  addWptGroupBox = new GroupBox(settingsTab->NewRow(), "Add waypoint");
+  latField = new DoubleSpinBox(addWptGroupBox->NewRow(), "Latitude",
+                                -90, 90, 0.001, 3, 3);
+  lonField = new DoubleSpinBox(addWptGroupBox->LastRowLastCol(), "Longitude",
+                                -180, 180, 0.001, 3, 3);
+  btnAddMissionWpt = new PushButton(addWptGroupBox->NewRow(), "Add mission wpt");
+  btnAddEntranceWpt = new PushButton(addWptGroupBox->LastRowLastCol(), "Add entrance wpt");
+  btnAddExitWpt = new PushButton(addWptGroupBox->LastRowLastCol(), "Add exit wpt");
+
+  // Show wpt group
+  showWptGroupBox = new GroupBox(settingsTab->NewRow(), "Show waypoints");
+  listMissionWpt = new ListWidget(showWptGroupBox->NewRow(), "Mission wpt");
+  listEntranceWpt = new ListWidget(showWptGroupBox->LastRowLastCol(), "Entrance wpt");
+  listExitWpt = new ListWidget(showWptGroupBox->LastRowLastCol(), "Exit wpt");
+  btnRemoveMissionWpt = new PushButton(showWptGroupBox->NewRow(), "Remove mission wpt");
+  btnRemoveEntranceWpt = new PushButton(showWptGroupBox->LastRowLastCol(), "Remove entrance wpt");
+  btnRemoveExitWpt = new PushButton(showWptGroupBox->LastRowLastCol(), "Remove exit wpt");
+
+  // Action wpt group
+  actionWptGroupBox = new GroupBox(settingsTab->NewRow(), "Action");
+  btnSendWpt = new PushButton(actionWptGroupBox->NewRow(), "Send wpt");
+  btnClearWpt = new PushButton(actionWptGroupBox->LastRowLastCol(), "Clear wpt");
+  btnLoop = new PushButton(actionWptGroupBox->LastRowLastCol(), "Loop");
+
+  //TODO IP & PORT from config.h file
+  sendSocket = new Socket((Thread *)this, "send socket", "127.0.0.1:5000");
+}
+
+GuiInterface::~GuiInterface() {
+}
+
+void GuiInterface::Run() {
+  Thread::Info("Debug: enter MavPlanner acquisition loop\n");
+
+  if (getFrameworkManager()->ErrorOccured()) {
+    SafeStop();
+    Thread::Err("An error occurred, we don't launch the Run loop.\n");
+  }
+
+  while (!ToBeStopped()) {
+    // TODO : time from config.h
+    Thread::SleepMS(500);
+    // Buttons to control GUI
+  	if (btnAddMissionWpt->Clicked()) {
+  		listMissionWpt->AddItem(GetWptLatLon());
+    }
+  	if (btnAddEntranceWpt->Clicked()) {
+  		listEntranceWpt->AddItem(GetWptLatLon());
+    }
+  	if (btnAddExitWpt->Clicked()) {
+  		listExitWpt->AddItem(GetWptLatLon());
+    }
+    if (btnRemoveMissionWpt->Clicked()) {
+      listMissionWpt->RemoveItem();
+    }
+    if (btnRemoveEntranceWpt->Clicked()) {
+      listEntranceWpt->RemoveItem();
+    }
+    if (btnRemoveExitWpt->Clicked()) {
+      listExitWpt->RemoveItem();
+    }
+    // Buttons to send commands
+  	if (btnInitialize->Clicked()) {
+  		MissionInitialize();
+    }
+  	if (btnStartMission->Clicked()) {
+  		MissionStart();
+    }
+  	if (btnStopMission->Clicked()) {
+  		MissionStop();
+    }
+  	if (btnKill->Clicked()) {
+  		MissionKill();
+    }
+    if (btnSendWpt->Clicked()) {
+  		WptSend();
+    }
+  	if (btnClearWpt->Clicked()) {
+  		WptClear();
+    }
+  	if (btnLoop->Clicked()) {
+  		WptLoopSend();
+    }
+  }
+}
+
+std::string GuiInterface::GetWptLatLon() {
+  std::ostringstream stringStream;
+  stringStream.precision(3);
+  stringStream << fixed;
+  stringStream << latField->Value() << " - " << lonField->Value();
+  return stringStream.str();
+}
+
Index: branches/mavlink/tools/Controller/Mavlink/src/GuiInterface.h
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/GuiInterface.h	(revision 71)
+++ branches/mavlink/tools/Controller/Mavlink/src/GuiInterface.h	(revision 71)
@@ -0,0 +1,102 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/09/02
+//  filename:   GuiInterface.h
+//
+//  authors:    Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Create the GUI and give an abstract interface to it
+//
+//
+/*********************************************************************/
+
+#ifndef MAVPLANNER_GUI_INTERFACE_H
+#define MAVPLANNER_GUI_INTERFACE_H
+
+#include <string>
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+  class FrameworkManager;
+  class Socket;
+}
+namespace gui {
+  class Tab;
+  class TabWidget;
+  class DoubleSpinBox;
+  class PushButton;
+  class ComboBox;
+  class GroupBox;
+  class ListWidget;
+}
+}
+
+class GuiInterface : public flair::core::Thread {
+public:
+
+  GuiInterface(const flair::core::FrameworkManager *parent, std::string name);
+  ~GuiInterface();
+
+protected:
+  // reimplement the run of the Thread class
+  void Run();
+
+  std::string GetWptLatLon();
+  
+  // First tab callbacks
+  virtual void MissionInitialize() = 0;
+  virtual void MissionStart() = 0;
+  virtual void MissionStop() = 0;
+  virtual void MissionKill() = 0;
+  virtual void WptSend() = 0;
+  virtual void WptClear() = 0;
+  virtual void WptLoopSend() = 0;
+
+  // Main GUI
+  flair::gui::TabWidget* tabWidget;
+  flair::gui::Tab* mainTab;
+  flair::gui::Tab* settingsTab;
+
+  // Controls groupbox
+  flair::gui::GroupBox* controlsGroupBox;
+  flair::gui::PushButton* btnInitialize;
+  flair::gui::PushButton* btnStartMission;
+  flair::gui::PushButton* btnStopMission;
+  flair::gui::PushButton* btnKill;
+  
+  // Add wpt groupbox
+  flair::gui::GroupBox* addWptGroupBox;
+  flair::gui::DoubleSpinBox* latField;
+  flair::gui::DoubleSpinBox* lonField;
+  flair::gui::PushButton* btnAddMissionWpt;
+  flair::gui::PushButton* btnAddEntranceWpt;
+  flair::gui::PushButton* btnAddExitWpt;
+
+  // Show wpt groupbox
+  flair::gui::GroupBox* showWptGroupBox;
+  flair::gui::ListWidget* listMissionWpt;
+  flair::gui::ListWidget* listEntranceWpt;
+  flair::gui::ListWidget* listExitWpt;
+  flair::gui::PushButton* btnRemoveMissionWpt;
+  flair::gui::PushButton* btnRemoveEntranceWpt;
+  flair::gui::PushButton* btnRemoveExitWpt;  
+
+  // Action wpt groupbox
+  flair::gui::GroupBox* actionWptGroupBox;
+  flair::gui::PushButton* btnSendWpt;
+  flair::gui::PushButton* btnClearWpt;
+  flair::gui::PushButton* btnLoop;
+
+  // Socket to send commands
+  flair::core::Socket* sendSocket;
+
+  //TODO : think if useful to have private members
+};
+
+#endif // MAVPLANNER_GUI_INTERFACE_H
Index: branches/mavlink/tools/Controller/Mavlink/src/main.cpp
===================================================================
--- branches/mavlink/tools/Controller/Mavlink/src/main.cpp	(revision 52)
+++ branches/mavlink/tools/Controller/Mavlink/src/main.cpp	(revision 71)
@@ -17,36 +17,63 @@
 
 #include "FrameworkManager.h"
-#include "Mavlink_test.h"
 #include <stdio.h>
 #include <tclap/CmdLine.h>
+
+#include "GuiFlair.h"
+#include "GuiGcs.h"
+#include "Forwarder.h"
+
+//todo remove for tests
+#include <iostream>
 
 using namespace TCLAP;
 using namespace std;
 using namespace flair::core;
-using namespace flair::sensor;
 
-string receiverAddress;
-int receiverPort;
-int port;
-string xml_file;
+string xmlFile;
+string mode;
+string inputAddress;
+int inputPort;
+string outputAddress;
+int outputPort;
+string flairAddress;
+int flairPort;
 
 void parseOptions(int argc, char **argv);
 
 int main(int argc, char *argv[]) {
+  std::cout << "avant parseOptions" << std::endl;
   parseOptions(argc, argv);
 
+  std::cout << "parseOptions ok" << std::endl;
+
   FrameworkManager *manager;
-  Mavlink *mavlink_handler;
+  manager = new FrameworkManager("mavlink");
+  manager->SetupConnection(flairAddress, flairPort);
+  manager->SetupUserInterface(xmlFile);
 
-  manager = new FrameworkManager("mavlink");
-  manager->SetupConnection("127.0.0.1", port);
-  manager->SetupUserInterface(xml_file);
+  std::cout << "MavPlanner mode : " << mode << std::endl;
 
-  mavlink_handler = new Mavlink(manager, "mavlink", receiverAddress,
-                                   receiverPort);
-
-  if (!manager->ErrorOccured()) {
-    mavlink_handler->Start();
-    mavlink_handler->Join();
+  if(mode == "forward") {
+    Forwarder *guiForwarder = new Forwarder(manager, "Forwarder",
+                                           inputAddress, inputPort,
+                                           outputAddress, outputPort);
+    if (!manager->ErrorOccured()) {
+      guiForwarder->Start();
+      guiForwarder->Join();
+    }
+  } else {
+    GuiInterface *guiHandler;
+    if(mode == "flair") {
+      guiHandler = new GuiFlair(manager, "GuiFlair");
+    } else if (mode == "gcs") {
+      guiHandler = new GuiGcs(manager, "GuiGcs", outputAddress, outputPort);
+    } else {
+      //ERROR
+    }
+    if (!manager->ErrorOccured()) {
+      guiHandler->Start();
+      guiHandler->Join();
+    }
   }
 
@@ -58,13 +85,33 @@
     CmdLine cmd("Command description message", ' ', "0.1");
 
-    ValueArg<string> addressArg("a", "address",
-                                "data receiver address (ex: uav)", true,
-                                "127.0.0.1:20000", "string");
-    cmd.add(addressArg);
+    ValueArg<string> inputAddressArg("", "inputAddress",
+                                "input IP address", false,
+                                "127.0.0.1", "string");
+    cmd.add(inputAddressArg);
 
-    ValueArg<int> portArg("p", "port",
-                          "local port used to connect to the ground station",
-                          false, 9000, "int");
-    cmd.add(portArg);
+    ValueArg<int> inputPortArg("", "inputPort",
+                          "input IP port", false,
+                          9000, "int");
+    cmd.add(inputPortArg);
+
+    ValueArg<string> outputAddressArg("", "outputAddress",
+                                      "output IP address", false,
+                                      "127.0.0.1", "string");
+    cmd.add(outputAddressArg);
+
+    ValueArg<int> outputPortArg("", "outputPort",
+                               "output IP port", false,
+                               9000, "int");
+    cmd.add(outputPortArg);
+
+    ValueArg<string> flairAddressArg("a", "flairAddress",
+                                      "flair IP address", true,
+                                      "127.0.0.1", "string");
+    cmd.add(flairAddressArg);
+
+    ValueArg<int> flairPortArg("p", "flairPort",
+                               "flair IP port", true,
+                               9000, "int");
+    cmd.add(flairPortArg);
 
     ValueArg<string> xmlArg("x", "xml", "xml file", true, "./settings.xml",
@@ -72,14 +119,25 @@
     cmd.add(xmlArg);
 
+    ValueArg<string> modeArg("m", "mode", "application mode (forward, flair, gcs)",
+                             true, "flair", "string");
+    cmd.add(modeArg);
+
     cmd.parse(argc, argv);
 
+    // string receiverAddressWithPort = inputAddressArg.getValue();
+    // int semiColonPosition = receiverAddressWithPort.find(":");
+    // receiverAddress = receiverAddressWithPort.substr(0, semiColonPosition);
+    // receiverPort =
+    //     atoi(receiverAddressWithPort.substr(semiColonPosition + 1).c_str());
+    
     // Get the value parsed by each arg.
-    string receiverAddressWithPort = addressArg.getValue();
-    int semiColonPosition = receiverAddressWithPort.find(":");
-    receiverAddress = receiverAddressWithPort.substr(0, semiColonPosition);
-    receiverPort =
-        atoi(receiverAddressWithPort.substr(semiColonPosition + 1).c_str());
-    port = portArg.getValue();
-    xml_file = xmlArg.getValue();
+    inputAddress = inputAddressArg.getValue();
+    inputPort = inputPortArg.getValue();
+    outputAddress = outputAddressArg.getValue();
+    outputPort = outputPortArg.getValue();
+    flairAddress = flairAddressArg.getValue();
+    flairPort = flairPortArg.getValue();
+    xmlFile = xmlArg.getValue();
+    mode = modeArg.getValue();
 
   } catch (ArgException &e) { // catch any exceptions
