/* ---------------------------------------------------------------------------- * 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. * ----------------------------------------------------------------------------- */ package upm_mq303a; public class MQ303A { private transient long swigCPtr; protected transient boolean swigCMemOwn; protected MQ303A(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(MQ303A obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected static long swigRelease(MQ303A 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", "removal"}) protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; javaupm_mq303aJNI.delete_MQ303A(swigCPtr); } swigCPtr = 0; } } public MQ303A(int pin, int heaterPin) { this(javaupm_mq303aJNI.new_MQ303A(pin, heaterPin), true); } public int value() { return javaupm_mq303aJNI.MQ303A_value(swigCPtr, this); } public void heaterEnable(boolean enable) { javaupm_mq303aJNI.MQ303A_heaterEnable(swigCPtr, this, enable); } }