Ignore:
Timestamp:
Sep 23, 2016, 3:34:40 PM (9 years ago)
Author:
Thomas Fuhrmann
Message:

Test of using flair udp

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.