Renamed ResponseFrameType alias to ExpectedResponseFrameType
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames
|
|||||||
class Avr8GenericCommandFrame: public AvrCommandFrame<PayloadContainerType>
|
class Avr8GenericCommandFrame: public AvrCommandFrame<PayloadContainerType>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using ResponseFrameType = ResponseFrames::Avr8Generic::Avr8GenericResponseFrame;
|
using ExpectedResponseFrameType = ResponseFrames::Avr8Generic::Avr8GenericResponseFrame;
|
||||||
|
|
||||||
Avr8GenericCommandFrame(): AvrCommandFrame<PayloadContainerType>(ProtocolHandlerId::AVR8_GENERIC) {}
|
Avr8GenericCommandFrame(): AvrCommandFrame<PayloadContainerType>(ProtocolHandlerId::AVR8_GENERIC) {}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames
|
|||||||
class GetDeviceId: public Avr8GenericCommandFrame<std::array<unsigned char, 2>>
|
class GetDeviceId: public Avr8GenericCommandFrame<std::array<unsigned char, 2>>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using ResponseFrameType = ResponseFrames::Avr8Generic::GetDeviceId;
|
using ExpectedResponseFrameType = ResponseFrames::Avr8Generic::GetDeviceId;
|
||||||
|
|
||||||
GetDeviceId() {
|
GetDeviceId() {
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames
|
|||||||
class GetProgramCounter: public Avr8GenericCommandFrame<std::array<unsigned char, 2>>
|
class GetProgramCounter: public Avr8GenericCommandFrame<std::array<unsigned char, 2>>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using ResponseFrameType = ResponseFrames::Avr8Generic::GetProgramCounter;
|
using ExpectedResponseFrameType = ResponseFrames::Avr8Generic::GetProgramCounter;
|
||||||
|
|
||||||
GetProgramCounter() {
|
GetProgramCounter() {
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames
|
|||||||
class ReadMemory: public Avr8GenericCommandFrame<std::vector<unsigned char>>
|
class ReadMemory: public Avr8GenericCommandFrame<std::vector<unsigned char>>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using ResponseFrameType = ResponseFrames::Avr8Generic::ReadMemory;
|
using ExpectedResponseFrameType = ResponseFrames::Avr8Generic::ReadMemory;
|
||||||
|
|
||||||
ReadMemory(
|
ReadMemory(
|
||||||
const Avr8MemoryType& type,
|
const Avr8MemoryType& type,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
|
|||||||
);
|
);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ResponseFrameType = AvrResponseFrame;
|
using ExpectedResponseFrameType = AvrResponseFrame;
|
||||||
|
|
||||||
explicit AvrCommandFrame(ProtocolHandlerId protocolHandlerId): protocolHandlerId(protocolHandlerId) {
|
explicit AvrCommandFrame(ProtocolHandlerId protocolHandlerId): protocolHandlerId(protocolHandlerId) {
|
||||||
if (LAST_SEQUENCE_ID < std::numeric_limits<decltype(LAST_SEQUENCE_ID)>::max()) {
|
if (LAST_SEQUENCE_ID < std::numeric_limits<decltype(LAST_SEQUENCE_ID)>::max()) {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames
|
|||||||
class DiscoveryCommandFrame: public AvrCommandFrame<PayloadContainerType>
|
class DiscoveryCommandFrame: public AvrCommandFrame<PayloadContainerType>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using ResponseFrameType = ResponseFrames::DiscoveryResponseFrame;
|
using ExpectedResponseFrameType = ResponseFrames::DiscoveryResponseFrame;
|
||||||
|
|
||||||
DiscoveryCommandFrame(): AvrCommandFrame<PayloadContainerType>(ProtocolHandlerId::DISCOVERY) {}
|
DiscoveryCommandFrame(): AvrCommandFrame<PayloadContainerType>(ProtocolHandlerId::DISCOVERY) {}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -50,13 +50,13 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg
|
|||||||
);
|
);
|
||||||
|
|
||||||
template<class CommandFrameType>
|
template<class CommandFrameType>
|
||||||
typename CommandFrameType::ResponseFrameType sendAvrCommandFrameAndWaitForResponseFrame(
|
typename CommandFrameType::ExpectedResponseFrameType sendAvrCommandFrameAndWaitForResponseFrame(
|
||||||
const CommandFrameType& avrCommandFrame
|
const CommandFrameType& avrCommandFrame
|
||||||
) {
|
) {
|
||||||
static_assert(
|
static_assert(
|
||||||
std::is_base_of<
|
std::is_base_of<
|
||||||
Protocols::CmsisDap::Edbg::Avr::AvrResponseFrame,
|
Protocols::CmsisDap::Edbg::Avr::AvrResponseFrame,
|
||||||
typename CommandFrameType::ResponseFrameType
|
typename CommandFrameType::ExpectedResponseFrameType
|
||||||
>::value,
|
>::value,
|
||||||
"AVR Command must specify a valid response frame type, derived from AvrResponseFrame."
|
"AVR Command must specify a valid response frame type, derived from AvrResponseFrame."
|
||||||
);
|
);
|
||||||
@@ -71,7 +71,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto responses = this->requestAvrResponses();
|
auto responses = this->requestAvrResponses();
|
||||||
auto responseFrame = typename CommandFrameType::ResponseFrameType();
|
auto responseFrame = typename CommandFrameType::ExpectedResponseFrameType();
|
||||||
responseFrame.initFromAvrResponses(responses);
|
responseFrame.initFromAvrResponses(responses);
|
||||||
return responseFrame;
|
return responseFrame;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user