#ifndef CNETWORKDEVICESMGR_H
#define CNETWORKDEVICESMGR_H

#include "DeadboltDevice.h"
#include "SMSDevice.h"
#include "SprinklerDevice.h"
#include "SprinklerInterface.h"
#include "AbstractNetworkInterface.h"
#include "AvReceiverInterface.h"
#include "ChaletInterface.h"
#include "IspindelInterface.h"
#include "LoraModuleInterfaceInterface.h"
#include "AvReceiverConsoleInterface.h"

#include "QList"
#include <QObject>

class CVoipMsSMSClient;
class CMasterCtrl;
class CContactRepository;
class CSprinklerMgr;
class CAVReceiverDevice;
class CChaletDevice;
class CIspindelDevice;
class CLoraModuleInterface;


class CNetworkDevicesMgr: public QObject
{
    Q_OBJECT
public:

    CNetworkDevicesMgr();
    virtual ~CNetworkDevicesMgr();

    int InitNetworkDevices();

    int CreateNewSMSDevice(int Address,CAbstractNetworkCommIF *NetworkIF);
    int CreateNewSprinklerDevice(int Address, CAbstractNetworkCommIF *NetworkIF);
    int CreateNewSprinklerInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
    int CreateNewAvReceiverInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
    int CreateNewChaletInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
    int CreateNewIspindleInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
    int CreateNewLoraInterfaceInterface(int Address, CAbstractNetworkCommIF *NetworkIF);
    int BindNetworkChaletDevice(int Address, CAbstractNetworkCommIF *NetworkIF);
    int CreateNewAVReceiverConsoleInterface(int Address, CAbstractNetworkCommIF *NetworkIF);

    int FindDeviceByPtr(CNetworkDevice *Device);
    CNetworkDevice *GetDevice(int DeviceID, int Address);
    QList<CNetworkDevice*> GetDevices(int DeviceID);

    CAVReceiverDevice *mAvReceiverDevice;
    CChaletDevice *mChaletLoraDevice;
    CIspindelDevice *mIspindelDevice;
    CVoipMsSMSClient *mVoipMSInterfaceHandle;
    CContactRepository *mContactRepositoryHandle;
    CMasterCtrl *mProgramHandle;
    CSprinklerMgr *mSprinklerMgrHandle;
    CLoraModuleInterface *mLoraModuleInterfaceDevice;
    CChaletDevice *mChaletLTEDevice;

    int NewSMSMessagesReceived(QList<CSMSMessage> NewMessages);

private:

    QList<CNetworkDevice*> mNetworkDevicesList;

public slots:
    void EthernetNetworkDeviceDisconnected(CNetworkDevice*);
};

#endif // CNETWORKDEVICESMGR_H
