Changeset 86 in flair-src for branches/mavlink/tools
- Timestamp:
- Sep 28, 2016, 8:36:04 AM (8 years ago)
- Location:
- branches/mavlink/tools/Controller/Mavlink/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mavlink/tools/Controller/Mavlink/src/Forwarder.cpp
r71 r86 38 38 // cout << "MavPlanner Forwarder output address : " << tmpOutput << endl; 39 39 40 cout << "input socket : " << inputAddress + ":" + to_string(inputPort) << endl;41 cout << "output socket : " << outputAddress + ":" + to_string(outputPort) << endl;40 // cout << "input socket : " << inputAddress + ":" + to_string(inputPort) << endl; 41 // cout << "output socket : " << outputAddress + ":" + to_string(outputPort) << endl; 42 42 43 inputSocket = new Socket((Thread *)this, "input socket", input Address + ":" + to_string(inputPort));43 inputSocket = new Socket((Thread *)this, "input socket", inputPort); 44 44 outputSocket = new Socket((Thread *)this, "output socket", outputAddress + ":" + to_string(outputPort)); 45 45 } … … 55 55 } 56 56 int recvDataSize = 0; 57 char* srcBuffer; 58 size_t srcSize; 57 char inputBuffer[200]; 59 58 while (!ToBeStopped()) { 60 // Thread::SleepMS(2000); 61 // TIME_NONBLOCK 62 recvDataSize = inputSocket->RecvMessage(inputBuffer, 200, 5000000000, srcBuffer, &srcSize); 63 cout << "Forwarder message received, size="<< recvDataSize << endl; 64 outputSocket->SendMessage(inputBuffer, recvDataSize); 59 recvDataSize = inputSocket->RecvMessage(inputBuffer, 200, 1000000000); 60 outputSocket->SendMessage(inputBuffer, recvDataSize); 65 61 } 66 62 } -
branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.cpp
r85 r86 35 35 cout << "MavPlanner GuiFlair constructor" << endl; 36 36 37 //outputSocket = new Socket((Thread *)this, "output socket", "127.0.0.1:5036");37 outputSocket = new Socket((Thread *)this, "output socket", "127.0.0.1:5036"); 38 38 39 39 // outputSocket = new Socket(parent, "output socket", "127.255.255.255:9001", true); 40 outputSocket = new Socket(parent, "output socket", 9001);40 inputSocket = new Socket((Thread *)this, "input socket", 9001); 41 41 } 42 42 … … 49 49 50 50 int received = 0; 51 char receiveFrameBuffer[ 50];51 char receiveFrameBuffer[200]; 52 52 53 53 std::string message_to_send("Test of sending a message"); … … 57 57 58 58 do { 59 received=outputSocket->RecvMessage(receiveFrameBuffer,50, TIME_NONBLOCK); 59 // cout << "." << endl; 60 received=inputSocket->RecvMessage(receiveFrameBuffer,200, TIME_NONBLOCK); 61 // cout << "." << endl; 60 62 if (received > 0) { 61 cout << "MavPlanner GuiFlair MissionStart data received !!!" << endl; 63 cout << "MavPlanner GuiFlair MissionStart data received : " << receiveFrameBuffer << endl; 64 outputSocket->SendMessage(receiveFrameBuffer, received); 62 65 } 63 } while (received == 0);66 } while (received != 0); 64 67 } 65 68 -
branches/mavlink/tools/Controller/Mavlink/src/GuiFlair.h
r85 r86 45 45 46 46 private: 47 flair::core::Socket *inputSocket; 47 48 flair::core::Socket *outputSocket; 48 49 std::string outputAddress;
Note:
See TracChangeset
for help on using the changeset viewer.