ptme ip core packet insertion

This commit is contained in:
Jakob Meier
2021-09-26 08:29:30 +02:00
parent 773627dc3d
commit 5b26564058
20 changed files with 252 additions and 722 deletions

View File

@ -1,13 +1,11 @@
#include "CCSDSHandler.h"
#include "VirtualChannel.h"
#include "OBSWConfig.h"
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
#include "fsfw/objectmanager/ObjectManager.h"
#include <framework/tmtcservices/TmTcMessage.h>
#include <mission/obc/ccsdsboard/VirtualChannel.h>
#include "fsfw/tmtcservices/TmTcMessage.h"
#include "fsfw/ipc/QueueFactory.h"
VirtualChannel::VirtualChannel(uint8_t vcId, uint32_t tmQueueDepth) :
@ -22,10 +20,11 @@ ReturnValue_t VirtualChannel::initialize() {
sif::error << "VirtualChannel::initialize: Failed to get tm store" << std::endl;
return RETURN_FAILED;
}
return RETURN_OK;
}
ReturnValue_t VirtualChannel::performOperation() {
ReturnValue_t status = RETURN_OK;
ReturnValue_t result = RETURN_OK;
TmTcMessage message;
while(tmQueue->receiveMessage(&message) == RETURN_OK) {
@ -41,7 +40,7 @@ ReturnValue_t VirtualChannel::performOperation() {
}
if (linkIsUp) {
result = ptme->writeToVc(virtualChannleId, data, size);
result = ptme->writeToVc(vcId, data, size);
}
tmStore->deleteData(storeId);
@ -54,7 +53,7 @@ ReturnValue_t VirtualChannel::performOperation() {
}
MessageQueueId_t VirtualChannel::getReportReceptionQueue(uint8_t virtualChannel) {
return tmQueue.getId();
return tmQueue->getId();
}
void VirtualChannel::setPtmeObject(PtmeIF* ptme) {
@ -64,17 +63,6 @@ void VirtualChannel::setPtmeObject(PtmeIF* ptme) {
ptme = ptme;
}
void VirtualChannel::setIdlePacketIntervalMs(uint32_t idlePacketIntervalMs) {
timer.timeout = idlePacketIntervalMs;
}
ReturnValue_t VirtualChannel::flush() {
TmTcMessage message;
ReturnValue_t status = RETURN_FAILED;
for (status = tmQueue.receiveMessage(&message); status == RETURN_OK;
status = tmQueue.receiveMessage(&message)) {
packetStore->deleteData(message.getStorageId());
}
boardHandler->resetVC(virtualChannelId);
return status;
void VirtualChannel::setLinkState(bool linkIsUp) {
linkIsUp = linkIsUp;
}