//------------------------------------------------------------------------------
// <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 NanoLibAccessor : global::System.IDisposable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal NanoLibAccessor(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(NanoLibAccessor 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(NanoLibAccessor 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);
    }
  }

  ~NanoLibAccessor() {
    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_NanoLibAccessor(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
    }
  }

  public virtual void setLoggingLevel(LogLevel level) {
    NanolibPINVOKE.NanoLibAccessor_setLoggingLevel(swigCPtr, (int)level);
  }

  public virtual void setLoggingCallback(NlcLoggingCallback callback, LogModule logModule) {
    NanolibPINVOKE.NanoLibAccessor_setLoggingCallback(swigCPtr, NlcLoggingCallback.getCPtr(callback), (int)logModule);
  }

  public virtual void unsetLoggingCallback() {
    NanolibPINVOKE.NanoLibAccessor_unsetLoggingCallback(swigCPtr);
  }

  public virtual ResultBusHwIds listAvailableBusHardware() {
    ResultBusHwIds ret = new ResultBusHwIds(NanolibPINVOKE.NanoLibAccessor_listAvailableBusHardware(swigCPtr), true);
    return ret;
  }

  public virtual ResultVoid openBusHardwareWithProtocol(BusHardwareId busHwId, BusHardwareOptions busHwOpt) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_openBusHardwareWithProtocol(swigCPtr, BusHardwareId.getCPtr(busHwId), BusHardwareOptions.getCPtr(busHwOpt)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

  public virtual ResultVoid setBusState(BusHardwareId busHwId, string state) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_setBusState(swigCPtr, BusHardwareId.getCPtr(busHwId), state), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultDeviceHandle addDevice(DeviceId deviceId) {
    ResultDeviceHandle ret = new ResultDeviceHandle(NanolibPINVOKE.NanoLibAccessor_addDevice(swigCPtr, DeviceId.getCPtr(deviceId)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid removeDevice( Nlc.DeviceHandle  deviceHandle) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_removeDevice(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultDeviceId getDeviceId( Nlc.DeviceHandle  deviceHandle) {
    ResultDeviceId ret = new ResultDeviceId(NanolibPINVOKE.NanoLibAccessor_getDeviceId(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultDeviceIds getDeviceIds() {
    ResultDeviceIds ret = new ResultDeviceIds(NanolibPINVOKE.NanoLibAccessor_getDeviceIds(swigCPtr), true);
    return ret;
  }

  public virtual ResultVoid connectDevice( Nlc.DeviceHandle  deviceHandle) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_connectDevice(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultVoid disconnectDevice( Nlc.DeviceHandle  deviceHandle) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_disconnectDevice(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultVoid rebootDevice( Nlc.DeviceHandle  deviceHandle) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_rebootDevice(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultInt getDeviceVendorId( Nlc.DeviceHandle  deviceHandle) {
    ResultInt ret = new ResultInt(NanolibPINVOKE.NanoLibAccessor_getDeviceVendorId(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultInt getDeviceProductCode( Nlc.DeviceHandle  deviceHandle) {
    ResultInt ret = new ResultInt(NanolibPINVOKE.NanoLibAccessor_getDeviceProductCode(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultString getDeviceName( Nlc.DeviceHandle  deviceHandle) {
    ResultString ret = new ResultString(NanolibPINVOKE.NanoLibAccessor_getDeviceName(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultString getDeviceHardwareVersion( Nlc.DeviceHandle  deviceHandle) {
    ResultString ret = new ResultString(NanolibPINVOKE.NanoLibAccessor_getDeviceHardwareVersion(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultString getDeviceFirmwareBuildId( Nlc.DeviceHandle  deviceHandle) {
    ResultString ret = new ResultString(NanolibPINVOKE.NanoLibAccessor_getDeviceFirmwareBuildId(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultString getDeviceBootloaderBuildId( Nlc.DeviceHandle  deviceHandle) {
    ResultString ret = new ResultString(NanolibPINVOKE.NanoLibAccessor_getDeviceBootloaderBuildId(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultString getDeviceSerialNumber( Nlc.DeviceHandle  deviceHandle) {
    ResultString ret = new ResultString(NanolibPINVOKE.NanoLibAccessor_getDeviceSerialNumber(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultArrayByte getDeviceUid( Nlc.DeviceHandle  deviceHandle) {
    ResultArrayByte ret = new ResultArrayByte(NanolibPINVOKE.NanoLibAccessor_getDeviceUid(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultInt getDeviceBootloaderVersion( Nlc.DeviceHandle  deviceHandle) {
    ResultInt ret = new ResultInt(NanolibPINVOKE.NanoLibAccessor_getDeviceBootloaderVersion(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultInt getDeviceHardwareGroup( Nlc.DeviceHandle  deviceHandle) {
    ResultInt ret = new ResultInt(NanolibPINVOKE.NanoLibAccessor_getDeviceHardwareGroup(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultConnectionState getConnectionState( Nlc.DeviceHandle  deviceHandle) {
    ResultConnectionState ret = new ResultConnectionState(NanolibPINVOKE.NanoLibAccessor_getConnectionState(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultConnectionState checkConnectionState( Nlc.DeviceHandle  deviceHandle) {
    ResultConnectionState ret = new ResultConnectionState(NanolibPINVOKE.NanoLibAccessor_checkConnectionState(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultString getDeviceState( Nlc.DeviceHandle  deviceHandle) {
    ResultString ret = new ResultString(NanolibPINVOKE.NanoLibAccessor_getDeviceState(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ResultVoid setDeviceState( Nlc.DeviceHandle  deviceHandle, string state) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_setDeviceState(swigCPtr,  deviceHandle , state), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultDeviceIds scanDevices(BusHardwareId busHwId, NlcScanBusCallback callback) {
    ResultDeviceIds ret = new ResultDeviceIds(NanolibPINVOKE.NanoLibAccessor_scanDevices(swigCPtr, BusHardwareId.getCPtr(busHwId), NlcScanBusCallback.getCPtr(callback)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

  public virtual bool isBusHardwareOpen(BusHardwareId busHardwareId) {
    bool ret = NanolibPINVOKE.NanoLibAccessor_isBusHardwareOpen(swigCPtr, BusHardwareId.getCPtr(busHardwareId));
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultInt readNumber( Nlc.DeviceHandle  deviceHandle,  Nlc.OdIndex  odIndex) {
    ResultInt ret = new ResultInt(NanolibPINVOKE.NanoLibAccessor_readNumber(swigCPtr,  deviceHandle ,  odIndex ), true);
    return ret;
  }

  public virtual ResultString readString( Nlc.DeviceHandle  deviceHandle,  Nlc.OdIndex  odIndex) {
    ResultString ret = new ResultString(NanolibPINVOKE.NanoLibAccessor_readString(swigCPtr,  deviceHandle ,  odIndex ), true);
    return ret;
  }

  public virtual ResultArrayByte readBytes( Nlc.DeviceHandle  deviceHandle,  Nlc.OdIndex  odIndex) {
    ResultArrayByte ret = new ResultArrayByte(NanolibPINVOKE.NanoLibAccessor_readBytes(swigCPtr,  deviceHandle ,  odIndex ), true);
    return ret;
  }

  public virtual ResultVoid writeNumber( Nlc.DeviceHandle  deviceHandle, long value,  Nlc.OdIndex  odIndex, uint bitLength) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_writeNumber(swigCPtr,  deviceHandle , value,  odIndex , bitLength), true);
    return ret;
  }

  public virtual ResultVoid writeBytes( Nlc.DeviceHandle  deviceHandle, ByteVector data,  Nlc.OdIndex  odIndex) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_writeBytes(swigCPtr,  deviceHandle , ByteVector.getCPtr(data),  odIndex ), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultArrayInt readNumberArray( Nlc.DeviceHandle  deviceHandle, ushort index) {
    ResultArrayInt ret = new ResultArrayInt(NanolibPINVOKE.NanoLibAccessor_readNumberArray(swigCPtr,  deviceHandle , index), true);
    return ret;
  }

  public virtual ResultVoid uploadFirmwareFromFile( Nlc.DeviceHandle  deviceHandle, string absoluteFilePath, NlcDataTransferCallback callback) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_uploadFirmwareFromFile(swigCPtr,  deviceHandle , absoluteFilePath, NlcDataTransferCallback.getCPtr(callback)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid uploadFirmware( Nlc.DeviceHandle  deviceHandle, ByteVector fwData, NlcDataTransferCallback callback) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_uploadFirmware(swigCPtr,  deviceHandle , ByteVector.getCPtr(fwData), NlcDataTransferCallback.getCPtr(callback)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid uploadBootloaderFromFile( Nlc.DeviceHandle  deviceHandle, string bootloaderAbsoluteFilePath, NlcDataTransferCallback callback) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_uploadBootloaderFromFile(swigCPtr,  deviceHandle , bootloaderAbsoluteFilePath, NlcDataTransferCallback.getCPtr(callback)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid uploadBootloader( Nlc.DeviceHandle  deviceHandle, ByteVector btData, NlcDataTransferCallback callback) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_uploadBootloader(swigCPtr,  deviceHandle , ByteVector.getCPtr(btData), NlcDataTransferCallback.getCPtr(callback)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid uploadBootloaderFirmwareFromFile( Nlc.DeviceHandle  deviceHandle, string bootloaderAbsoluteFilePath, string absoluteFilePath, NlcDataTransferCallback callback) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_uploadBootloaderFirmwareFromFile(swigCPtr,  deviceHandle , bootloaderAbsoluteFilePath, absoluteFilePath, NlcDataTransferCallback.getCPtr(callback)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid uploadBootloaderFirmware( Nlc.DeviceHandle  deviceHandle, ByteVector btData, ByteVector fwData, NlcDataTransferCallback callback) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_uploadBootloaderFirmware(swigCPtr,  deviceHandle , ByteVector.getCPtr(btData), ByteVector.getCPtr(fwData), NlcDataTransferCallback.getCPtr(callback)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid uploadNanoJFromFile( Nlc.DeviceHandle  deviceHandle, string absoluteFilePath, NlcDataTransferCallback callback) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_uploadNanoJFromFile(swigCPtr,  deviceHandle , absoluteFilePath, NlcDataTransferCallback.getCPtr(callback)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultVoid uploadNanoJ( Nlc.DeviceHandle  deviceHandle, ByteVector vmmData, NlcDataTransferCallback callback) {
    ResultVoid ret = new ResultVoid(NanolibPINVOKE.NanoLibAccessor_uploadNanoJ(swigCPtr,  deviceHandle , ByteVector.getCPtr(vmmData), NlcDataTransferCallback.getCPtr(callback)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual OdLibrary getObjectDictionaryLibrary() {
    OdLibrary ret = new OdLibrary(NanolibPINVOKE.NanoLibAccessor_getObjectDictionaryLibrary(swigCPtr), false);
    return ret;
  }

  public virtual ResultObjectDictionary assignObjectDictionary( Nlc.DeviceHandle  deviceHandle, ObjectDictionary objectDictionary) {
    ResultObjectDictionary ret = new ResultObjectDictionary(NanolibPINVOKE.NanoLibAccessor_assignObjectDictionary(swigCPtr,  deviceHandle , ObjectDictionary.getCPtr(objectDictionary)), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultObjectDictionary autoAssignObjectDictionary( Nlc.DeviceHandle  deviceHandle, string dictionariesLocationPath) {
    ResultObjectDictionary ret = new ResultObjectDictionary(NanolibPINVOKE.NanoLibAccessor_autoAssignObjectDictionary(swigCPtr,  deviceHandle , dictionariesLocationPath), true);
    if (NanolibPINVOKE.SWIGPendingException.Pending) throw NanolibPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual ResultObjectDictionary getAssignedObjectDictionary( Nlc.DeviceHandle  deviceHandle) {
    ResultObjectDictionary ret = new ResultObjectDictionary(NanolibPINVOKE.NanoLibAccessor_getAssignedObjectDictionary(swigCPtr,  deviceHandle ), true);
    return ret;
  }

  public virtual ProfinetDCP getProfinetDCP() {
    ProfinetDCP ret = new ProfinetDCP(NanolibPINVOKE.NanoLibAccessor_getProfinetDCP(swigCPtr), false);
    return ret;
  }

  public virtual SamplerInterface getSamplerInterface() {
    SamplerInterface ret = new SamplerInterface(NanolibPINVOKE.NanoLibAccessor_getSamplerInterface(swigCPtr), false);
    return ret;
  }

}

}
