Initial commit

This commit is contained in:
Nav
2021-04-04 21:04:12 +01:00
commit a29c5e1fec
549 changed files with 441216 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
#pragma once
#include <cstdint>
#include <vector>
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
{
class Command
{
private:
unsigned char commandId = 0x00;
std::vector<unsigned char> data;
public:
unsigned char getCommandId() const {
return this->commandId;
}
void setCommandId(unsigned char commandId) {
this->commandId = commandId;
}
virtual std::vector<unsigned char> getData() const {
return this->data;
}
void setData(const std::vector<unsigned char>& data) {
this->data = data;
}
[[nodiscard]] int getCommandSize() const {
// +1 for the command ID
return (int) (1 + this->getData().size());
}
std::uint16_t getDataSize() const {
return (std::uint16_t) this->getData().size();
}
/**
* Converts instance of a CMSIS Command to a vector of unsigned char (buffer), for sending
* to the debug tool.
*
* @return
*/
explicit virtual operator std::vector<unsigned char>() const;
virtual ~Command() = default;
};
}