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
2d74207f
Commit
2d74207f
authored
6 years ago
by
athatheocsd
Browse files
Options
Downloads
Patches
Plain Diff
Added Features
parent
9b78c519
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/EventActionService.hpp
+3
-0
3 additions, 0 deletions
inc/Services/EventActionService.hpp
src/Services/EventActionService.cpp
+32
-3
32 additions, 3 deletions
src/Services/EventActionService.cpp
with
35 additions
and
3 deletions
inc/Services/EventActionService.hpp
+
3
−
0
View file @
2d74207f
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include
"Service.hpp"
#include
"Service.hpp"
#include
"MessageParser.hpp"
#include
"MessageParser.hpp"
#include
"etl/String.hpp"
#include
"etl/String.hpp"
#include
<bitset>
/**
/**
* Implementation of ST[19] event-action Service
* Implementation of ST[19] event-action Service
...
@@ -22,6 +23,7 @@
...
@@ -22,6 +23,7 @@
class
EventActionService
:
public
Service
{
class
EventActionService
:
public
Service
{
private:
private:
uint8_t
eventActionFunctionStatus
;
// Indicates if actions are enabled
uint8_t
eventActionFunctionStatus
;
// Indicates if actions are enabled
std
::
bitset
<
256
>
stateOfEventAction
;
struct
EventActionDefinition
{
struct
EventActionDefinition
{
uint8_t
empty
=
1
;
// 1 means empty, 0 means full
uint8_t
empty
=
1
;
// 1 means empty, 0 means full
uint16_t
applicationId
=
0
;
uint16_t
applicationId
=
0
;
...
@@ -35,6 +37,7 @@ public:
...
@@ -35,6 +37,7 @@ public:
EventActionService
()
{
EventActionService
()
{
serviceType
=
19
;
serviceType
=
19
;
eventActionFunctionStatus
=
enabledFunction
;
eventActionFunctionStatus
=
enabledFunction
;
stateOfEventAction
.
set
();
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
src/Services/EventActionService.cpp
+
32
−
3
View file @
2d74207f
...
@@ -86,8 +86,23 @@ void EventActionService::enableEventActionDefinitions(Message message) {
...
@@ -86,8 +86,23 @@ void EventActionService::enableEventActionDefinitions(Message message) {
if
(
message
.
messageType
==
4
&&
message
.
packetType
==
Message
::
TC
&&
message
.
serviceType
if
(
message
.
messageType
==
4
&&
message
.
packetType
==
Message
::
TC
&&
message
.
serviceType
==
19
)
{
==
19
)
{
uint16_t
N
=
message
.
readUint16
();
uint16_t
N
=
message
.
readUint16
();
uint8_t
index
=
0
;
uint8_t
flag
=
0
;
// used as boolean 0 is false, 1 is true
for
(
uint16_t
i
=
0
;
i
<
N
;
i
++
)
{
for
(
uint16_t
i
=
0
;
i
<
N
;
i
++
)
{
uint16_t
applicationID
=
message
.
readEnum16
();
uint16_t
eventDefinitionID
=
message
.
readEnum16
();
while
(
eventActionDefinitionArray
[
index
].
applicationId
!=
applicationID
||
eventActionDefinitionArray
[
index
].
eventDefinitionID
!=
eventDefinitionID
){
if
(
index
==
255
){
// 255 should be changed depending on size of the array
flag
=
1
;
break
;
}
index
++
;
}
if
(
flag
==
0
){
// Found
stateOfEventAction
[
index
]
=
1
;
}
index
=
0
;
}
}
}
}
...
@@ -98,10 +113,24 @@ void EventActionService::disableEventActionDefinitions(Message message) {
...
@@ -98,10 +113,24 @@ void EventActionService::disableEventActionDefinitions(Message message) {
if
(
message
.
messageType
==
5
&&
message
.
packetType
==
Message
::
TC
&&
message
.
serviceType
if
(
message
.
messageType
==
5
&&
message
.
packetType
==
Message
::
TC
&&
message
.
serviceType
==
19
)
{
==
19
)
{
uint16_t
N
=
message
.
readUint16
();
uint16_t
N
=
message
.
readUint16
();
uint8_t
index
=
0
;
uint8_t
flag
=
0
;
// used as boolean 0 is false, 1 is true
for
(
uint16_t
i
=
0
;
i
<
N
;
i
++
)
{
for
(
uint16_t
i
=
0
;
i
<
N
;
i
++
)
{
uint16_t
applicationID
=
message
.
readEnum16
();
uint16_t
eventDefinitionID
=
message
.
readEnum16
();
while
(
eventActionDefinitionArray
[
index
].
applicationId
!=
applicationID
||
eventActionDefinitionArray
[
index
].
eventDefinitionID
!=
eventDefinitionID
){
if
(
index
==
255
){
// 255 should be changed depending on size of the array
flag
=
1
;
break
;
}
index
++
;
}
if
(
flag
==
0
){
// Found
stateOfEventAction
[
index
]
=
0
;
}
index
=
0
;
}
}
}
}
}
}
...
...
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