/*! * \file protocol.h * \author S. Eisenhauer * \date 31.08.2011 * \brief Network protocol definition * * This file defines the network protocol used between XORAYA Connect and CanEasy * */ #ifndef PROTOCOL_H_SEI #define PROTOCOL_H_SEI #include #include "global.h" /// default IP of the XORAYA connect #define nDEFAULT_IP _T("192.168.1.214") /// network port for communication #define nPORT (7010) /// size of network buffers in bytes #define nNETWORK_BUFFSIZE (512) /*! * \brief type definition for network data buffer */ typedef boost::array tNetworkBuffer; /*! * \brief Enumeration of Network message types */ enum tenNetworkMessageType { nenReqStartPlugin //!< Request for starting a target plugin ,nenReqStopPlugin //!< Request for stopping a target plugin ,nenReqShutdown //!< Request for shutting down all target components ,nenReqImportLog //!< Request for importing a log file ,nenReqEnumerateLogs //!< Request for enumerating available log files ,nenReqEnumerateInterfaces //!< Request for enumerating hardware interfaces ,nenReqChangeMsgData //!< Request for changing the data of a CAN TX message ,nenReqUploadLogMsg //!< Request with log data ,nenRespStartPlugin //!< Response for a start plugin request ,nenRespStopPlugin //!< Response for a stop plugin request ,nenRespShutdown //!< Response for a shutdown request ,nenRespImportLog //!< Response for a import log request ,nenRespEnumerateLogs //!< Response for a enumerate logs request ,nenRespEnumerateInterfaces //!< Response for a enumerate interfaces request ,nenRespChangeMsgData //!< Response for a change message data request ,nenRespUploadLogMsg //!< Response for a upload log request ,nenRespUnknownReq //!< Response for a unknown request ,nenRespInvalidArg //!< Response for a request with invalid arguments ,nenNumberOfNetworkMessageTypes //!< must be last }; /*! * \brief structure of network message header */ struct tstNetworkMessageHeader { tenNetworkMessageType enMessageType; //!< type of the message uint32_t u32MessageLength; //!< total length of network message. less or equal nNETWORK_BUFFSIZE }; /// maximum length of the data part in a network message /// data size = message size - header size #define nNETWORK_DATALENGTH (nNETWORK_BUFFSIZE - sizeof(tstNetworkMessageHeader)) #endif /* PROTOCOL_H_SEI */