Skip to content

Commit

Permalink
ping360: remove profile timeout for AUTO_DEVICE_DATA
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxzer committed Jan 31, 2024
1 parent 64fe3e5 commit 3a733aa
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/sensor/ping360.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,22 +419,15 @@ void Ping360::handleMessage(const ping_message& msg)
}

case Ping360Id::AUTO_DEVICE_DATA: {
// Stop profile message timeout, the data will be automatically sent
_timeoutProfileMessage.stop();

// Parse message
const ping360_auto_device_data autoDeviceData = *static_cast<const ping360_auto_device_data*>(&msg);

// Get angle to request next message
_angle = autoDeviceData.angle();

// Restart timer, if the channel allows it
if (link()->isWritable()) {
// Use 200ms for network delay
const int profileRunningTimeout = _angular_speed / _angularSpeedGradPerMs + 200;
_timeoutProfileMessage.start(profileRunningTimeout);
qCDebug(PING_PROTOCOL_PING360) << QString::asprintf("restarting timeout with %d ms", profileRunningTimeout);
} else {
qCDebug(PING_PROTOCOL_PING360) << "link is not writable to restart timeout";
}

_data.resize(autoDeviceData.data_length());
#pragma omp for
for (int i = 0; i < autoDeviceData.data_length(); i++) {
Expand Down

0 comments on commit 3a733aa

Please sign in to comment.