diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index ebebcb44..90b9c14f 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -827,10 +827,14 @@ ReturnValue_t PlocSupervisorHandler::verifyPacket(const uint8_t* start, size_t f } ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) { - ReturnValue_t result = RETURN_OK; + using namespace supv; + ReturnValue_t result = RETURN_OK; - result = verifyPacket(data, supv::SIZE_ACK_REPORT); - if (result == SupvReturnValuesIF::CRC_FAILURE) { + AcknowledgmentReport ack; + ack.addWholeData(data, SIZE_ACK_REPORT); + + result = ack.checkCrc(); + if (result != RETURN_OK) { sif::error << "PlocSupervisorHandler::handleAckReport: CRC failure" << std::endl; nextReplyId = supv::NONE; replyRawReplyIfnotWiretapped(data, supv::SIZE_ACK_REPORT); @@ -842,7 +846,9 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) { uint16_t apid = (*(data) << 8 | *(data + 1)) & APID_MASK; - switch (apid) { + result = ack.checkApid(); + + switch (result) { case supv::APID_ACK_FAILURE: { // TODO: Interpretation of status field in acknowledgment report sif::debug << "PlocSupervisorHandler::handleAckReport: Received Ack failure report"