SEcube open-source SDK
communication_api.h
Go to the documentation of this file.
1 
10 #include "../L0 Base/L0_base.h"
11 
12 class CommunicationApi {
13 private:
14  virtual bool Se3Open(uint64_t deadline, se3File* phFile, se3DiscoverInfo* disco) = 0;
15  virtual uint16_t L0TX(uint16_t cmd, uint16_t cmdFlags, uint16_t len, const uint8_t* data) = 0;
16  virtual uint16_t L0RX(uint16_t* respStatus, uint16_t* respLen, uint8_t* respData) = 0;
17 public:
18  /*
19  * @brief Empty destructor
20  */
21  virtual ~CommunicationApi() {};
31  virtual void L0Open(uint8_t devPtr) = 0;
32  virtual void L0Open() = 0;
33 
34  /*
35  * @brief Method used to close the seCube file handler and to free the device request and response
36  *
37  * @return Void
38  */
39  virtual void L0Close() = 0;
40 
41  /*
42  * @brief Method used to communicate with seCube, data is sent and the response is read
43  *
44  * @param[in] reqCmd Command that will be sent to the seCube
45  * @param[in] reqCmdFlags Flags used for transmission towards the seCube
46  * @param[in] reqLen Size of the data that wants to be transmitted
47  * @param[in] reqData Data buffer that will be sent to the seCube
48  * @param[out] respStatus Status of the seCube response
49  * @param[out] respLen Size of the response buffer
50  * @param[out] respData The response data buffer
51  *
52  * @return SE3_OK if communication was successful, the related error code otherwise
53  */
54  virtual void L0TXRX(uint16_t reqCmd, uint16_t reqCmdFlags, uint16_t reqLen, const uint8_t* reqData, uint16_t* respStatus, uint16_t* respLen, uint8_t* respData) = 0;
55  virtual uint16_t L0Echo(const uint8_t* dataIn, uint16_t dataInLen, uint8_t* dataOut) = 0;
56 };