summaryrefslogtreecommitdiffstats
path: root/Master/Masterarbeit/src/common/inc/NetworkMessages.h
diff options
context:
space:
mode:
Diffstat (limited to 'Master/Masterarbeit/src/common/inc/NetworkMessages.h')
-rw-r--r--Master/Masterarbeit/src/common/inc/NetworkMessages.h282
1 files changed, 282 insertions, 0 deletions
diff --git a/Master/Masterarbeit/src/common/inc/NetworkMessages.h b/Master/Masterarbeit/src/common/inc/NetworkMessages.h
new file mode 100644
index 0000000..359bb85
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/NetworkMessages.h
@@ -0,0 +1,282 @@
+/*!
+ * \file NetworkMessages.h
+ * \author S. Eisenhauer
+ * \date 15.01.2012
+ * \brief Defintion of network messages and constant decoding objects
+ */
+#ifndef NETWORKMESSAGES_H_
+#define NETWORKMESSAGES_H_
+
+#include <NetworkTypes.h>
+#include "protocol.h"
+
+/// definition for received message type
+static CONST_NETWORK_ENUM(senRxMsgType
+ ,static_cast<int32_t>(nenReqStartPlugin)
+ ,static_cast<int32_t>(nenNumberOfNetworkMessageTypes-1));
+/// definition for received message length
+static CONST_NETWORK_UINT32(su32RxMsgMessageLength,8,512);
+static const tstTypeInfo* sapstRxMsgInfoArray[] =
+{
+ &senRxMsgType
+ ,&su32RxMsgMessageLength
+};
+/// decoding object for network message header
+static CONST_NETWORK_RECORD_PROP(sxRxMsgHeader,nenNumberOfNetworkMessageTypes,2,sapstRxMsgInfoArray);
+
+static CONST_NETWORK_ENUM(senReqStartPluginMsgType
+ ,static_cast<int32_t>(nenReqStartPlugin)
+ ,static_cast<int32_t>(nenReqStartPlugin));
+static CONST_NETWORK_UINT32(su32ReqStartPluginMessageLength,8,512);
+static CONST_NETWORK_INT32(si32ReqStartPluginInterface,-1,7);
+static CONST_NETWORK_STRING(ssReqStartPluginFilename,nNETWORK_DATALENGTH-4);
+static const tstTypeInfo* sapstReqStartPluginInfoArray[] =
+{
+ &senReqStartPluginMsgType
+ ,&su32ReqStartPluginMessageLength
+ ,&si32ReqStartPluginInterface
+ ,&ssReqStartPluginFilename
+};
+/// decoding object for start plugin request
+static CONST_NETWORK_RECORD_PROP(sxReqStartPluginMessage,nenReqStartPlugin,4,sapstReqStartPluginInfoArray);
+
+static CONST_NETWORK_ENUM(senRespStartPluginMessageType
+ ,static_cast<int32_t>(nenRespStartPlugin)
+ ,static_cast<int32_t>(nenRespStartPlugin));
+static CONST_NETWORK_UINT32(su32RespStartPluginMessageLength,8,8);
+static const tstTypeInfo* sapstRespStartPluginInfoArray[] =
+{
+ &senRespStartPluginMessageType
+ ,&su32RespStartPluginMessageLength
+};
+/// decoding object for start plugin response
+static CONST_NETWORK_RECORD_PROP(sxRespStartPluginMessage,nenRespStartPlugin,2,sapstRespStartPluginInfoArray);
+
+static CONST_NETWORK_ENUM(senReqShutdownMessageType
+ ,static_cast<int32_t>(nenReqShutdown)
+ ,static_cast<int32_t>(nenReqShutdown));
+static CONST_NETWORK_UINT32(su32ReqShutdownMessageLength,8,8);
+static const tstTypeInfo* sapstReqShutdownInfoArray[] =
+{
+ &senReqShutdownMessageType
+ ,&su32ReqShutdownMessageLength
+};
+/// decoding object for shutdown response
+static CONST_NETWORK_RECORD_PROP(sxReqShutdownMessage,nenReqShutdown,2,sapstReqShutdownInfoArray);
+
+static CONST_NETWORK_ENUM(senRespShutdownMessageType
+ ,static_cast<int32_t>(nenRespShutdown)
+ ,static_cast<int32_t>(nenRespShutdown));
+static CONST_NETWORK_UINT32(su32RespShutdownMessageLength,8,8);
+static const tstTypeInfo* sapstRespShutdownInfoArray[] =
+{
+ &senRespShutdownMessageType
+ ,&su32RespShutdownMessageLength
+};
+/// decoding object for shutdown response
+static CONST_NETWORK_RECORD_PROP(sxRespShutdownMessage,nenRespShutdown,2,sapstRespShutdownInfoArray);
+
+static CONST_NETWORK_ENUM(senReqStopPluginMessageType
+ ,static_cast<int32_t>(nenReqStopPlugin)
+ ,static_cast<int32_t>(nenReqStopPlugin));
+static CONST_NETWORK_UINT32(su32ReqStopPluginMessageLength,12,12);
+static CONST_NETWORK_INT32(si32ReqStopPluginInterface,1,7);
+static const tstTypeInfo* sapstReqStopPluginInfoArray[] =
+{
+ &senReqStopPluginMessageType
+ ,&su32ReqStopPluginMessageLength
+ ,&si32ReqStopPluginInterface
+};
+/// decoding object for stop plugin request
+static CONST_NETWORK_RECORD_PROP(sxReqStopPluginMessage,nenReqStopPlugin,3,sapstReqStopPluginInfoArray);
+
+static CONST_NETWORK_ENUM(senRespStopPluginMessageType
+ ,static_cast<int32_t>(nenRespStopPlugin)
+ ,static_cast<int32_t>(nenRespStopPlugin));
+static CONST_NETWORK_UINT32(su32RespStopPluginMessageLength,8,8);
+static const tstTypeInfo* sapstRespStopPluginInfoArray[] =
+{
+ &senRespStopPluginMessageType
+ ,&su32RespStopPluginMessageLength
+};
+/// decoding object for stop plugin response
+static CONST_NETWORK_RECORD_PROP(sxRespStopPluginMessage,nenRespStopPlugin,2,sapstRespStopPluginInfoArray);
+
+static CONST_NETWORK_ENUM(senRespUploadLogMsgMessageType
+ ,static_cast<int32_t>(nenRespUploadLogMsg)
+ ,static_cast<int32_t>(nenRespUploadLogMsg));
+static CONST_NETWORK_UINT32(su32RespUploadLogMsgMessageLength,8,8);
+static const tstTypeInfo* sapstRespUploadLogMsgInfoArray[] =
+{
+ &senRespUploadLogMsgMessageType
+ ,&su32RespUploadLogMsgMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxRespUploadLogMsgMessage,nenRespUploadLogMsg,2,sapstRespUploadLogMsgInfoArray);
+
+static CONST_NETWORK_ENUM(senRespChangeMsgDataMessageType
+ ,static_cast<int32_t>(nenRespChangeMsgData)
+ ,static_cast<int32_t>(nenRespChangeMsgData));
+static CONST_NETWORK_UINT32(su32RespChangeMsgDataMessageLength,8,8);
+static const tstTypeInfo* sapstRespChangeMsgDataInfoArray[] =
+{
+ &senRespChangeMsgDataMessageType
+ ,&su32RespChangeMsgDataMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxRespChangeMsgDataMessage,nenRespChangeMsgData,2,sapstRespChangeMsgDataInfoArray);
+
+static CONST_NETWORK_ENUM(senRespUnknownReqMessageType
+ ,static_cast<int32_t>(nenRespUnknownReq)
+ ,static_cast<int32_t>(nenRespUnknownReq));
+static CONST_NETWORK_UINT32(su32RespUnknownReqMessageLength,8,8);
+static const tstTypeInfo* sapstRespUnknownReqInfoArray[] =
+{
+ &senRespUnknownReqMessageType
+ ,&su32RespUnknownReqMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxRespUnknownReqMessage,nenRespUnknownReq,2,sapstRespUnknownReqInfoArray);
+
+static CONST_NETWORK_ENUM(senReqEnumerateInterfacesMessageType
+ ,static_cast<int32_t>(nenReqEnumerateInterfaces)
+ ,static_cast<int32_t>(nenReqEnumerateInterfaces));
+static CONST_NETWORK_UINT32(su32ReqEnumerateInterfacesMessageLength,8,8);
+static CONST_NETWORK_STRING(ssReqEnumerateInterfacesNames,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstReqEnumerateInterfacesInfoArray[] =
+{
+ &senReqEnumerateInterfacesMessageType
+ ,&su32ReqEnumerateInterfacesMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxReqEnumerateInterfacesMessage,nenReqEnumerateInterfaces,2,sapstReqEnumerateInterfacesInfoArray);
+
+static CONST_NETWORK_ENUM(senRespEnumerateInterfacesMessageType
+ ,static_cast<int32_t>(nenRespEnumerateInterfaces)
+ ,static_cast<int32_t>(nenRespEnumerateInterfaces));
+static CONST_NETWORK_UINT32(su32RespEnumerateInterfacesMessageLength,512,512);
+static CONST_NETWORK_STRING(ssRespEnumerateInterfacesNames,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstRespEnumerateInterfacesInfoArray[] =
+{
+ &senRespEnumerateInterfacesMessageType
+ ,&su32RespEnumerateInterfacesMessageLength
+ ,&ssRespEnumerateInterfacesNames
+};
+static CONST_NETWORK_RECORD_PROP(sxRespEnumerateInterfacesMessage,nenRespEnumerateInterfaces,3,sapstRespEnumerateInterfacesInfoArray);
+
+static CONST_NETWORK_ENUM(senReqImportLogMessageType
+ ,static_cast<int32_t>(nenReqImportLog)
+ ,static_cast<int32_t>(nenReqImportLog));
+static CONST_NETWORK_UINT32(su32ReqImportLogMessageLength,512,512);
+static CONST_NETWORK_STRING(ssReqImportLogFilename,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstReqImportLogInfoArray[] =
+{
+ &senReqImportLogMessageType
+ ,&su32ReqImportLogMessageLength
+ ,&ssReqImportLogFilename
+};
+static CONST_NETWORK_RECORD_PROP(sxReqImportLogMessage,nenReqImportLog,3,sapstReqImportLogInfoArray);
+
+static CONST_NETWORK_ENUM(senRespImportLogMessageType
+ ,static_cast<int32_t>(nenRespImportLog)
+ ,static_cast<int32_t>(nenRespImportLog));
+static CONST_NETWORK_UINT32(su32RespImportLogMessageLength,512,512);
+static CONST_NETWORK_STRING(ssRespImportLogFilename,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstRespImportLogInfoArray[] =
+{
+ &senRespImportLogMessageType
+ ,&su32RespImportLogMessageLength
+ ,&ssRespImportLogFilename
+};
+static CONST_NETWORK_RECORD_PROP(sxRespImportLogMessage,nenRespImportLog,3,sapstRespImportLogInfoArray);
+
+static CONST_NETWORK_ENUM(senReqChangeMsgDataMessageType
+ ,static_cast<int32_t>(nenReqChangeMsgData)
+ ,static_cast<int32_t>(nenReqChangeMsgData));
+static CONST_NETWORK_UINT32(su32ReqChangeMsgDataMessageLength,24,24);
+static CONST_NETWORK_INT32(si32ReqChangeMsgDataInterface,1,7);
+static CONST_NETWORK_UINT32(su32ReqChangeMsgDataCanMsgId,0,0x7FFFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData0,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData1,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData2,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData3,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData4,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData5,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData6,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData7,0,0xFF);
+static const tstTypeInfo* sapstReqChangeMsgDataInfoArray[] =
+{
+ &senReqChangeMsgDataMessageType
+ ,&su32ReqChangeMsgDataMessageLength
+ ,&si32ReqChangeMsgDataInterface
+ ,&su32ReqChangeMsgDataCanMsgId
+ ,&su8ReqChangeMsgDataData0
+ ,&su8ReqChangeMsgDataData1
+ ,&su8ReqChangeMsgDataData2
+ ,&su8ReqChangeMsgDataData3
+ ,&su8ReqChangeMsgDataData4
+ ,&su8ReqChangeMsgDataData5
+ ,&su8ReqChangeMsgDataData6
+ ,&su8ReqChangeMsgDataData7
+};
+static CONST_NETWORK_RECORD_PROP(sxReqChangeMsgDataMessage
+ ,nenReqChangeMsgData,12,sapstReqChangeMsgDataInfoArray);
+
+static CONST_NETWORK_ENUM(senReqEnumerateLogsMessageType
+ ,static_cast<int32_t>(nenReqEnumerateLogs)
+ ,static_cast<int32_t>(nenReqEnumerateLogs));
+static CONST_NETWORK_UINT32(su32ReqEnumerateLogsMessageLength,8,8);
+static const tstTypeInfo* sapstReqEnumerateLogsInfoArray[] =
+{
+ &senReqEnumerateLogsMessageType
+ ,&su32ReqEnumerateLogsMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxReqEnumerateLogsMessage,nenReqEnumerateLogs,2,sapstReqEnumerateLogsInfoArray);
+
+static CONST_NETWORK_ENUM(senRespEnumerateLogsMessageType
+ ,static_cast<int32_t>(nenRespEnumerateLogs)
+ ,static_cast<int32_t>(nenRespEnumerateLogs));
+static CONST_NETWORK_UINT32(su32RespEnumerateLogsMessageLength,512,512);
+static CONST_NETWORK_STRING(ssRespEnumerateLogsFilenames,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstRespEnumerateLogsInfoArray[] =
+{
+ &senRespEnumerateLogsMessageType
+ ,&su32RespEnumerateLogsMessageLength
+ ,&ssRespEnumerateLogsFilenames
+};
+static CONST_NETWORK_RECORD_PROP(sxRespEnumarateLogsMessage,nenRespEnumerateLogs,3,sapstRespEnumerateLogsInfoArray);
+
+static CONST_NETWORK_ENUM(senReqUploadLogMsgMessageType
+ ,static_cast<int32_t>(nenReqUploadLogMsg)
+ ,static_cast<int32_t>(nenReqUploadLogMsg));
+static CONST_NETWORK_UINT32(su32ReqUploadLogMsgMessageLength,0,512);
+static CONST_NETWORK_UINT32(su32ReqUploadLogMsgTimestampHigh,0,0xFFFFFFFF);
+static CONST_NETWORK_UINT32(su32ReqUploadLogMsgTimestampLow,0,0xFFFFFFFF);
+static CONST_NETWORK_INT32(si32ReqUploadLogMsgInterface,1,7);
+static CONST_NETWORK_UINT32(su32ReqUploadLogMsgCanMsgId,0,0x7FFFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData0,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData1,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData2,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData3,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData4,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData5,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData6,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData7,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgDirection,0,1);
+static const tstTypeInfo* sapstReqUploadLogMsgInfoArray[] =
+{
+ &senReqUploadLogMsgMessageType
+ ,&su32ReqUploadLogMsgMessageLength
+ ,&su32ReqUploadLogMsgTimestampHigh
+ ,&su32ReqUploadLogMsgTimestampLow
+ ,&si32ReqUploadLogMsgInterface
+ ,&su32ReqUploadLogMsgCanMsgId
+ ,&su8ReqUploadLogMsgData0
+ ,&su8ReqUploadLogMsgData1
+ ,&su8ReqUploadLogMsgData2
+ ,&su8ReqUploadLogMsgData3
+ ,&su8ReqUploadLogMsgData4
+ ,&su8ReqUploadLogMsgData5
+ ,&su8ReqUploadLogMsgData6
+ ,&su8ReqUploadLogMsgData7
+ ,&su8ReqUploadLogMsgDirection
+};
+static CONST_NETWORK_RECORD_PROP(sxReqUploadLogMsgMessage,nenReqUploadLogMsg,15,sapstReqUploadLogMsgInfoArray);
+
+#endif /*NETWORKMESSAGES_H_*/