Skip to content
Snippets Groups Projects
Commit 406a52b1 authored by Jens Georg's avatar Jens Georg
Browse files

dummy: Improve readability

parent 48fa0b44
No related branches found
No related tags found
No related merge requests found
......@@ -54,14 +54,14 @@ void TecDummy::read(uint64_t bar, uint64_t address, int32_t* data, size_t sizeIn
frameData.erase(endOfFrame);
std::string frameReply{""};
if(!simulateSerialTimeout) {
if(not simulateSerialTimeout) {
// perform data processing
frameReply = processFrame(frameData);
}
else {
// In case of timeout, the marker is written to the start of the frame
// The byte order is swapped here to compensate swapping of the reg_command,
// this is neccessary, because the TEC lib checks the timeout marker before
// this is necessary, because the TEC lib checks the timeout marker before
// changing the byte order of the received frame.
const uint32_t timeoutMarker{htonl(TEC_MAGIC_TIMEOUT)};
frameReply = std::string(sizeof(uint32_t), '\0');
......@@ -156,6 +156,7 @@ std::string TecDummy::processFrame(const std::string& command) {
if(errorFlags[parameterId] != TecErrorCode::NO_ERROR) {
// Returing an error has been requested through the dummy interface
// Returning an error has been requested through the dummy interface
result = "!" + parsedFrame[TecFramePart::ADDRESS] + parsedFrame[TecFramePart::SEQUENCE];
result += "+"; // marks the error
std::stringstream ss;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment