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
16935494
Unverified
Commit
16935494
authored
5 years ago
by
Grigoris Pavlakis
Browse files
Options
Downloads
Patches
Plain Diff
Update tests to use the new string output
This marks completion of the arbitrary type field feature
parent
83658921
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inc/Services/Parameter.hpp
+3
-6
3 additions, 6 deletions
inc/Services/Parameter.hpp
src/Services/Parameter.cpp
+1
-1
1 addition, 1 deletion
src/Services/Parameter.cpp
test/Services/ParameterService.cpp
+9
-2
9 additions, 2 deletions
test/Services/ParameterService.cpp
with
13 additions
and
9 deletions
inc/Services/Parameter.hpp
+
3
−
6
View file @
16935494
...
...
@@ -6,7 +6,7 @@
// Number of binary flags in every parameter. Final number TBD.
#define NUM_OF_FLAGS 3
// Maximum etl::string length in bytes
// Maximum etl::string
output
length in bytes
#define MAX_STRING_LENGTH 5
/**
* Implementation of a Parameter field, as specified in ECSS-E-ST-70-41C.
...
...
@@ -20,13 +20,9 @@
* Useful type definitions
*
* @typedef ParamId: the unique ID of a parameter, used for searching
* @typedef ValueType: the type of the parameter's value (changing types is WIP)
* @typedef UpdatePtr: pointer to a void function, with a single ValueType* argument (return address)
* @typedef Flags: container for the binary flags
*/
typedef
uint16_t
ParamId
;
//typedef uint32_t ValueType;
//#typedef ;
typedef
etl
::
bitset
<
NUM_OF_FLAGS
>
Flags
;
/**
...
...
@@ -53,6 +49,8 @@ typedef etl::bitset<NUM_OF_FLAGS> Flags;
* as its update function pointer. Arguments initialValue and newPtr are optional, and have default values of
* 0 and nullptr respectively.
*
* @todo Update documentation
*
* @public setCurrentValue(): Changes the current value of the parameter
* @public getCurrentValue(): Gets the current value of the parameter
* @public getPTC(), getPFC(): Returns the PFC and PTC of the parameter
...
...
@@ -86,7 +84,6 @@ public:
template
<
typename
ValueType
>
class
Parameter
:
public
ParameterBase
{
void
(
*
ptr
)(
ValueType
*
);
ValueType
currentValue
;
public:
...
...
This diff is collapsed.
Click to expand it.
src/Services/Parameter.cpp
+
1
−
1
View file @
16935494
...
...
@@ -10,4 +10,4 @@ uint8_t ParameterBase::getPFC() {
void
ParameterBase
::
setFlags
(
const
char
*
flags
)
{
this
->
flags
=
Flags
(
flags
);
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
test/Services/ParameterService.cpp
+
9
−
2
View file @
16935494
...
...
@@ -93,7 +93,10 @@ TEST_CASE("Parameter Report Subservice") {
CHECK
(
report
.
readUint16
()
==
1
);
// only one parameter shall be contained
CHECK
(
report
.
readUint16
()
==
1
);
// check for parameter ID
CHECK
(
report
.
readUint32
()
==
12
);
// check for value (defined when adding parameters)
uint8_t
data
[
MAX_STRING_LENGTH
];
report
.
readString
(
data
,
MAX_STRING_LENGTH
);
String
<
MAX_STRING_LENGTH
>
str
=
String
<
MAX_STRING_LENGTH
>
(
data
);
CHECK
(
str
.
compare
(
"12"
));
// check for value as string (defined when adding parameters)
ServiceTests
::
reset
();
// clear all errors
Services
.
reset
();
// reset the services
...
...
@@ -143,7 +146,11 @@ TEST_CASE("Parameter Setting Subservice") {
CHECK
(
report
.
messageType
==
2
);
CHECK
(
report
.
readUint16
()
==
1
);
// only 1 ID contained
CHECK
(
report
.
readUint16
()
==
1
);
// contained ID should be ID 1
CHECK
(
report
.
readUint32
()
==
3735928559
);
// whose value is 0xDEADBEEF
char
data
[
MAX_STRING_LENGTH
];
report
.
readString
(
data
,
MAX_STRING_LENGTH
);
String
<
MAX_STRING_LENGTH
>
str
=
String
<
MAX_STRING_LENGTH
>
(
data
);
CHECK
(
str
.
compare
(
"3735928559"
));
// whose value is the string 0xDEADBEEF
ServiceTests
::
reset
();
Services
.
reset
();
...
...
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