Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ECSS Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
AcubeSat-OBC
ECSS Services
Commits
2d3ac94e
Commit
2d3ac94e
authored
6 years ago
by
Grigoris Pavlakis
Browse files
Options
Downloads
Patches
Plain Diff
Clean up commented out code of the previous implementation
parent
504cd638
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Services/ParameterService.cpp
+2
-20
2 additions, 20 deletions
src/Services/ParameterService.cpp
with
2 additions
and
20 deletions
src/Services/ParameterService.cpp
+
2
−
20
View file @
2d3ac94e
...
...
@@ -53,14 +53,10 @@ void ParameterService::reportParameterIds(Message paramIds) {
reqParam
.
appendUint16
(
currId
);
reqParam
.
appendUint32
(
paramsList
[
currId
].
settingData
);
}
// if (currId < CONFIGLENGTH) { // (crappy) check to prevent out-of-bounds access due to
// // invalid id, see numOfValidIds
// reqParam.appendUint16(currId);
// reqParam.appendUint32(paramsList[currId].settingData);
// }
else
{
// generate failure of execution notification for ST[06]
continue
;
//ignore the invalid ID
continue
;
//
ignore the invalid ID
}
}
}
...
...
@@ -80,8 +76,6 @@ void ParameterService::setParameterIds(Message newParamValues) {
paramsList
[
currId
].
settingData
=
newParamValues
.
readUint32
();
}
// if (currId < CONFIGLENGTH) { // crappy criterion, see numOfValidIds
// paramsList[currId].settingData = newParamValues.readUint32();
else
{
// generate failure of execution notification for ST[06]
continue
;
// ignore the invalid ID
...
...
@@ -105,18 +99,6 @@ uint16_t ParameterService::numOfValidIds(Message idMsg) {
idMsg
.
readUint32
();
//skip the 32bit settings blocks, we need only the IDs
}
// IMPORTANT TODO: currId < CONFIGLENGTH is a crappy criterion for determining whether an ID
// actually exists!
// COUNTERARGUMENT: Array of 5 structs with only 2 parameters stored => rest exist but
// are filled with garbage => look like valid parameters but they don't actually have any
// useful data => not ignored by numOfValidIds => garbage creeps into messages => tests fail
// (and only on some PCs)
// FIXES: 1) Implement a linear search
// 2) (possibly better) Rewrite everything to use a hash map, since IDs are unique
// if (currId < CONFIGLENGTH) {
// validIds++;
// }
if
(
paramsList
.
find
(
currId
)
!=
paramsList
.
end
())
{
validIds
++
;
}
...
...
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