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

41 lines
1017 B
C++
Raw Normal View History

2021-04-04 21:04:12 +01:00
#pragma once
#include <vector>
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
{
class Response
{
public:
Response(const std::vector<unsigned char>& rawResponse);
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;
[[nodiscard]] unsigned char getResponseId() const {
2021-04-04 21:04:12 +01:00
return this->responseId;
}
[[nodiscard]] virtual const std::vector<unsigned char>& getData() const {
2021-04-04 21:04:12 +01:00
return this->data;
}
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
};
}