#include "NetworkDevice.h"


CNetworkDevice::CNetworkDevice(int DeviceID, int DeviceAddress, CAbstractNetworkCommIF *Interface)
{
    mDeviceAddress = DeviceAddress;
    mDeviceID = DeviceID;
    mIsOnline = false;
    mNetworkInterfacePtr = 0;
    SetNetworkInterface(Interface);
}

CNetworkDevice::~CNetworkDevice()
{
    if(mNetworkInterfacePtr != 0)
    {
       // delete mNetworkInterfacePtr;
    }
}

void CNetworkDevice::SetNetworkInterface(CAbstractNetworkCommIF *Interface)
{
    if(mNetworkInterfacePtr != 0)
        delete mNetworkInterfacePtr;
     mNetworkInterfacePtr = Interface;
    if(Interface != 0)
    {
        mNetworkInterfacePtr->mDevicePtr = this;
    }
}


