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
ba9a6e59
Commit
ba9a6e59
authored
6 years ago
by
Grigoris Pavlakis
Committed by
kongr45gpen
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update some docstrings and clean up an if statement
parent
a62f9610
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inc/Services/FunctionManagementService.hpp
+9
-5
9 additions, 5 deletions
inc/Services/FunctionManagementService.hpp
src/Services/FunctionManagementService.cpp
+2
-6
2 additions, 6 deletions
src/Services/FunctionManagementService.cpp
with
11 additions
and
11 deletions
inc/Services/FunctionManagementService.hpp
+
9
−
5
View file @
ba9a6e59
...
...
@@ -2,7 +2,7 @@
#define ECSS_SERVICES_FUNCTIONMANAGEMENTSERVICE_HPP
#include
<cstdint>
#include
<iostream>
//
TEMPORAR
Y!
#include
<iostream>
//
USED BY THE SAMPLE FUNCTIONS ONL
Y!
!
#include
<utility>
#include
<typeinfo>
...
...
@@ -10,9 +10,9 @@
#include
"etl/String.hpp"
#include
"Message.hpp"
#define FUNCMAPSIZE 128
// size of the function map in bytes (temporary, arbitrary)
#define FUNCMAPSIZE 128 // size of the function map in bytes (temporary, arbitrary)
#define MAXFUNCNAMELENGTH 32 // max length of the function name (temporary, arbitrary)
#define MAXARGLENGTH 32
// maximum argument byte string length
#define MAXARGLENGTH 32 // maximum argument byte string length
(temporary, arbitrary)
/**
* Implementation of the ST[08] function management service
...
...
@@ -21,7 +21,10 @@
* ECSS-E-ST-70-41C, pages 157-159. Final implementation is dependent on subsystem requirements
* which are, as of this writing, undefined yet.
*
* WARNING! Any string handling in this class involves non-null-terminated strings!
* Caveats:
* 1) Any string handling in this class involves **non-null-terminated strings**.
*
* You have been warned.
*
* @author Grigoris Pavlakis <grigpavl@ece.auth.gr>
*/
...
...
@@ -38,7 +41,8 @@ class FunctionManagementService {
public:
/**
* Constructs the function pointer index. All functions to be included shall be visible to it.
* Constructs the function pointer index with all the necessary functions at initialization time
* These functions need to be in scope.
* @param None
*/
FunctionManagementService
();
...
...
This diff is collapsed.
Click to expand it.
src/Services/FunctionManagementService.cpp
+
2
−
6
View file @
ba9a6e59
...
...
@@ -6,7 +6,6 @@ void dummy1(const String<MAXARGLENGTH> a) {
std
::
cout
<<
a
.
c_str
()
<<
std
::
endl
;
}
FunctionManagementService
::
FunctionManagementService
()
{
String
<
MAXFUNCNAMELENGTH
>
str
(
""
);
str
.
append
(
"dummy1"
);
...
...
@@ -52,10 +51,7 @@ void FunctionManagementService::call(Message msg){
PointerMap
::
iterator
iter
=
funcPtrIndex
.
find
(
name
);
void
(
*
selected
)(
String
<
MAXARGLENGTH
>
)
=
nullptr
;
if
(
iter
==
funcPtrIndex
.
end
())
{
std
::
cout
<<
"ERROR: Malformed query."
<<
std
::
endl
;
}
else
{
if
(
iter
!=
funcPtrIndex
.
end
())
{
selected
=
*
iter
->
second
;
}
...
...
@@ -67,6 +63,6 @@ void FunctionManagementService::call(Message msg){
return
;
}
//
execute the function if there are no obvious flaws (defined in the standard, pg.158)
// execute the function if there are no obvious flaws (defined in the standard, pg.158)
selected
(
funcArgs
);
}
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