Fixed some errors in the controller related to the temperature sensor component.

This commit is contained in:
2021-09-24 21:18:38 +02:00
parent 58a3cd34ed
commit ad8797f57a
17 changed files with 65 additions and 62 deletions

View File

@ -67,7 +67,6 @@ ReturnValue_t DeviceHandlerBase::performOperation(uint8_t counter) {
this->pstStep = counter;
if (getComAction() == SEND_WRITE) {
sif::debug<<"DH_base: performOp1"<<std::endl;
cookieInfo.state = COOKIE_UNUSED;
readCommandQueue();
doStateMachine();
@ -84,22 +83,17 @@ ReturnValue_t DeviceHandlerBase::performOperation(uint8_t counter) {
switch (getComAction()) {
case SEND_WRITE:
if ((cookieInfo.state == COOKIE_UNUSED)) {
sif::debug<<"DH_base: performOp2"<<std::endl;
buildInternalCommand();
}
sif::debug<<"DH_base: performOp3"<<std::endl;
doSendWrite();
break;
case GET_WRITE:
sif::debug<<"DH_base: performOp4"<<std::endl;
doGetWrite();
break;
case SEND_READ:
sif::debug<<"DH_base: performOp5"<<std::endl;
doSendRead();
break;
case GET_READ:
sif::debug<<"DH_base: performOp6"<<std::endl;
doGetRead();
cookieInfo.state = COOKIE_UNUSED;
break;
@ -665,19 +659,15 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData,
// scanForReply routines.
uint32_t remainingLength = receivedDataLen;
for (uint32_t count = 0; count < receivedDataLen; count++) {
sif::debug<<"DH_base: debug0"<<std::endl;
result = scanForReply(receivedData, remainingLength, &foundId,
&foundLen);
sif::debug<<"DH_base: debug01"<<std::endl;
switch (result) {
case RETURN_OK:
handleReply(receivedData, foundId, foundLen);
break;
case APERIODIC_REPLY: {
sif::debug<<"DH_base: debug1"<<std::endl;
result = interpretDeviceReply(foundId, receivedData);
if (result != RETURN_OK) {
sif::debug<<" DH_base: debug2"<<std::endl;
replyRawReplyIfnotWiretapped(receivedData, foundLen);
triggerEvent(DEVICE_INTERPRETING_REPLY_FAILED, result,
foundId);
@ -689,7 +679,6 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData,
case IGNORE_FULL_PACKET:
return;
default:
sif::debug<<"DH_base: debug02"<<std::endl;
//We need to wait for timeout.. don't know what command failed and who sent it.
replyRawReplyIfnotWiretapped(receivedData, foundLen);
triggerEvent(DEVICE_READING_REPLY_FAILED, result, foundLen);
@ -698,9 +687,7 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData,
receivedData += foundLen;
if (remainingLength > foundLen) {
remainingLength -= foundLen;
sif::debug<<"DH_base: debug3"<<std::endl;
} else {
sif::debug<<"DH_base: debug4"<<std::endl;
return;
}
}