Changeset 20 in flair-src


Ignore:
Timestamp:
Apr 12, 2016, 4:26:41 PM (5 years ago)
Author:
Sanahuja Guillaume
Message:

correction bug recpetion log et watchdog

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/FrameworkManager_impl.cpp

    r15 r20  
    101101  ui_defined = false;
    102102  rcv_buf = NULL;
     103  gcs_watchdog = NULL;
    103104  _this = this;
    104105
     
    215216  UDT::setsockopt(file_sock, 0, UDT_RCVSYN, &blocking, sizeof(bool));
    216217
    217   // configure timeout of blocking receive, short timeout to have priority on
    218   // the other socket (see run method)
    219   int timeout = 1; // ms
    220   UDT::setsockopt(file_sock, 0, UDT_RCVTIMEO, &timeout, sizeof(int));
    221 
    222   timeout = 100; // ms
     218  int timeout = 100; // ms
    223219  UDT::setsockopt(com_sock, 0, UDT_RCVTIMEO, &timeout, sizeof(int));
    224220
     
    453449    Err("UDT::sendmsg error, sent %i/%i\n", nb_write, 1);
    454450  }
     451
     452    //wait end ACK
     453    int nb_read = UDT::recvmsg(file_sock,&buf,1);
     454    if(nb_read<0) {
     455    Err("UDT::recvmsg error (%s)\n",UDT::getlasterror().getErrorMessage());
     456    } else if (nb_read != 1)  {
     457    Err("UDT::recvmsg error, sent %i/%i\n",nb_read,1);
     458    }
    455459}
    456460
     
    813817        } else // stop logging
    814818        {
     819            //disable watchdog temporarly
     820            //this is necessary because GCS is no longer sending the heartbeat when receiving files...
     821            //TODO: add a thread in GCS for receiving file
     822            //but be careful that with a xbee modem for exemple, sending files can saturate communication and
     823            //avoid the heartbeat to be received... so disabling watchdog is not a so bad option...
     824            if(caller->gcs_watchdog!=NULL) {
     825                caller->gcs_watchdog->SafeStop();
     826                caller->gcs_watchdog->Join();
     827            }
    815828          for (size_t i = 0; i < logs.size(); i++) {
    816829            if (logs.at(i).dbtFile != NULL) {
     
    837850
    838851          logs.clear();
     852            //enable watchdog again
     853            if(caller->gcs_watchdog!=NULL) {
     854                caller->gcs_watchdog->Start();
     855            }
    839856        }
    840857      }
  • trunk/lib/FlairCore/src/Thread_impl.cpp

    r15 r20  
    7070
    7171  isRunning = true;
     72  tobestopped = false;
     73  is_suspended = false;
    7274
    7375#ifdef __XENO__
  • trunk/tools/FlairGCS/src/UdtSocket.cpp

    r15 r20  
    192192    file_dialog->endOfFiles();
    193193    flag_new_seq = true;
     194    //end ack
     195    UDT::sendmsg(file_socket,&recv_buf[0],1);
    194196  }
    195197}
Note: See TracChangeset for help on using the changeset viewer.