Skip to content

Commit

Permalink
sensor: ping360: allow _profileRequestLogic.type to be updated more t…
Browse files Browse the repository at this point in the history
…han once

this allows the logic type to be updated after a firmware update
  • Loading branch information
jaxxzer committed Dec 19, 2023
1 parent 8fcc835 commit 936358c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/sensor/ping360.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,13 @@ Ping360::Ping360()
_commonVariables.deviceInformation.firmware_version_patch);
qCDebug(PING_PROTOCOL_PING360) << "Firmware version:" << version;

// Wait for firmware information to be available before looking for new versions
static bool once = false;
if (!once && _commonVariables.deviceInformation.initialized) {
once = true;

if (_commonVariables.deviceInformation.initialized) {
if (version > QVersionNumber(3, 3, 0)) {
_profileRequestLogic.type = Ping360RequestStateStruct::Type::AutoTransmitAsync;
qCInfo(PING_PROTOCOL_PING360) << "using asynchronous automatic transmit strategy";
} else {
_profileRequestLogic.type = Ping360RequestStateStruct::Type::Legacy;
qCInfo(PING_PROTOCOL_PING360) << "using synchronous transmit strategy";
}
}
});
Expand Down

0 comments on commit 936358c

Please sign in to comment.