summaryrefslogtreecommitdiffstats
path: root/Src/ScriptXml.h
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2016-12-08 13:51:04 +0100
committerChristian Gromm <christian.gromm@microchip.com>2016-12-08 13:51:04 +0100
commit8c5f2324d7aa61669324aec1a0ad091fe1379489 (patch)
tree29cbdcdbe3657e1400d596ec3d560a2573d80817 /Src/ScriptXml.h
parente89ba11bd9111f02a940f227cf979f1947e975ac (diff)
src: unicens: import sources
This patch adds the source tree of the NetworkManager v3.0.4. Additionally, it provides the needed configuration scripts. Change-Id: I23778b51423b51a4f87741957e0fb208bceb79b3 Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Diffstat (limited to 'Src/ScriptXml.h')
-rw-r--r--Src/ScriptXml.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/Src/ScriptXml.h b/Src/ScriptXml.h
new file mode 100644
index 0000000..093c4ae
--- /dev/null
+++ b/Src/ScriptXml.h
@@ -0,0 +1,88 @@
+/*
+ * Video On Demand Samples
+ *
+ * Copyright (C) 2015 Microchip Technology Germany II GmbH & Co. KG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * You may also obtain this software under a propriety license from Microchip.
+ * Please contact Microchip for further information.
+ *
+ */
+
+/*----------------------------------------------------------*/
+/*! \file
+ * \brief This file contains the CSciptXml class.
+ */
+/*----------------------------------------------------------*/
+#ifndef _SCRIPTXML_H_
+#define _SCRIPTXML_H_
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <Types.h>
+#include "Xml.h"
+
+#define MAX_SCRIPT_NAME_LENGTH 64
+#define MAX_PAYLOAD_LENGTH 64
+
+typedef enum ScriptType_tag
+{
+ SCRIPT_UNKNOWN,
+ SCRIPT_MCM_SEND,
+ SCRIPT_PAUSE
+} ScriptType_t;
+
+/*----------------------------------------------------------*/
+/*!
+ * \brief Storage class to store the scripting informations. This class will be returned by
+ * the CSciptXml class.
+ */
+/*----------------------------------------------------------*/
+class CScript
+{
+public:
+ ScriptType_t scriptType;
+ char scriptName[MAX_SCRIPT_NAME_LENGTH];
+ uint8_t fblockId;
+ uint16_t functionId;
+ uint8_t opTypeRequest;
+ uint8_t opTypeResponse;
+ uint8_t payload[MAX_PAYLOAD_LENGTH];
+ uint32_t payloadLength;
+ uint32_t pauseInMillis;
+
+ CScript() : scriptType( SCRIPT_UNKNOWN ), fblockId( 0xFF ), functionId( 0xFFFF ), opTypeRequest( 0xFF ),
+ opTypeResponse( 0xFF ), payloadLength( 0 ), pauseInMillis( 0 )
+ {
+ scriptName[0] = '\0';
+ }
+};
+
+/*----------------------------------------------------------*/
+/*!
+ * \brief Class to read XML for the NetworkManager scripting use case.
+ */
+/*----------------------------------------------------------*/
+class CSciptXml : public CXml
+{
+private:
+ void StorePayload( xmlChar *xString, CScript *script );
+public:
+ CSciptXml( const char *szFile );
+ CSciptXml( const char *szBuffer, uint32_t nBufferLen );
+ bool GetScripts( CSafeVector<CScript *> &allChannels );
+};
+
+#endif //_SCRIPTXML_H_