fsfw/osal/linux/TcUnixUdpPollingTask.h

33 lines
1.1 KiB
C
Raw Normal View History

2020-07-05 18:58:16 +02:00
#ifndef FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_
#define FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_
#include <framework/objectmanager/SystemObject.h>
#include <framework/tasks/ExecutableObjectIF.h>
2020-07-05 20:42:05 +02:00
#include <sys/socket.h>
2020-07-05 18:58:16 +02:00
/**
* @brief This class can be used to implement the polling of a Unix socket,
* using UDP for now.
* @details
* The task will be blocked while the specified number of bytes has not been
* received, so TC reception is handled inside a separate task.
* This class caches the IP address of the sender. It is assumed there
* is only one sender for now.
*/
class TcSocketPollingTask: public SystemObject,
public ExecutableObjectIF {
2020-07-05 20:42:05 +02:00
friend class TmTcUnixUdpBridge;
2020-07-05 18:58:16 +02:00
public:
TcSocketPollingTask(object_id_t objectId, object_id_t tmtcUnixUdpBridge);
virtual~ TcSocketPollingTask();
virtual ReturnValue_t performOperation(uint8_t opCode) override;
virtual ReturnValue_t initialize() override;
private:
2020-07-05 20:42:05 +02:00
//! Sender Address is cached here.
const struct sockaddr senderAddress;
2020-07-05 18:58:16 +02:00
};
#endif /* FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_ */