Renamed CMSIS commandId field to id

This commit is contained in:
Nav
2022-10-01 21:02:10 +01:00
parent 065a389dfe
commit 9fb017c2de
3 changed files with 4 additions and 4 deletions

View File

@@ -98,7 +98,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
this->sendCommand(cmsisDapCommand); this->sendCommand(cmsisDapCommand);
auto response = this->getResponse<typename CommandType::ExpectedResponseType>(); auto response = this->getResponse<typename CommandType::ExpectedResponseType>();
if (response.id != cmsisDapCommand.commandId) { if (response.id != cmsisDapCommand.id) {
throw Exceptions::DeviceCommunicationFailure("Unexpected response to CMSIS-DAP command."); throw Exceptions::DeviceCommunicationFailure("Unexpected response to CMSIS-DAP command.");
} }

View File

@@ -3,11 +3,11 @@
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
{ {
Command::Command(unsigned char commandId) Command::Command(unsigned char commandId)
: commandId(commandId) : id(commandId)
{} {}
Command::operator std::vector<unsigned char>() const { Command::operator std::vector<unsigned char>() const {
auto rawCommand = std::vector<unsigned char>(1, this->commandId); auto rawCommand = std::vector<unsigned char>(1, this->id);
rawCommand.insert(rawCommand.end(), this->data.begin(), this->data.end()); rawCommand.insert(rawCommand.end(), this->data.begin(), this->data.end());
return rawCommand; return rawCommand;

View File

@@ -50,7 +50,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
*/ */
using ExpectedResponseType = Response; using ExpectedResponseType = Response;
unsigned char commandId; unsigned char id;
std::vector<unsigned char> data; std::vector<unsigned char> data;
explicit Command(unsigned char commandId); explicit Command(unsigned char commandId);