Changeset 249 in flair-src for trunk/lib/FlairSensorActuator/src
- Timestamp:
- Jun 27, 2018, 11:45:33 AM (6 years ago)
- Location:
- trunk/lib/FlairSensorActuator/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/TargetController.cpp
r246 r249 112 112 113 113 void TargetController::Run() { 114 SetPeriodMS(20);; //50Hz115 114 116 115 Message *message; … … 118 117 //if (getFrameworkManager()->ErrorOccured() || !ControllerInitialization()) { 119 118 if (!ControllerInitialization()) { 120 SafeStop();119 // SafeStop(); 121 120 Thread::Err("An error occured, we don't proceed with the loop.\n"); 122 121 } else { 123 124 122 axis = new Matrix((IODevice *)this, axisNumber, 1, floatType); 125 123 button = 126 124 new Matrix((IODevice *)this, buttonNumber, 1, SignedIntegerType(8)); 127 125 126 SetPeriodMS(20); //50Hz 128 127 while (!ToBeStopped()) { 129 128 // Thread::Info("Debug: entering acquisition loop\n"); … … 139 138 140 139 // send pending controller state change request(s) 141 142 140 while (changeStateQueue.size() != 0) { 143 141 message = changeStateQueue.front(); -
trunk/lib/FlairSensorActuator/src/TargetEthController.cpp
r238 r249 235 235 Thread::Info("Debug: Listening to port %d\n", listeningPort); 236 236 // accept incoming connection 237 bool connectionAccepted = false; 238 while (!connectionAccepted) { 237 while (!controlSocket) { 239 238 try { 240 239 controlSocket = listeningSocket->Accept(100000000); 241 240 } catch (std::logic_error &e) { 242 Thread::Err(e.what()); 243 return false; 241 Thread::Err("%s\n",e.what()); 242 if (ToBeStopped()) 243 return false; 244 244 } catch (std::runtime_error e) { 245 245 // timeout 246 if (ToBeStopped()) 247 return false; 248 } 249 if (controlSocket == nullptr) { 250 return false; 251 } else 252 connectionAccepted = true; 246 //Thread::Err("%s\n",e.what()); 247 if (ToBeStopped()) 248 return false; 249 } 253 250 } 254 251 Thread::Info("Debug: Connexion accepted\n"); -
trunk/lib/FlairSensorActuator/src/TargetEthController.h
r214 r249 77 77 core::TcpSocket *listeningSocket; 78 78 int listeningPort; 79 core::TcpSocket *controlSocket = NULL;79 core::TcpSocket *controlSocket = nullptr; 80 80 core::UdpSocket *dataSocket; 81 std::string *axisName = NULL;82 std::string *buttonName = NULL;81 std::string *axisName = nullptr; 82 std::string *buttonName = nullptr; 83 83 size_t dataFrameSize; 84 84 char *dataFrameBuffer;
Note:
See TracChangeset
for help on using the changeset viewer.