Ignore:
Timestamp:
Jun 23, 2016, 10:15:30 AM (5 years ago)
Author:
Bayard Gildas
Message:

Modif. pour ajour manette émulée (EmulatedController?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSensorActuator/src/TargetEthController.cpp

    r15 r38  
    8080  bool fullDatagramReceived = false;
    8181
    82   do {
    83     received =
    84         dataSocket->RecvMessage(receiveFrameBuffer + receiveCurrentPosition,
    85                                 bytesToReceive, TIME_NONBLOCK);
    86     if (received > 0) {
    87       bytesToReceive -= received;
    88       if (bytesToReceive == 0) {
    89         // a full datagram has been read in receiveFrameBuffer
    90         fullDatagramReceived = true;
    91         receiveCurrentPosition = 0;
    92         // we swap the data and reception buffers to avoid copy
    93         char *swapFrameBuffer = dataFrameBuffer;
    94         dataFrameBuffer = receiveFrameBuffer;
    95         receiveFrameBuffer = swapFrameBuffer;
    96       }
    97     }
    98   } while (!received < 0);
     82    do {
     83        received=dataSocket->RecvMessage(receiveFrameBuffer+receiveCurrentPosition,bytesToReceive,TIME_NONBLOCK);
     84        if (received>0) {
     85            receiveCurrentPosition+=received;
     86            bytesToReceive-=received;
     87            if (bytesToReceive==0) {
     88                //a full datagram has been read in receiveFrameBuffer
     89                fullDatagramReceived=true;
     90                //we swap the data and reception buffers to avoid copy
     91                char *swapFrameBuffer=dataFrameBuffer;
     92                dataFrameBuffer=receiveFrameBuffer;
     93                receiveFrameBuffer=swapFrameBuffer;
     94                receiveCurrentPosition=0;
     95                bytesToReceive=dataFrameSize;
     96            }
     97        }
     98    } while (!(received<0));
    9999
    100100  return fullDatagramReceived;
Note: See TracChangeset for help on using the changeset viewer.