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

package com.nanotec.nanolib;

public class EtherCATBus {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected EtherCATBus(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(EtherCATBus obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected static long swigRelease(EtherCATBus obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        NanolibJNI.delete_EtherCATBus(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public String getNETWORK_FIRMWARE_STATE_OPTION_NAME() {
    return NanolibJNI.EtherCATBus_NETWORK_FIRMWARE_STATE_OPTION_NAME_get(swigCPtr, this);
  }

  public String getDEFAULT_NETWORK_FIRMWARE_STATE() {
    return NanolibJNI.EtherCATBus_DEFAULT_NETWORK_FIRMWARE_STATE_get(swigCPtr, this);
  }

  public String getEXCLUSIVE_LOCK_TIMEOUT_OPTION_NAME() {
    return NanolibJNI.EtherCATBus_EXCLUSIVE_LOCK_TIMEOUT_OPTION_NAME_get(swigCPtr, this);
  }

  public long getDEFAULT_EXCLUSIVE_LOCK_TIMEOUT() {
    return NanolibJNI.EtherCATBus_DEFAULT_EXCLUSIVE_LOCK_TIMEOUT_get(swigCPtr, this);
  }

  public String getSHARED_LOCK_TIMEOUT_OPTION_NAME() {
    return NanolibJNI.EtherCATBus_SHARED_LOCK_TIMEOUT_OPTION_NAME_get(swigCPtr, this);
  }

  public long getDEFAULT_SHARED_LOCK_TIMEOUT() {
    return NanolibJNI.EtherCATBus_DEFAULT_SHARED_LOCK_TIMEOUT_get(swigCPtr, this);
  }

  public String getREAD_TIMEOUT_OPTION_NAME() {
    return NanolibJNI.EtherCATBus_READ_TIMEOUT_OPTION_NAME_get(swigCPtr, this);
  }

  public long getDEFAULT_READ_TIMEOUT() {
    return NanolibJNI.EtherCATBus_DEFAULT_READ_TIMEOUT_get(swigCPtr, this);
  }

  public String getWRITE_TIMEOUT_OPTION_NAME() {
    return NanolibJNI.EtherCATBus_WRITE_TIMEOUT_OPTION_NAME_get(swigCPtr, this);
  }

  public long getDEFAULT_WRITE_TIMEOUT() {
    return NanolibJNI.EtherCATBus_DEFAULT_WRITE_TIMEOUT_get(swigCPtr, this);
  }

  public String getREAD_WRITE_ATTEMPTS_OPTION_NAME() {
    return NanolibJNI.EtherCATBus_READ_WRITE_ATTEMPTS_OPTION_NAME_get(swigCPtr, this);
  }

  public long getDEFAULT_READ_WRITE_ATTEMPTS() {
    return NanolibJNI.EtherCATBus_DEFAULT_READ_WRITE_ATTEMPTS_get(swigCPtr, this);
  }

  public String getCHANGE_NETWORK_STATE_ATTEMPTS_OPTION_NAME() {
    return NanolibJNI.EtherCATBus_CHANGE_NETWORK_STATE_ATTEMPTS_OPTION_NAME_get(swigCPtr, this);
  }

  public long getDEFAULT_CHANGE_NETWORK_STATE_ATTEMPTS() {
    return NanolibJNI.EtherCATBus_DEFAULT_CHANGE_NETWORK_STATE_ATTEMPTS_get(swigCPtr, this);
  }

  public String getPDO_IO_ENABLED_OPTION_NAME() {
    return NanolibJNI.EtherCATBus_PDO_IO_ENABLED_OPTION_NAME_get(swigCPtr, this);
  }

  public String getDEFAULT_PDO_IO_ENABLED() {
    return NanolibJNI.EtherCATBus_DEFAULT_PDO_IO_ENABLED_get(swigCPtr, this);
  }

  public EtherCATBus() {
    this(NanolibJNI.new_EtherCATBus(), true);
  }

}
