@@ -88,6 +88,7 @@ bool TacxFTMS::init() {
8888 std::cerr << " Devicename found" << i->deviceName << std::endl;
8989 if (i->deviceName == " TacxNeo" ) {
9090 supportedDeviceFound = true ;
91+ start ();
9192 }
9293 else if (i->deviceName == " Alpine" )
9394 {
@@ -128,7 +129,7 @@ void TacxFTMS::addDevice(const opencover::deviceInfo *i)
128129 // unsigned short localPortAlpine = configInt("Alpine", "localPort", 31322)->value();
129130 std::string host = " " ;
130131 std::cerr << " Devicename found" << i->deviceName << std::endl;
131- if (i->deviceName == " TacxNeo" )
132+ if (i->deviceName == " TacxNeo" && udpNeo == nullptr )
132133 {
133134 host = i->address ;
134135 std::cerr << " TacxFTMS config: UDP: TacxHost: " << host << std::endl;
@@ -267,12 +268,14 @@ void TacxFTMS::run() {
267268}
268269
269270void TacxFTMS::updateThread () {
271+ std::cerr << " ut" << endl;
270272 if (udpListen) {
271273 char tmpBuf[10000 ];
272274 int status;
273275
274276 status = udpListen->receive (&tmpBuf, 10000 );
275277
278+ std::cerr << " status" << status << endl;
276279 if (status == -1 ) {
277280 if (isEnabled ()) // otherwise we are not supposed to receive
278281 // anything
@@ -281,16 +284,17 @@ void TacxFTMS::updateThread() {
281284 << std::endl;
282285 }
283286 } else if (status >= sizeof (FTMSBikeData)) {
284- if (!isEnabled ()) {
287+ /* if (!isEnabled()) {
285288 if (udpNeo) // still receiving data, send stop
286289 udpNeo->send("stop");
287290 if (udpAlpine)
288291 udpAlpine->send("stop");
289292 return;
290- }
293+ }*/
291294 OpenThreads::ScopedLock<OpenThreads::Mutex> lock (mutex);
292295 memcpy (&ftmsData, tmpBuf, sizeof (FTMSBikeData));
293296 sendIndoorBikeSimulationParameters ();
297+ cerr << " speed" << ftmsData.speed << endl;
294298
295299 } else if (status >= sizeof (AlpineData)) {
296300
0 commit comments