fixed some bugs
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -125,8 +125,9 @@ ReturnValue_t RwHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand
|
||||
uint8_t* currentCmdBuf = commandBuffer + 1;
|
||||
rwSpeedActuationSet.serialize(¤tCmdBuf, &rawPacketLen, sizeof(commandBuffer),
|
||||
SerializeIF::Endianness::MACHINE);
|
||||
commandBuffer[rawPacketLen] = static_cast<uint8_t>(rws::SpecialRwRequest::REQUEST_NONE);
|
||||
break;
|
||||
commandBuffer[rawPacketLen++] = static_cast<uint8_t>(rws::SpecialRwRequest::REQUEST_NONE);
|
||||
rawPacket = commandBuffer;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
case (rws::RESET_MCU): {
|
||||
commandBuffer[0] = false;
|
||||
@ -236,7 +237,10 @@ void RwHandler::fillCommandAndReplyMap() {
|
||||
|
||||
ReturnValue_t RwHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
||||
DeviceCommandId_t* foundId, size_t* foundLen) {
|
||||
// uint8_t replyByte = *start;
|
||||
if (getMode() == _MODE_WAIT_OFF) {
|
||||
return IGNORE_FULL_PACKET;
|
||||
}
|
||||
// sif::debug << "base mode: " << baseMode << std::endl;
|
||||
if (remainingSize > 0) {
|
||||
*foundLen = remainingSize;
|
||||
*foundId = rws::REPLY_ID;
|
||||
@ -293,7 +297,7 @@ ReturnValue_t RwHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_
|
||||
auto packetLen = rws::idToPacketLen(id);
|
||||
uint16_t replyCrc = (*(packet + packetLen - 1) << 8) | *(packet + packetLen - 2);
|
||||
if (CRC::crc16ccitt(packet, packetLen - 2, 0xFFFF) != replyCrc) {
|
||||
sif::error << "RwHandler::interpretDeviceReply: CRC error for ID " << id << std::endl;
|
||||
// sif::error << "RwHandler::interpretDeviceReply: CRC error for ID " << id << std::endl;
|
||||
return CRC_ERROR;
|
||||
}
|
||||
if (packetPtr[1] == rws::STATE_ERROR) {
|
||||
|
Reference in New Issue
Block a user