eive-obsw/bsp_linux/comIF/ArduinoComIF.h

74 lines
2.2 KiB
C

//#ifndef MISSION_ARDUINOCOMMINTERFACE_H_
//#define MISSION_ARDUINOCOMMINTERFACE_H_
//
//#include <bits/stdint-uintn.h>
//#include <framework/container/FixedMap.h>
//#include <framework/container/SimpleRingBuffer.h>
//#include <framework/devicehandlers/DeviceCommunicationIF.h>
//#include <framework/returnvalues/HasReturnvaluesIF.h>
//#include <stddef.h>
//
//#include "../../framework/objectmanager/SystemObject.h"
//#include "ArduinoCookie.h"
//
////Forward declaration, so users don't peek
//class ArduinoCookie;
//
//class ArduinoComIF: public SystemObject,
// public DeviceCommunicationIF {
//public:
// static const uint8_t MAX_NUMBER_OF_SPI_DEVICES = 8;
// static const uint8_t MAX_PACKET_SIZE = 64;
//
// static const uint8_t COMMAND_INVALID = -1;
// static const uint8_t COMMAND_SPI = 1;
//
// ArduinoComIF(object_id_t setObjectId, const char *serialDevice);
// virtual ~ArduinoComIF();
//
// virtual ReturnValue_t open(Cookie **cookie, uint32_t address,
// uint32_t maxReplyLen);
//
// virtual ReturnValue_t reOpen(Cookie *cookie, uint32_t address,
// uint32_t maxReplyLen);
//
// virtual void close(Cookie *cookie);
//
// //SHOULDDO can data be const?
// virtual ReturnValue_t sendMessage(Cookie *cookie, uint8_t *data,
// uint32_t len);
//
// virtual ReturnValue_t getSendSuccess(Cookie *cookie);
//
// virtual ReturnValue_t requestReceiveMessage(Cookie *cookie);
//
// virtual ReturnValue_t readReceivedMessage(Cookie *cookie, uint8_t **buffer,
// uint32_t *size);
//
// virtual ReturnValue_t setAddress(Cookie *cookie, uint32_t address);
//
// virtual uint32_t getAddress(Cookie *cookie);
//
// virtual ReturnValue_t setParameter(Cookie *cookie, uint32_t parameter);
//
// virtual uint32_t getParameter(Cookie *cookie);
//private:
// //remembering if the initialization in the ctor worked
// //if not, all calls are disabled
// bool initialized;
// int serialPort;
// //used to know where to put the data if a reply is received
// FixedMap<uint8_t, ArduinoCookie*> spiMap;
//
// SimpleRingBuffer rxBuffer;
//
// ReturnValue_t sendMessage(uint8_t command, uint8_t address,
// const uint8_t *data, size_t dataLen);
//
// void handleSerialPortRx();
//
// void handlePacket(uint8_t *packet, size_t packetLen);
//};
//
//#endif /* MISSION_ARDUINOCOMMINTERFACE_H_ */