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
65c36107
Commit
65c36107
authored
6 years ago
by
thodkatz
Browse files
Options
Downloads
Patches
Plain Diff
Implement code review comments
parent
c49c5e08
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/RequestVerificationService.hpp
+11
-11
11 additions, 11 deletions
inc/Services/RequestVerificationService.hpp
src/Services/RequestVerificationService.cpp
+41
-41
41 additions, 41 deletions
src/Services/RequestVerificationService.cpp
src/main.cpp
+1
-2
1 addition, 2 deletions
src/main.cpp
with
53 additions
and
54 deletions
inc/Services/RequestVerificationService.hpp
+
11
−
11
View file @
65c36107
#ifndef ECSS_SERVICES_REQUSTVERIFICATIONSERVICE_HPP
#define ECSS_SERVICES_REQUSTVERIFICATIONSERVICE_HPP
#ifndef ECSS_SERVICES_REQ
E
USTVERIFICATIONSERVICE_HPP
#define ECSS_SERVICES_REQU
E
STVERIFICATIONSERVICE_HPP
#include
"Service.hpp"
...
...
@@ -18,39 +18,39 @@ public:
* TM[1,1] successful acceptance verification report
*/
void
successAcceptanceVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
);
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
);
/**
* TM[1,2] failed acceptance verification report
*/
void
failAcceptanceVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
,
uint16_t
c
ode
);
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
,
uint16_t
errorC
ode
);
/**
* TM[1,7] successful completion of execution verification report
*/
void
successExecutionVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
);
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
);
/**
* TM[1,8] failed completion of execution verification report
*/
void
failExecutionVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
,
uint16_t
c
ode
);
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
,
uint16_t
errorC
ode
);
/**
* TM[1,10] failed routing verification report
*/
void
failRoutingVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
,
uint16_t
c
ode
);
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
,
uint16_t
errorC
ode
);
};
#endif //ECSS_SERVICES_REQUSTVERIFICATIONSERVICE_HPP
#endif //ECSS_SERVICES_REQU
E
STVERIFICATIONSERVICE_HPP
This diff is collapsed.
Click to expand it.
src/Services/RequestVerificationService.cpp
+
41
−
41
View file @
65c36107
...
...
@@ -2,20 +2,20 @@
void
RequestVerificationService
::
successAcceptanceVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
)
{
// TM[1,1] successful acceptance verification report
assert
(
packetType
<
=
1
);
assert
(
APID
<=
1024
);
assert
(
seqFlag
<
=
2
);
assert
(
packetSeqCount
<
=
8192
);
assert
(
packetType
<
2
);
assert
(
apid
<
2048
);
assert
(
seqFlag
<
4
);
assert
(
packetSeqCount
<
16384
);
Message
report
=
createTM
(
1
);
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//packet version number
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//
packet version number
report
.
appendBits
(
1
,
packetType
);
report
.
appendBits
(
1
,
static_cast
<
uint16_t
>
(
secondaryHeaderFlag
));
report
.
appendBits
(
11
,
APID
);
report
.
appendBits
(
11
,
apid
);
report
.
appendBits
(
2
,
seqFlag
);
report
.
appendBits
(
14
,
packetSeqCount
);
...
...
@@ -25,45 +25,45 @@ void RequestVerificationService::successAcceptanceVerification(uint8_t packetTyp
void
RequestVerificationService
::
failAcceptanceVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
,
uint16_t
c
ode
)
{
uint16_t
errorC
ode
)
{
// TM[1,2] failed acceptance verification report
assert
(
packetType
<
=
1
);
assert
(
APID
<=
1024
);
assert
(
seqFlag
<
=
2
);
assert
(
packetSeqCount
<
=
8192
);
assert
(
packetType
<
2
);
assert
(
apid
<
2048
);
assert
(
seqFlag
<
4
);
assert
(
packetSeqCount
<
16384
);
Message
report
=
createTM
(
2
);
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//packet version number
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//
packet version number
report
.
appendBits
(
1
,
packetType
);
report
.
appendBits
(
1
,
static_cast
<
uint16_t
>
(
secondaryHeaderFlag
));
report
.
appendBits
(
11
,
APID
);
report
.
appendBits
(
11
,
apid
);
report
.
appendBits
(
2
,
seqFlag
);
report
.
appendBits
(
14
,
packetSeqCount
);
report
.
appendUint16
(
c
ode
);
report
.
appendUint16
(
errorC
ode
);
storeMessage
(
report
);
}
void
RequestVerificationService
::
successExecutionVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
)
{
// TM[1,7] successful completion of execution verification report
assert
(
packetType
<
=
1
);
assert
(
APID
<=
1024
);
assert
(
seqFlag
<
=
2
);
assert
(
packetSeqCount
<
=
8192
);
assert
(
packetType
<
2
);
assert
(
apid
<
2048
);
assert
(
seqFlag
<
4
);
assert
(
packetSeqCount
<
16384
);
Message
report
=
createTM
(
7
);
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//packet version number
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//
packet version number
report
.
appendBits
(
1
,
packetType
);
report
.
appendBits
(
1
,
static_cast
<
uint16_t
>
(
secondaryHeaderFlag
));
report
.
appendBits
(
11
,
APID
);
report
.
appendBits
(
11
,
apid
);
report
.
appendBits
(
2
,
seqFlag
);
report
.
appendBits
(
14
,
packetSeqCount
);
...
...
@@ -73,25 +73,25 @@ void RequestVerificationService::successExecutionVerification(uint8_t packetType
void
RequestVerificationService
::
failExecutionVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
,
uint16_t
c
ode
)
{
uint16_t
errorC
ode
)
{
// TM[1,8] failed completion of execution verification report
assert
(
packetType
<
=
1
);
assert
(
APID
<=
1024
);
assert
(
seqFlag
<
=
2
);
assert
(
packetSeqCount
<
=
8192
);
assert
(
packetType
<
2
);
assert
(
apid
<
2048
);
assert
(
seqFlag
<
4
);
assert
(
packetSeqCount
<
16384
);
Message
report
=
createTM
(
8
);
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//packet version number
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//
packet version number
report
.
appendBits
(
1
,
packetType
);
report
.
appendBits
(
1
,
static_cast
<
uint16_t
>
(
secondaryHeaderFlag
));
report
.
appendBits
(
11
,
APID
);
report
.
appendBits
(
11
,
apid
);
report
.
appendBits
(
2
,
seqFlag
);
report
.
appendBits
(
14
,
packetSeqCount
);
report
.
appendUint16
(
c
ode
);
report
.
appendUint16
(
errorC
ode
);
storeMessage
(
report
);
}
...
...
@@ -99,25 +99,25 @@ RequestVerificationService::failExecutionVerification(uint8_t packetType,
void
RequestVerificationService
::
failRoutingVerification
(
uint8_t
packetType
,
bool
secondaryHeaderFlag
,
uint16_t
APID
,
uint8_t
seqFlag
,
uint16_t
apid
,
uint8_t
seqFlag
,
uint16_t
packetSeqCount
,
uint16_t
c
ode
)
{
uint16_t
errorC
ode
)
{
// TM[1,10] failed routing verification report
assert
(
packetType
<
=
1
);
assert
(
APID
<=
1024
);
assert
(
seqFlag
<
=
2
);
assert
(
packetSeqCount
<
=
8192
);
assert
(
packetType
<
2
);
assert
(
apid
<
2048
);
assert
(
seqFlag
<
4
);
assert
(
packetSeqCount
<
16384
);
Message
report
=
createTM
(
10
);
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//packet version number
report
.
appendBits
(
3
,
ECSS_PUS_VERSION
);
//
packet version number
report
.
appendBits
(
1
,
packetType
);
report
.
appendBits
(
1
,
static_cast
<
uint16_t
>
(
secondaryHeaderFlag
));
report
.
appendBits
(
11
,
APID
);
report
.
appendBits
(
11
,
apid
);
report
.
appendBits
(
2
,
seqFlag
);
report
.
appendBits
(
14
,
packetSeqCount
);
report
.
appendUint16
(
c
ode
);
report
.
appendUint16
(
errorC
ode
);
storeMessage
(
report
);
}
This diff is collapsed.
Click to expand it.
src/main.cpp
+
1
−
2
View file @
65c36107
...
...
@@ -20,7 +20,7 @@ int main() {
std
::
cout
<<
"Word: "
<<
string
<<
" "
<<
packet
.
readBits
(
15
)
<<
packet
.
readBits
(
1
)
<<
std
::
endl
;
std
::
cout
<<
packet
.
readFloat
()
<<
" "
<<
std
::
dec
<<
packet
.
readSint32
()
<<
std
::
endl
;
/*
// ST[17] test
TestService
testService
;
Message
receivedPacket
=
Message
(
17
,
1
,
Message
::
TC
,
1
);
...
...
@@ -28,7 +28,6 @@ int main() {
receivedPacket
=
Message
(
17
,
3
,
Message
::
TC
,
1
);
receivedPacket
.
appendUint16
(
7
);
testService
.
onBoardConnection
(
receivedPacket
);
*/
// ST[01] test
// parameters take random values and works as expected
...
...
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