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
b2b1c72a
Commit
b2b1c72a
authored
6 years ago
by
Grigoris Pavlakis
Browse files
Options
Downloads
Patches
Plain Diff
Delete main.cpp.orig
parent
b14d8ab6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp.orig
+0
-91
0 additions, 91 deletions
src/main.cpp.orig
with
0 additions
and
91 deletions
src/main.cpp.orig
deleted
100644 → 0
+
0
−
91
View file @
b14d8ab6
#include <iostream>
#include <Services/TestService.hpp>
<<<<<<< HEAD
#include "Services/ParameterService.hpp"
=======
#include <Services/RequestVerificationService.hpp>
>>>>>>> master
#include "Message.hpp"
int main() {
Message packet = Message(0, 0, Message::TC, 1);
packet.appendString(5, "hello");
packet.appendBits(15, 0x28a8);
packet.appendBits(1, 1);
packet.appendFloat(5.7);
packet.appendSint32(-123456789);
std::cout << "Hello, World!" << std::endl;
std::cout << std::hex << packet.data << std::endl; // packet data must be 'helloQQ'
char string[6];
packet.readString(string, 5);
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);
testService.areYouAlive(receivedPacket);
receivedPacket = Message(17, 3, Message::TC, 1);
receivedPacket.appendUint16(7);
testService.onBoardConnection(receivedPacket);
<<<<<<< HEAD
//ST[20] test
ParameterService paramService;
//Test code for reportParameter
Message sentPacket = Message(20, 1, Message::TC, 1); //application id is a dummy number (1)
sentPacket.appendUint16(2); //number of contained IDs
sentPacket.appendUint16(0); //first ID
sentPacket.appendUint16(1); //second ID
Message returnedPacket = paramService.reportParameterIds(sentPacket);
uint16_t numOfIds = returnedPacket.readUint16();
std::cout << std::endl << "Number of contained configs: " << numOfIds << std::endl;
for (int i = 0; i < numOfIds; i++) {
std::cout << "Parameter ID: " << std::dec << returnedPacket.readUint16() << std::endl
<< "Parameter value: " << std::dec << returnedPacket.readUint32() << std::endl;
}
std::cout << std::endl << "(First value is hours, second is minutes)" << std::endl;
//Test code for setParameter
Message sentPacket2 = Message(20, 3, Message::TC, 1); //application id is a dummy number (1)
sentPacket2.appendUint16(2); //number of contained IDs
sentPacket2.appendUint16(0); //first parameter ID
sentPacket2.appendUint32(63238); //settings for first parameter
sentPacket2.appendUint16(1); //2nd parameter ID
sentPacket2.appendUint32(45823); //settings for 2nd parameter
paramService.setParameterIds(sentPacket2);
returnedPacket = paramService.reportParameterIds(sentPacket);
numOfIds = returnedPacket.readUint16();
for (int i = 0; i < numOfIds; i++) {
std::cout << "Parameter ID: " << std::dec << returnedPacket.readUint16() << std::endl
<< "Parameter value: " << std::dec << returnedPacket.readUint32() << std::endl;
}
=======
// ST[01] test
// parameters take random values and works as expected
RequestVerificationService reqVerifService;
reqVerifService.successAcceptanceVerification(Message::TC, true, 2, 2, 10);
reqVerifService.failAcceptanceVerification(Message::TC, true, 2, 2, 10, 5);
reqVerifService.successExecutionVerification(Message::TC, true, 2, 2, 10);
reqVerifService.failExecutionVerification(Message::TC, true, 2, 2, 10, 6);
reqVerifService.failRoutingVerification(Message::TC, true, 2, 2, 10, 7);
>>>>>>> master
return 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