Moving ResponseId enum for the HOUSEKEEPING EDBG protocol out of the command frame class header.
This commit is contained in:
@@ -71,6 +71,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void AtmelIce::startSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
StartSession()
|
||||
@@ -86,6 +87,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void AtmelIce::endSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
EndSession()
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void CuriosityNano::startSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
StartSession()
|
||||
@@ -78,6 +79,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void CuriosityNano::endSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
EndSession()
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void MplabPickit4::startSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
StartSession()
|
||||
@@ -79,6 +80,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void MplabPickit4::endSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
EndSession()
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void MplabSnap::startSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
StartSession()
|
||||
@@ -78,6 +79,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void MplabSnap::endSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
EndSession()
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void PowerDebugger::startSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
StartSession()
|
||||
@@ -86,6 +87,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void PowerDebugger::endSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
EndSession()
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void XplainedMini::startSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
StartSession()
|
||||
@@ -78,6 +79,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void XplainedMini::endSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
EndSession()
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void XplainedNano::startSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
StartSession()
|
||||
@@ -78,6 +79,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void XplainedNano::endSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
EndSession()
|
||||
|
||||
@@ -72,6 +72,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void XplainedPro::startSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
StartSession()
|
||||
@@ -87,6 +88,7 @@ namespace Bloom::DebugToolDrivers
|
||||
|
||||
void XplainedPro::endSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
auto response = this->getEdbgInterface().sendAvrCommandFrameAndWaitForResponseFrame(
|
||||
EndSession()
|
||||
|
||||
@@ -5,28 +5,11 @@
|
||||
|
||||
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames::HouseKeeping
|
||||
{
|
||||
enum class ResponseId : unsigned char
|
||||
{
|
||||
OK = 0x80,
|
||||
LIST = 0x81,
|
||||
DATA = 0x84,
|
||||
FAILED = 0xA0,
|
||||
FAILED_WITH_DATA = 0xA1
|
||||
};
|
||||
|
||||
inline bool operator == (unsigned char rawId, ResponseId id) {
|
||||
return static_cast<unsigned char>(id) == rawId;
|
||||
}
|
||||
|
||||
inline bool operator == (ResponseId id, unsigned char rawId) {
|
||||
return rawId == id;
|
||||
}
|
||||
|
||||
template<class PayloadContainerType>
|
||||
class HouseKeepingCommandFrame: public AvrCommandFrame<PayloadContainerType>
|
||||
{
|
||||
public:
|
||||
using ExpectedResponseFrameType = ResponseFrames::HouseKeepingResponseFrame;
|
||||
using ExpectedResponseFrameType = ResponseFrames::HouseKeeping::HouseKeepingResponseFrame;
|
||||
|
||||
HouseKeepingCommandFrame(): AvrCommandFrame<PayloadContainerType>(ProtocolHandlerId::HOUSE_KEEPING) {}
|
||||
};
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
|
||||
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::ResponseFrames
|
||||
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::ResponseFrames::HouseKeeping
|
||||
{
|
||||
using namespace Bloom::Exceptions;
|
||||
|
||||
unsigned char HouseKeepingResponseFrame::getResponseId() {
|
||||
ResponseId HouseKeepingResponseFrame::getResponseId() {
|
||||
const auto& payload = this->getPayload();
|
||||
|
||||
if (payload.empty()) {
|
||||
throw Exception("Response ID missing from HOUSEKEEPING response frame payload.");
|
||||
}
|
||||
|
||||
return payload[0];
|
||||
return static_cast<ResponseId>(payload[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,23 @@
|
||||
|
||||
#include "src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AvrResponseFrame.hpp"
|
||||
|
||||
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::ResponseFrames
|
||||
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::ResponseFrames::HouseKeeping
|
||||
{
|
||||
enum class ResponseId : unsigned char
|
||||
{
|
||||
OK = 0x80,
|
||||
LIST = 0x81,
|
||||
DATA = 0x84,
|
||||
FAILED = 0xA0,
|
||||
FAILED_WITH_DATA = 0xA1
|
||||
};
|
||||
|
||||
class HouseKeepingResponseFrame: public AvrResponseFrame
|
||||
{
|
||||
public:
|
||||
HouseKeepingResponseFrame() = default;
|
||||
explicit HouseKeepingResponseFrame(const std::vector<AvrResponse>& avrResponses): AvrResponseFrame(avrResponses) {}
|
||||
|
||||
unsigned char getResponseId();
|
||||
ResponseId getResponseId();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user