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

16 lines
470 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 DebugToolDrivers::Protocols::CmsisDap
{
Response::Response(const std::vector<unsigned char>& rawResponse) {
if (rawResponse.empty()) {
throw Exceptions::Exception{"Failed to process CMSIS-DAP response - invalid response"};
}
this->id = rawResponse[0];
this->data = std::vector<unsigned char>{rawResponse.begin() + 1, rawResponse.end()};
2021-04-04 21:04:12 +01:00
}
}