2021-04-04 21:04:12 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
|
|
|
|
|
{
|
|
|
|
|
class Response
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
unsigned char responseId = 0x00;
|
|
|
|
|
|
|
|
|
|
std::vector<unsigned char> data;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void setResponseId(unsigned char commandId) {
|
|
|
|
|
this->responseId = commandId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setData(const std::vector<unsigned char>& data) {
|
|
|
|
|
this->data = data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
Response() = default;
|
2021-04-06 02:10:14 +01:00
|
|
|
virtual void init(const std::vector<unsigned char>& rawResponse);
|
2021-04-04 21:04:12 +01:00
|
|
|
|
|
|
|
|
unsigned char getResponseId() const {
|
|
|
|
|
return this->responseId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual const std::vector<unsigned char>& getData() const {
|
|
|
|
|
return this->data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual ~Response() = default;
|
|
|
|
|
};
|
|
|
|
|
}
|