From 8c5f2324d7aa61669324aec1a0ad091fe1379489 Mon Sep 17 00:00:00 2001 From: Christian Gromm Date: Thu, 8 Dec 2016 13:51:04 +0100 Subject: 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 --- Src/Network/IndustrialStack_MNS.h | 84 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 Src/Network/IndustrialStack_MNS.h (limited to 'Src/Network/IndustrialStack_MNS.h') diff --git a/Src/Network/IndustrialStack_MNS.h b/Src/Network/IndustrialStack_MNS.h new file mode 100644 index 0000000..7cb28ee --- /dev/null +++ b/Src/Network/IndustrialStack_MNS.h @@ -0,0 +1,84 @@ +/* + * 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 . + * + * You may also obtain this software under a propriety license from Microchip. + * Please contact Microchip for further information. + * + */ + +/*----------------------------------------------------------*/ +/*! \file + * \brief This file contains the CIndustrialStack class (NetService part). + */ +/*----------------------------------------------------------*/ + +#ifndef INDUSTRIAL_STACK_MNS_H +#define INDUSTRIAL_STACK_MNS_H + +#include +#include "IndustrialStack_Types.h" +#include "IndustrialStack_LLD.h" +#include "mns_types_cfg.h" +#include "mnsl.h" + +#define MNSW_TESTPATTERN ((uint32_t)0xA1B2C3D4) + +class IISNetServiceWrapperCB +{ +public: + virtual void OnReceivedMostMessage(CISMostMsg *rcvMessage) = 0; + virtual void OnSyncStateChanged(bool isSynced) = 0; + virtual void OnControlReadEnd() = 0; +}; + +class CISNetServiceWrapper : public CIndustrialStackLldCB +{ +public: + const uint32_t testPattern; + bool inicWriteError; + Mns_Lld_Api_t *pMnsInterface; + void *pMnsInst; + CTransceiver *icm_inst_ptr; + CTransceiver *rcm_inst_ptr; + CTransceiver *mcm_inst_ptr; +private: + CMnsl mnsl; + Mns_Lld_Callbacks_t pLldCb; + bool isSynced; + IISNetServiceWrapperCB *wrapperCB; + CIndustrialStackLld *lld; + +public: + CISNetServiceWrapper(uint8_t deviceApi, int controlRxHandle, int controlTxHandle); + virtual ~CISNetServiceWrapper(); + void ServiceMns(); + void AddListener(IISNetServiceWrapperCB *rcvListener); + + bool SendMostMessage(CISMostMsg *sndMessage); + void Unsynchronize(); + +public: + //Will be called from LLD, do not call directly + virtual void OnReadThreadEnd(CIndustrialStackLld *lld); + //All this functions will be called by the C wrappers, do not call them directly + void OnCtrlTxTransmit( Mns_Lld_TxMsg_t *msg_ptr); + void OnMnslEvent( Mnsl_Event_t event_code ); + void OnMessage( Msg_MostTel_t *pRx, CTransceiver *pTr ); +}; + +#endif //INDUSTRIAL_STACK_MNS_H -- cgit 1.2.3-korg