testArduino/mission/DeviceHandler/ArduinoComIF.h

50 lines
1.5 KiB
C++

/*
* Title: ArduinoComIF.h
*
* Last Modify: 20/09/2021
* Author: Marco Modè
*
*/
#ifndef MISSION_DEVICEHANDLER_ARDUINOCOMIF_H_
#define MISSION_DEVICEHANDLER_ARDUINOCOMIF_H_
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/ipc/MessageQueueIF.h>
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
#include <vector>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <cstdint>
#include <map>
/**
* @brief Used to initialize the communication Interface (USB connector, serial port) and
* to perform the 4 periodical function described in the DeviceCommunicationIF.
* In this case sendMessage, getSendSuccess and requestReceiveMessage are
* just returning RETURN_OK.
* @details The ArduinoComIF is instantiated in the generic factory.
* @author: Marco Modè
* @ingroup mission/DeviceHandler
*/
class ArduinoComIF: public DeviceCommunicationIF, public SystemObject {
public:
ArduinoComIF(object_id_t objectId);
virtual ~ArduinoComIF();
ReturnValue_t initializeInterface(CookieIF *cookie) override;
ReturnValue_t sendMessage(CookieIF *cookie, const uint8_t *sendData,
size_t sendLen) override;
ReturnValue_t getSendSuccess(CookieIF *cookie) override;
ReturnValue_t requestReceiveMessage(CookieIF *cookie, size_t requestLen)
override;
ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer,
size_t *size) override;
};
#endif /* MISSION_DEVICEHANDLER_ARDUINOCOMIF_H_ */