IMTQ Commanding Fix #430
@ -194,17 +194,18 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma
|
||||
return DeviceHandlerIF::INVALID_COMMAND_PARAMETER;
|
||||
}
|
||||
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);
|
||||
|
||||
int16_t xDipole = 0, yDipole = 0, zDipole = 0;
|
||||
uint16_t torqueDuration = 0;
|
||||
dipoleSet.xDipole = xDipole;
|
||||
dipoleSet.yDipole = yDipole;
|
||||
dipoleSet.zDipole = zDipole;
|
||||
dipoleSet.currentTorqueDurationMs = torqueDuration;
|
||||
// Commands override anything which was set in the software
|
||||
if (commandData != nullptr) {
|
||||
dipoleSet.setValidityBufferGeneration(false);
|
||||
ReturnValue_t result = dipoleSet.deSerialize(&commandData, &commandDataLen,
|
||||
SerializeIF::Endianness::NETWORK);
|
||||
dipoleSet.setValidityBufferGeneration(true);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
request.setActuateRequest(dipoleSet.xDipole.value, dipoleSet.yDipole.value,
|
||||
|
Loading…
Reference in New Issue
Block a user