Files
BloomPatched/src/DebugToolDrivers/Protocols/CMSIS-DAP/Response.cpp

16 lines
490 B
C++
Raw Normal View History

2021-04-04 21:04:12 +01:00
#include "Response.hpp"
2021-10-02 17:39:27 +01:00
#include "src/Exceptions/Exception.hpp"
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
{
void Response::init(const std::vector<unsigned char>& rawResponse) {
if (rawResponse.empty()) {
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()));
2021-04-04 21:04:12 +01:00
}
}