public class YAnButton extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YAnButton.TimedReportCallback
TimedReportCallback for AnButton
|
static interface |
YAnButton.UpdateCallback
Deprecated UpdateCallback for AnButton
|
Modifier and Type | Field and Description |
---|---|
protected int |
_analogCalibration |
protected int |
_calibratedValue |
protected int |
_calibrationMax |
protected int |
_calibrationMin |
protected int |
_isPressed |
protected long |
_lastTimePressed |
protected long |
_lastTimeReleased |
protected long |
_pulseCounter |
protected long |
_pulseTimer |
protected int |
_rawValue |
protected int |
_sensitivity |
protected YAnButton.UpdateCallback |
_valueCallbackAnButton |
static int |
ANALOGCALIBRATION_INVALID |
static int |
ANALOGCALIBRATION_OFF
invalid analogCalibration value
|
static int |
ANALOGCALIBRATION_ON |
static int |
CALIBRATEDVALUE_INVALID
invalid calibratedValue value
|
static int |
CALIBRATIONMAX_INVALID
invalid calibrationMax value
|
static int |
CALIBRATIONMIN_INVALID
invalid calibrationMin value
|
static int |
ISPRESSED_FALSE
invalid isPressed value
|
static int |
ISPRESSED_INVALID |
static int |
ISPRESSED_TRUE |
static long |
LASTTIMEPRESSED_INVALID
invalid lastTimePressed value
|
static long |
LASTTIMERELEASED_INVALID
invalid lastTimeReleased value
|
static long |
PULSECOUNTER_INVALID
invalid pulseCounter value
|
static long |
PULSETIMER_INVALID
invalid pulseTimer value
|
static int |
RAWVALUE_INVALID
invalid rawValue value
|
static int |
SENSITIVITY_INVALID
invalid sensitivity value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YAnButton(String func) |
protected |
YAnButton(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
static YAnButton |
FindAnButton(String func)
Retrieves an analog input for a given identifier.
|
static YAnButton |
FindAnButtonInContext(YAPIContext yctx,
String func)
Retrieves an analog input for a given identifier in a YAPI context.
|
static YAnButton |
FirstAnButton()
Starts the enumeration of analog inputs currently accessible.
|
static YAnButton |
FirstAnButtonInContext(YAPIContext yctx)
Starts the enumeration of analog inputs currently accessible.
|
int |
get_analogCalibration()
Tells if a calibration process is currently ongoing.
|
int |
get_calibratedValue()
Returns the current calibrated input value (between 0 and 1000, included).
|
int |
get_calibrationMax()
Returns the maximal value measured during the calibration (between 0 and 4095, included).
|
int |
get_calibrationMin()
Returns the minimal value measured during the calibration (between 0 and 4095, included).
|
int |
get_isPressed()
Returns true if the input (considered as binary) is active (closed contact), and false otherwise.
|
long |
get_lastTimePressed()
Returns the number of elapsed milliseconds between the module power on and the last time
the input button was pressed (the input contact transitioned from open to closed).
|
long |
get_lastTimeReleased()
Returns the number of elapsed milliseconds between the module power on and the last time
the input button was released (the input contact transitioned from closed to open).
|
long |
get_pulseCounter()
Returns the pulse counter value.
|
long |
get_pulseTimer()
Returns the timer of the pulses counter (ms).
|
int |
get_rawValue()
Returns the current measured input value as-is (between 0 and 4095, included).
|
int |
get_sensitivity()
Returns the sensibility for the input (between 1 and 1000) for triggering user callbacks.
|
int |
getAnalogCalibration()
Tells if a calibration process is currently ongoing.
|
int |
getCalibratedValue()
Returns the current calibrated input value (between 0 and 1000, included).
|
int |
getCalibrationMax()
Returns the maximal value measured during the calibration (between 0 and 4095, included).
|
int |
getCalibrationMin()
Returns the minimal value measured during the calibration (between 0 and 4095, included).
|
int |
getIsPressed()
Returns true if the input (considered as binary) is active (closed contact), and false otherwise.
|
long |
getLastTimePressed()
Returns the number of elapsed milliseconds between the module power on and the last time
the input button was pressed (the input contact transitioned from open to closed).
|
long |
getLastTimeReleased()
Returns the number of elapsed milliseconds between the module power on and the last time
the input button was released (the input contact transitioned from closed to open).
|
long |
getPulseCounter()
Returns the pulse counter value.
|
long |
getPulseTimer()
Returns the timer of the pulses counter (ms).
|
int |
getRawValue()
Returns the current measured input value as-is (between 0 and 4095, included).
|
int |
getSensitivity()
Returns the sensibility for the input (between 1 and 1000) for triggering user callbacks.
|
YAnButton |
nextAnButton()
Continues the enumeration of analog inputs started using yFirstAnButton().
|
int |
registerValueCallback(YAnButton.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
resetCounter()
Returns the pulse counter value as well as its timer.
|
int |
set_analogCalibration(int newval)
Starts or stops the calibration process.
|
int |
set_calibrationMax(int newval)
Changes the maximal calibration value for the input (between 0 and 4095, included), without actually
starting the automated calibration.
|
int |
set_calibrationMin(int newval)
Changes the minimal calibration value for the input (between 0 and 4095, included), without actually
starting the automated calibration.
|
int |
set_pulseCounter(long newval) |
int |
set_sensitivity(int newval)
Changes the sensibility for the input (between 1 and 1000) for triggering user callbacks.
|
int |
setAnalogCalibration(int newval)
Starts or stops the calibration process.
|
int |
setCalibrationMax(int newval)
Changes the maximal calibration value for the input (between 0 and 4095, included), without actually
starting the automated calibration.
|
int |
setCalibrationMin(int newval)
Changes the minimal calibration value for the input (between 0 and 4095, included), without actually
starting the automated calibration.
|
int |
setPulseCounter(long newval) |
int |
setSensitivity(int newval)
Changes the sensibility for the input (between 1 and 1000) for triggering user callbacks.
|
_AddToCache, _clearDataStreamCache, _devRequest, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setAdvertisedValue, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final int CALIBRATEDVALUE_INVALID
public static final int RAWVALUE_INVALID
public static final int ANALOGCALIBRATION_OFF
public static final int ANALOGCALIBRATION_ON
public static final int ANALOGCALIBRATION_INVALID
public static final int CALIBRATIONMAX_INVALID
public static final int CALIBRATIONMIN_INVALID
public static final int SENSITIVITY_INVALID
public static final int ISPRESSED_FALSE
public static final int ISPRESSED_TRUE
public static final int ISPRESSED_INVALID
public static final long LASTTIMEPRESSED_INVALID
public static final long LASTTIMERELEASED_INVALID
public static final long PULSECOUNTER_INVALID
public static final long PULSETIMER_INVALID
protected int _calibratedValue
protected int _rawValue
protected int _analogCalibration
protected int _calibrationMax
protected int _calibrationMin
protected int _sensitivity
protected int _isPressed
protected long _lastTimePressed
protected long _lastTimeReleased
protected long _pulseCounter
protected long _pulseTimer
protected YAnButton.UpdateCallback _valueCallbackAnButton
protected YAnButton(YAPIContext ctx, String func)
func
- : functionidprotected YAnButton(String func)
func
- : functionidprotected void _parseAttr(org.json.JSONObject json_val) throws org.json.JSONException
_parseAttr
in class YFunction
org.json.JSONException
public int get_calibratedValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCalibratedValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_rawValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getRawValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_analogCalibration() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getAnalogCalibration() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_analogCalibration(int newval) throws YAPI_Exception
newval
- : either YAnButton.ANALOGCALIBRATION_OFF or YAnButton.ANALOGCALIBRATION_ONYAPI_Exception
- on errorpublic int setAnalogCalibration(int newval) throws YAPI_Exception
newval
- : either Y_ANALOGCALIBRATION_OFF or Y_ANALOGCALIBRATION_ONYAPI_Exception
- on errorpublic int get_calibrationMax() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCalibrationMax() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_calibrationMax(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the maximal calibration value for the input (between 0
and 4095, included), without actually
starting the automated calibrationYAPI_Exception
- on errorpublic int setCalibrationMax(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the maximal calibration value for the input (between 0
and 4095, included), without actually
starting the automated calibrationYAPI_Exception
- on errorpublic int get_calibrationMin() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getCalibrationMin() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_calibrationMin(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the minimal calibration value for the input (between 0
and 4095, included), without actually
starting the automated calibrationYAPI_Exception
- on errorpublic int setCalibrationMin(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the minimal calibration value for the input (between 0
and 4095, included), without actually
starting the automated calibrationYAPI_Exception
- on errorpublic int get_sensitivity() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getSensitivity() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_sensitivity(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the sensibility for the input (between 1 and 1000) for
triggering user callbacksYAPI_Exception
- on errorpublic int setSensitivity(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the sensibility for the input (between 1 and 1000) for
triggering user callbacksYAPI_Exception
- on errorpublic int get_isPressed() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getIsPressed() throws YAPI_Exception
YAPI_Exception
- on errorpublic long get_lastTimePressed() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getLastTimePressed() throws YAPI_Exception
YAPI_Exception
- on errorpublic long get_lastTimeReleased() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getLastTimeReleased() throws YAPI_Exception
YAPI_Exception
- on errorpublic long get_pulseCounter() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getPulseCounter() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_pulseCounter(long newval) throws YAPI_Exception
YAPI_Exception
public int setPulseCounter(long newval) throws YAPI_Exception
YAPI_Exception
public long get_pulseTimer() throws YAPI_Exception
YAPI_Exception
- on errorpublic long getPulseTimer() throws YAPI_Exception
YAPI_Exception
- on errorpublic static YAnButton FindAnButton(String func)
func
- : a string that uniquely characterizes the analog inputpublic static YAnButton FindAnButtonInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the analog inputpublic int registerValueCallback(YAnButton.UpdateCallback callback)
callback
- : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback
in class YFunction
public int resetCounter() throws YAPI_Exception
YAPI_Exception
- on errorpublic YAnButton nextAnButton()
public static YAnButton FirstAnButton()
public static YAnButton FirstAnButtonInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2017. All rights reserved.