Replaced overloaded casting of CMSIS-DAP Command with rawCommand member function
This commit is contained in:
@@ -25,6 +25,6 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
|
|||||||
this->lastCommandSentTimeStamp = now;
|
this->lastCommandSentTimeStamp = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->getUsbHidInterface().write(static_cast<std::vector<unsigned char>>(cmsisDapCommand));
|
this->getUsbHidInterface().write(cmsisDapCommand.rawCommand());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
|
|||||||
: id(commandId)
|
: id(commandId)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Command::operator std::vector<unsigned char>() const {
|
std::vector<unsigned char> Command::rawCommand() const {
|
||||||
auto rawCommand = std::vector<unsigned char>(1, this->id);
|
auto rawCommand = std::vector<unsigned char>(1, this->id);
|
||||||
|
rawCommand.reserve(this->data.size() + 1);
|
||||||
rawCommand.insert(rawCommand.end(), this->data.begin(), this->data.end());
|
rawCommand.insert(rawCommand.end(), this->data.begin(), this->data.end());
|
||||||
|
|
||||||
return rawCommand;
|
return rawCommand;
|
||||||
|
|||||||
@@ -72,11 +72,10 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts instance of a CMSIS Command to a vector of unsigned char (buffer), for sending
|
* Generates the raw CMSIS-DAP command, for sending to the CMSIS-DAP-enabled device.
|
||||||
* to the debug tool.
|
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
explicit virtual operator std::vector<unsigned char>() const;
|
std::vector<unsigned char> rawCommand() const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user