fsfw/src/fsfw/tmtc/UdpTmTcBridge.h

40 lines
1.1 KiB
C
Raw Normal View History

2023-07-05 13:49:03 +02:00
#pragma once
2023-07-05 23:47:07 +02:00
#include <fsfw/ipc/MessageQueueIF.h>
2023-07-05 13:49:03 +02:00
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/storagemanager/StorageManagerIF.h>
2023-07-05 23:47:07 +02:00
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/tmtc/AcceptsTelemetryIF.h>
2023-10-27 13:40:29 +02:00
#include <sys/socket.h>
2023-07-05 23:47:07 +02:00
class UdpTmTcBridgeNew : public SystemObject,
public ExecutableObjectIF,
public AcceptsTelemetryIF2 {
public:
enum PerformOperationCode { BOTH = 0, TM, TC };
static const size_t MINIMAL_LENGTH = 4 + 2; // ObjectId, interface, function
2023-07-10 16:17:05 +02:00
UdpTmTcBridgeNew(object_id_t objectId, uint16_t listeningPort, const sockaddr* defaultDestination,
socklen_t defaultDestinationLen);
2023-07-05 23:47:07 +02:00
virtual ~UdpTmTcBridgeNew();
2023-07-05 13:49:03 +02:00
2023-07-05 23:47:07 +02:00
ReturnValue_t initialize() override;
2023-07-05 13:49:03 +02:00
2023-07-05 23:47:07 +02:00
ReturnValue_t performOperation(uint8_t operationCode) override;
2023-07-05 13:49:03 +02:00
2023-07-05 23:47:07 +02:00
MessageQueueId_t getReportReceptionQueue() const override;
2023-07-05 13:49:03 +02:00
2023-07-05 23:47:07 +02:00
private:
2023-07-10 16:17:05 +02:00
uint16_t listeningPort;
2023-07-05 23:47:07 +02:00
MessageQueueIF* messageQueue;
int serverSocket;
StorageManagerIF* IPCStore;
2023-07-05 13:49:03 +02:00
2023-07-10 16:17:05 +02:00
sockaddr_storage defaultDestination;
2023-07-05 23:47:07 +02:00
const socklen_t defaultDestinationLen;
2023-07-05 13:49:03 +02:00
2023-07-05 23:47:07 +02:00
void handleTC();
void handleTM();
2023-07-05 13:49:03 +02:00
};