fsfw-example-common/stm32h7/networking/UdpTcLwIpPollingTask.h

37 lines
993 B
C
Raw Normal View History

#pragma once
2021-07-12 21:21:03 +02:00
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
2022-05-05 20:55:28 +02:00
#include <fsfw/tasks/ExecutableObjectIF.h>
2021-07-16 13:20:38 +02:00
#include <lwip/netif.h>
2021-07-12 21:21:03 +02:00
class TmTcLwIpUdpBridge;
/**
* @brief Separate task to poll EMAC interface.
* Polled data is passed to the netif (lwIP)
*/
2022-05-05 20:55:28 +02:00
class UdpTcLwIpPollingTask : public SystemObject,
public ExecutableObjectIF,
public HasReturnvaluesIF {
2022-08-08 12:32:06 +02:00
public:
UdpTcLwIpPollingTask(object_id_t objectId, object_id_t bridgeId, struct netif *gnetif);
~UdpTcLwIpPollingTask() override;
2022-05-05 20:55:28 +02:00
ReturnValue_t initialize() override;
2022-05-05 20:55:28 +02:00
/**
* Executed periodically.
* @param operationCode
* @return
*/
ReturnValue_t performOperation(uint8_t operationCode) override;
2022-05-05 20:55:28 +02:00
2022-08-08 12:32:06 +02:00
private:
2022-05-05 20:55:28 +02:00
static const uint8_t PERIODIC_HANDLE_TRIGGER = 5;
uint8_t periodicHandleCounter;
object_id_t bridgeId = 0;
2022-05-22 15:30:08 +02:00
TmTcLwIpUdpBridge *udpBridge = nullptr;
struct netif *gnetif = nullptr;
2021-07-12 21:21:03 +02:00
};