1
0
forked from fsfw/fsfw

message arriving.

big clean up in tcdistribution folder
This commit is contained in:
2020-07-08 02:20:38 +02:00
parent 399fc0e287
commit 2efcda735f
12 changed files with 253 additions and 174 deletions

View File

@ -1,5 +1,6 @@
#ifndef FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_
#define FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_
#include <framework/objectmanager/SystemObject.h>
#include <framework/osal/linux/TmTcUnixUdpBridge.h>
#include <framework/tasks/ExecutableObjectIF.h>
@ -16,7 +17,7 @@
* This class caches the IP address of the sender. It is assumed there
* is only one sender for now.
*/
class TcSocketPollingTask: public SystemObject,
class TcUnixUdpPollingTask: public SystemObject,
public ExecutableObjectIF {
friend class TmTcUnixUdpBridge;
public:
@ -24,17 +25,21 @@ public:
//! 0.5 default milliseconds timeout for now.
static constexpr timeval DEFAULT_TIMEOUT = {.tv_sec = 0, .tv_usec = 500};
TcSocketPollingTask(object_id_t objectId, object_id_t tmtcUnixUdpBridge,
TcUnixUdpPollingTask(object_id_t objectId, object_id_t tmtcUnixUdpBridge,
size_t frameSize = 0, double timeoutSeconds = -1);
virtual~ TcSocketPollingTask();
virtual~ TcUnixUdpPollingTask();
virtual ReturnValue_t performOperation(uint8_t opCode) override;
virtual ReturnValue_t initialize() override;
protected:
StorageManagerIF* tcStore = nullptr;
private:
//! TMTC bridge is cached.
object_id_t tmtcBridgeId = objects::NO_OBJECT;
TmTcUnixUdpBridge* tmtcBridge = nullptr;
MessageQueueId_t targetTcDestination = MessageQueueIF::NO_QUEUE;
//! Reception flags: https://linux.die.net/man/2/recvfrom.
int receptionFlags = 0;
@ -47,7 +52,7 @@ private:
size_t frameSize = 0;
timeval receptionTimeout;
ReturnValue_t handleSuccessfullTcRead();
ReturnValue_t handleSuccessfullTcRead(size_t bytesRead);
};