Skip to content

File GroundCommsDriver.hpp

File List > Components > GroundCommsDriver > GroundCommsDriver.hpp

Go to the documentation of this file

#ifndef ORION_GROUND_COMMS_DRIVER_HPP
#define ORION_GROUND_COMMS_DRIVER_HPP

#include "Orion/Components/GroundCommsDriver/GroundCommsDriverComponentAc.hpp"

namespace Orion {

class GroundCommsDriver final : public GroundCommsDriverComponentBase {
  public:
    explicit GroundCommsDriver(const char* compName);
    ~GroundCommsDriver();

  private:
    // -----------------------------------------------------------------------
    // Port handler
    // -----------------------------------------------------------------------

    void fileDownlinkIn_handler(FwIndexType portNum, Fw::Buffer& buffer, const Fw::StringBase& reason) override;

    void schedIn_handler(FwIndexType portNum, U32 context) override;

    void modeChangeIn_handler(FwIndexType portNum, const Orion::MissionMode& mode) override;

    // -----------------------------------------------------------------------
    // Helpers
    // -----------------------------------------------------------------------

    bool transmit(const Fw::Buffer& buffer);

    bool transmitRaw(const U8* data, FwSizeType size);

    void saveToQueue(const Fw::Buffer& buffer);

    U32 flushQueue();

    // -----------------------------------------------------------------------
    // State
    // -----------------------------------------------------------------------

    U32 m_framesDownlinked;
    U32 m_bytesDownlinked;
    U32 m_transmitFailures;
    U32 m_framesQueued;
    U32 m_queueFileIndex;       
    MissionMode m_currentMode;  
};

}  // namespace Orion

#endif  // ORION_GROUND_COMMS_DRIVER_HPP