Files
BloomPatched/src/DebugToolDrivers/Protocols/CMSIS-DAP/Response.cpp
2021-04-06 23:20:50 +01:00

16 lines
469 B
C++

#include "src/Exceptions/Exception.hpp"
#include "Response.hpp"
using namespace Bloom::DebugToolDrivers::Protocols::CmsisDap;
void Response::init(const std::vector<unsigned char>& rawResponse)
{
if (rawResponse.size() < 1) {
throw Exceptions::Exception("Failed to process CMSIS-DAP response - invalid response");
}
this->setResponseId(rawResponse[0]);
this->setData(std::vector<unsigned char>(rawResponse.begin() + 1, rawResponse.end()));
}