2021-04-04 21:04:12 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
|
|
|
|
|
{
|
|
|
|
|
class Response
|
|
|
|
|
{
|
|
|
|
|
public:
|
2022-02-28 16:27:24 +00:00
|
|
|
Response(const std::vector<unsigned char>& rawResponse);
|
2021-10-06 21:12:31 +01:00
|
|
|
virtual ~Response() = default;
|
|
|
|
|
|
2022-01-11 21:12:25 +00:00
|
|
|
Response(const Response& other) = default;
|
|
|
|
|
Response(Response&& other) = default;
|
|
|
|
|
|
|
|
|
|
Response& operator = (const Response& other) = default;
|
|
|
|
|
Response& operator = (Response&& other) = default;
|
|
|
|
|
|
2021-06-22 23:52:31 +01:00
|
|
|
[[nodiscard]] unsigned char getResponseId() const {
|
2021-04-04 21:04:12 +01:00
|
|
|
return this->responseId;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-22 23:52:31 +01:00
|
|
|
[[nodiscard]] virtual const std::vector<unsigned char>& getData() const {
|
2021-04-04 21:04:12 +01:00
|
|
|
return this->data;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-06 21:12:31 +01:00
|
|
|
protected:
|
|
|
|
|
void setResponseId(unsigned char commandId) {
|
|
|
|
|
this->responseId = commandId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setData(const std::vector<unsigned char>& data) {
|
|
|
|
|
this->data = data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
unsigned char responseId = 0x00;
|
|
|
|
|
std::vector<unsigned char> data;
|
2021-04-04 21:04:12 +01:00
|
|
|
};
|
|
|
|
|
}
|