Skip to content

Commit c5eda1b

Browse files
committed
make alpine use the same port
1 parent 230fbe3 commit c5eda1b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/OpenCOVER/plugins/hlrs/TacxFTMS/TacxFTMS.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ bool TacxFTMS::init() {
8383
unsigned short serverPortNeo = configInt("TacxFTMS", "serverPort", 31319)->value();
8484
unsigned short localPortNeo = configInt("TacxFTMS", "localPort", 31322)->value();
8585

86-
unsigned short serverPortAlpine = configInt("Alpine", "serverPort", 31325)->value();
86+
unsigned short serverPortAlpine = configInt("Alpine", "serverPort", 31319)->value();
8787
unsigned short localPortAlpine = configInt("Alpine", "localPort", 31328)->value();
8888

8989

@@ -100,6 +100,7 @@ bool TacxFTMS::init() {
100100
std::string host = "";
101101
for (const auto& i :
102102
opencover::Input::instance()->discovery()->getDevices()) {
103+
std::cerr << "Devicename found" << i->deviceName << std::endl;
103104
if (i->deviceName == "TacxNeo") {
104105
host = i->address;
105106
std::cerr << "TacxFTMS config: UDP: TacxHost: " << host
@@ -121,6 +122,7 @@ bool TacxFTMS::init() {
121122
udpAlpine = new UDPComm(host.c_str(), serverPortAlpine, localPortAlpine);
122123
if (!udpAlpine->isBad()) {
123124
alpinefound = true;
125+
start();
124126
} else {
125127
std::cerr << "Alpine: failed to open local UDP port"
126128
<< localPortAlpine << std::endl;
@@ -271,6 +273,10 @@ void TacxFTMS::updateThread() {
271273
memcpy(&ftmsData, tmpBuf, sizeof(FTMSBikeData));
272274

273275
sendIndoorBikeSimulationParameters();
276+
} else if (status >= sizeof(AlpineData)) {
277+
278+
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(mutex);
279+
memcpy(&alpineData, tmpBuf, sizeof(AlpineData));
274280
} else {
275281
std::cerr << "TacxFTMS::update: received invalid no. of bytes: recv="
276282
<< status << ", got=" << status << std::endl;

0 commit comments

Comments
 (0)