Changeset 85 in flair-src for branches/mavlink/tools


Ignore:
Timestamp:
09/23/16 15:34:40 (8 years ago)
Author:
Thomas Fuhrmann
Message:

Test of using flair udp

Location:
branches/mavlink/tools/Controller/Mavlink/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.cpp

    r84 r85  
    2020#include "GuiInterface.h"
    2121
     22#include <FrameworkManager.h>
     23#include <Socket.h>
     24
    2225//todo remove for tests
    2326#include <iostream>
     
    3033GuiFlair::GuiFlair(const FrameworkManager *parent, string name):
    3134                                   GuiInterface(parent, name) {
    32         cout << "MavPlanner GuiFlair constructor" << endl;                                     
     35        cout << "MavPlanner GuiFlair constructor" << endl;
     36
     37        // outputSocket = new Socket((Thread *)this, "output socket", "127.0.0.1:5036");
     38
     39        // outputSocket = new Socket(parent, "output socket", "127.255.255.255:9001", true);
     40        outputSocket = new Socket(parent, "output socket", 9001);
    3341}
    3442
     
    3947void GuiFlair::MissionStart() {
    4048        cout << "MavPlanner GuiFlair MissionStart" << endl;
     49
     50        int received = 0;
     51        char receiveFrameBuffer[50];
     52
     53        std::string message_to_send("Test of sending a message");
     54
     55        //fonctionne en récéption si on prend un broadcast pour la création du socket
     56        // outputSocket->SendMessage(message_to_send);
     57
     58        do {
     59                received=outputSocket->RecvMessage(receiveFrameBuffer,50, TIME_NONBLOCK);
     60                if (received > 0) {
     61                   cout << "MavPlanner GuiFlair MissionStart data received !!!" << endl;
     62                }
     63        } while (received == 0);
    4164}
    4265
  • branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.h

    r84 r85  
    2727namespace core {
    2828  class FrameworkManager;
     29  class Socket;
    2930}
    3031}
     
    4243  virtual void MissionPause();
    4344  virtual void MissionSend();
     45
     46private:
     47  flair::core::Socket *outputSocket;
     48  std::string outputAddress;
     49  int outputPort;       
    4450};
    4551
  • branches/mavlink/tools/Controller/Mavlink/src/GuiInterface.cpp

    r84 r85  
    101101
    102102  //TODO IP & PORT from config.h file
    103   sendSocket = new Socket((Thread *)this, "send socket", "127.0.0.1:5000");
     103  // sendSocket = new Socket((Thread *)this, "send socket", "127.0.0.1:5000");
    104104}
    105105
Note: See TracChangeset for help on using the changeset viewer.