From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../src/common/inc/interface_manager.h | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Master/Masterarbeit/src/common/inc/interface_manager.h (limited to 'Master/Masterarbeit/src/common/inc/interface_manager.h') diff --git a/Master/Masterarbeit/src/common/inc/interface_manager.h b/Master/Masterarbeit/src/common/inc/interface_manager.h new file mode 100644 index 0000000..be910d4 --- /dev/null +++ b/Master/Masterarbeit/src/common/inc/interface_manager.h @@ -0,0 +1,99 @@ +/*! + * \file interface_manager.h + * + * \author S. Eisenhauer + * + * \date 31.08.2011 + * + * \brief Interface for accessing XORAYA hardware + * + * This file defines the interface for accessing XORAYA Connect hardware interfaces + * + */ + +#ifndef INTERFACE_MANAGER_H_ +#define INTERFACE_MANAGER_H_ + +#include "global.h" +#include "x2e/ReceiveQueue.hpp" + +/*! +* \brief Pure virtual interface used by other components and plugins to access XORAYA hardware +*/ +class IInterfaceManager +{ +public: + /*! + * Sends a mesage on a hardware interface + * \param[in] i32InterfaceHandle Interface handle + * \param[in] u32MsgId ID of the message + * \param[in] boIsExtended TRUE indicates an extended ID (29 bit long), FALSE a standard ID (11 bit long) + * \param[in] boIsRtrFrame is this an RTR frame + * \param[in] pu8Data pointer to the buffer for the message payload + * \param[in] u32DataLength Length of message payload in byte (DLC) + * \return status code + */ + virtual x2e::status_t enWriteCanMessage( + int32_t i32InterfaceHandle, + uint32_t u32MsgId, + bool boIsExtended, + bool boIsRtrFrame, + const uint8_t* pu8Data, + uint32_t u32DataLength) = 0; + + /*! + * Retrieve the fill level of the receive queue + * \param[out] stFillLevel Reference to a queueFillLevel object + * \return status code + */ + virtual x2e::status_t enGetQueueFillLevel(x2e::Log::queueFillLevel& stFillLevel) = 0; + + /*! + * Get a message from the receive queue + * \param[out] stFillLevel Reference to a queueFillLevel object + * \param[out] pstMsgDescr Pointer to a message description object + * \param[out] pstMsgPayload Pointer to framePayload object as buffer for the message content + * \return status code + */ + virtual x2e::status_t enPeekMessage( + x2e::Log::queueFillLevel& stFillLevel, + x2e::Log::messageDescription* pstMsgDescr, + x2e::Log::framePayload* pstMsgPayload) = 0; + + /*! + * Enable an Hardware interface + * \param[in] i32RequestedIntereface Interface handle + * \return status code + */ + virtual x2e::status_t enEnableInterface( int32_t i32RequestedIntereface ) = 0; + + /*! + * Enable all Hardware interface + * \return status code + */ + virtual x2e::status_t enEnableAllInterfaces( void ) = 0; + + /*! + * Gets the current 100 nanosecond timestamp of the system + * \param[out] pu32TsHigh Upper 32 bit of the timestamp + * \param[out] pu32TsLow Lower 32 bit of the timestamp + * \return status code + */ + virtual x2e::status_t enGetTimestamp( uint32_t* pu32TsHigh, uint32_t* pu32TsLow ) = 0; + + /*! + * wait on the internal hardware timer + * \return status code + */ + virtual x2e::status_t enWait() = 0; + + /*! + * get interface handle by a log interface id + * \param[in] u16LogIfId log interface id + * \return interface handle + */ + virtual int32_t i32GetInterfaceByLogIfId(x2e::Log::InterfaceId::ifid_t u16LogIfId) = 0; +}; + + +#endif /* INTERFACE_MANAGER_H_ */ -- cgit v1.2.3