38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <fsfw/ipc/MessageQueueIF.h>
|
|
#include <fsfw/objectmanager/SystemObject.h>
|
|
#include <fsfw/storagemanager/StorageManagerIF.h>
|
|
#include <fsfw/tasks/ExecutableObjectIF.h>
|
|
#include <fsfw/tmtc/AcceptsTelemetryIF.h>
|
|
#include <netinet/in.h>
|
|
|
|
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
|
|
UdpTmTcBridgeNew(object_id_t objectId, uint16_t listeningPort, const sockaddr* defaultDestination,
|
|
socklen_t defaultDestinationLen);
|
|
virtual ~UdpTmTcBridgeNew();
|
|
|
|
ReturnValue_t initialize() override;
|
|
|
|
ReturnValue_t performOperation(uint8_t operationCode) override;
|
|
|
|
MessageQueueId_t getReportReceptionQueue() const override;
|
|
|
|
private:
|
|
uint16_t listeningPort;
|
|
MessageQueueIF* messageQueue;
|
|
int serverSocket;
|
|
StorageManagerIF* IPCStore;
|
|
|
|
sockaddr_storage defaultDestination;
|
|
const socklen_t defaultDestinationLen;
|
|
|
|
void handleTC();
|
|
void handleTM();
|
|
}; |