//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (https://www.swig.org).
// Version 4.4.1
//
// Do not make changes to this file unless you know what you are doing - modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------

namespace  Nlc {

public class ProfinetDCP : global::System.IDisposable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal ProfinetDCP(global::System.IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProfinetDCP obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  internal static global::System.Runtime.InteropServices.HandleRef swigRelease(ProfinetDCP obj) {
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
      global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.Dispose();
      return ptr;
    } else {
      return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
    }
  }

  ~ProfinetDCP() {
    Dispose(false);
  }

  public void Dispose() {
    Dispose(true);
    global::System.GC.SuppressFinalize(this);
  }

  protected virtual void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          NanolibPINVOKE.delete_ProfinetDCP(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
    }
  }

  public virtual uint getScanTimeout() {
    uint ret = NanolibPINVOKE.ProfinetDCP_getScanTimeout(swigCPtr);
    return ret;
  }

  public virtual void setScanTimeout(uint timeoutMsec) {
    NanolibPINVOKE.ProfinetDCP_setScanTimeout(swigCPtr, timeoutMsec);
  }

  public virtual uint getResponseTimeout() {
    uint ret = NanolibPINVOKE.ProfinetDCP_getResponseTimeout(swigCPtr);
    return ret;
  }

  public virtual void setResponseTimeout(uint timeoutMsec) {
    NanolibPINVOKE.ProfinetDCP_setResponseTimeout(swigCPtr, timeoutMsec);
  }

  public virtual ResultVoid isServiceAvailable(BusHardwareId busHardwareId) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.ProfinetDCP_isServiceAvailable(swigCPtr, BusHardwareId.getCPtr(busHardwareId)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultProfinetDevices scanProfinetDevices(BusHardwareId busHardwareId, BusHardwareOptions options) {
    ResultProfinetDevices ret = new ResultProfinetDevices(NanolibPINVOKE.ProfinetDCP_scanProfinetDevices__SWIG_0(swigCPtr, BusHardwareId.getCPtr(busHardwareId), BusHardwareOptions.getCPtr(options)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultProfinetDevices scanProfinetDevices(BusHardwareId busHardwareId) {
    ResultProfinetDevices ret = new ResultProfinetDevices(NanolibPINVOKE.ProfinetDCP_scanProfinetDevices__SWIG_1(swigCPtr, BusHardwareId.getCPtr(busHardwareId)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid setupProfinetDevice(BusHardwareId busHardwareId, ProfinetDevice profinetDevice, bool savePermanent) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.ProfinetDCP_setupProfinetDevice(swigCPtr, BusHardwareId.getCPtr(busHardwareId), ProfinetDevice.getCPtr(profinetDevice), savePermanent), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid resetProfinetDevice(BusHardwareId busHardwareId, ProfinetDevice profinetDevice) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.ProfinetDCP_resetProfinetDevice(swigCPtr, BusHardwareId.getCPtr(busHardwareId), ProfinetDevice.getCPtr(profinetDevice)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid blinkProfinetDevice(BusHardwareId busHardwareId, ProfinetDevice profinetDevice) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.ProfinetDCP_blinkProfinetDevice(swigCPtr, BusHardwareId.getCPtr(busHardwareId), ProfinetDevice.getCPtr(profinetDevice)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid validateProfinetDeviceIp(BusHardwareId busHardwareId, ProfinetDevice profinetDevice) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.ProfinetDCP_validateProfinetDeviceIp(swigCPtr, BusHardwareId.getCPtr(busHardwareId), ProfinetDevice.getCPtr(profinetDevice)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
