Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TEC ApplicationModule
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MSK-SW
Infrastructure and Support
TEC
TEC ApplicationModule
Commits
406a52b1
Commit
406a52b1
authored
2 years ago
by
Jens Georg
Browse files
Options
Downloads
Patches
Plain Diff
dummy: Improve readability
parent
48fa0b44
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/TecDummy.cc
+3
-2
3 additions, 2 deletions
tests/src/TecDummy.cc
with
3 additions
and
2 deletions
tests/src/TecDummy.cc
+
3
−
2
View file @
406a52b1
...
...
@@ -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 nec
c
essary, 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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment