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
cf00ec09
Commit
cf00ec09
authored
5 years ago
by
Grigoris Pavlakis
Committed by
kongr45gpen
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add code review suggestions
parent
d6321cac
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
+28
-5
28 additions, 5 deletions
inc/Services/FunctionManagementService.hpp
src/Services/FunctionManagementService.cpp
+0
-30
0 additions, 30 deletions
src/Services/FunctionManagementService.cpp
with
28 additions
and
35 deletions
inc/Services/FunctionManagementService.hpp
+
28
−
5
View file @
cf00ec09
...
...
@@ -11,9 +11,9 @@
#include
"Message.hpp"
#include
"Service.hpp"
#define FUNCMAPSIZE 128 // size of the function map (number of elements)
#define FUNCNAMELENGTH 32 // max length of the function name
#define MAXARGLENGTH 32 // maximum argument byte string length
#define FUNC
_
MAP
_
SIZE 128 // size of the function map (number of elements)
#define FUNC
_
NAME
_
LENGTH 32 // max length of the function name
#define MAX
_
ARG
_
LENGTH 32 // maximum argument byte string length
/**
* @todo: Undef TESTMODE before flight!!!!
...
...
@@ -38,8 +38,31 @@
* @author Grigoris Pavlakis <grigpavl@ece.auth.gr>
*/
typedef
String
<
FUNCNAMELENGTH
>
functionName
;
typedef
etl
::
map
<
functionName
,
void
(
*
)(
String
<
MAXARGLENGTH
>
),
FUNCMAPSIZE
>
/**
* Usage of the include() function:
*
* @code
* void foo(String<MAXARGLENGTH> b) {
* std::cout << "SPAAAACE!" << std::endl;
* }
*
* void bar(String<MAXARGLENGTH> b) {
* std::cout << "I HAZ A CUBESAT THAT SNAPS PIX!" << std::endl;
* }
*
* void baz(String<MAXARGLENGTH> b) {
* std::cout << "QWERTYUIOP" << std::endl;
* }
*
* FunctionManagementService::FunctionManagementService() {
* include(String<FUNCNAMELENGTH>("foo"), &foo);
* include(String<FUNCNAMELENGTH>("bar"), &bar);
* include(String<FUNCNAMELENGTH>("baz"), &baz);
* }
*/
typedef
String
<
FUNC_NAME_LENGTH
>
functionName
;
typedef
etl
::
map
<
functionName
,
void
(
*
)(
String
<
MAX_ARG_LENGTH
>
),
FUNC_MAP_SIZE
>
FunctionMap
;
class
FunctionManagementService
:
public
Service
{
...
...
This diff is collapsed.
Click to expand it.
src/Services/FunctionManagementService.cpp
+
0
−
30
View file @
cf00ec09
#include
"Services/FunctionManagementService.hpp"
/**
* Usage of the include() function:
*
* void foo(String<MAXARGLENGTH> b) {
* std::cout << "SPAAAACE!" << std::endl;
* }
*
* void bar(String<MAXARGLENGTH> b) {
* std::cout << "I HAZ A CUBESAT THAT SNAPS PIX!" << std::endl;
* }
*
* void baz(String<MAXARGLENGTH> b) {
* std::cout << "QWERTYUIOP" << std::endl;
* }
*
* FunctionManagementService::FunctionManagementService() {
* include(String<FUNCNAMELENGTH>("foo"), &foo);
* include(String<FUNCNAMELENGTH>("bar"), &bar);
* include(String<FUNCNAMELENGTH>("baz"), &baz);
* }
*/
/*
* FunctionManagementService::FunctionManagementService() {
* All the functions that should be included in the pointer map at initialization shall be here.
* and included as in the examples above.
*
* }
*/
int
FunctionManagementService
::
call
(
Message
&
msg
)
{
/**
* @todo: Add test for message and service type using the ErrorHandler
...
...
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