use dipoleSet or overwrite it in case of external command
This commit is contained in:
parent
b20266f153
commit
f041655378
@ -194,17 +194,18 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma
|
|||||||
return DeviceHandlerIF::INVALID_COMMAND_PARAMETER;
|
return DeviceHandlerIF::INVALID_COMMAND_PARAMETER;
|
||||||
}
|
}
|
||||||
ImtqRequest request(commandBuffer, sizeof(commandBuffer));
|
ImtqRequest request(commandBuffer, sizeof(commandBuffer));
|
||||||
// Commands override anything which was set in the software
|
{
|
||||||
if (commandData != nullptr) {
|
|
||||||
// Read set dipole values from local pool
|
|
||||||
PoolReadGuard pg(&dipoleSet);
|
PoolReadGuard pg(&dipoleSet);
|
||||||
|
// Commands override anything which was set in the software
|
||||||
int16_t xDipole = 0, yDipole = 0, zDipole = 0;
|
if (commandData != nullptr) {
|
||||||
uint16_t torqueDuration = 0;
|
dipoleSet.setValidityBufferGeneration(false);
|
||||||
dipoleSet.xDipole = xDipole;
|
ReturnValue_t result = dipoleSet.deSerialize(&commandData, &commandDataLen,
|
||||||
dipoleSet.yDipole = yDipole;
|
SerializeIF::Endianness::NETWORK);
|
||||||
dipoleSet.zDipole = zDipole;
|
dipoleSet.setValidityBufferGeneration(true);
|
||||||
dipoleSet.currentTorqueDurationMs = torqueDuration;
|
if (result != returnvalue::OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
request.setActuateRequest(dipoleSet.xDipole.value, dipoleSet.yDipole.value,
|
request.setActuateRequest(dipoleSet.xDipole.value, dipoleSet.yDipole.value,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user