public class YTemperature extends YSensor
Modifier and Type | Class and Description |
---|---|
static interface |
YTemperature.TimedReportCallback
TimedReportCallback for Temperature
|
static interface |
YTemperature.UpdateCallback
Deprecated UpdateCallback for Temperature
|
Modifier and Type | Field and Description |
---|---|
protected String |
_command |
protected int |
_sensorType |
protected YTemperature.TimedReportCallback |
_timedReportCallbackTemperature |
protected YTemperature.UpdateCallback |
_valueCallbackTemperature |
static String |
COMMAND_INVALID
invalid command value
|
static int |
SENSORTYPE_DIGITAL
invalid sensorType value
|
static int |
SENSORTYPE_INVALID |
static int |
SENSORTYPE_PT100_2WIRES |
static int |
SENSORTYPE_PT100_3WIRES |
static int |
SENSORTYPE_PT100_4WIRES |
static int |
SENSORTYPE_RES_LINEAR |
static int |
SENSORTYPE_RES_NTC |
static int |
SENSORTYPE_RES_OHM |
static int |
SENSORTYPE_TYPE_E |
static int |
SENSORTYPE_TYPE_J |
static int |
SENSORTYPE_TYPE_K |
static int |
SENSORTYPE_TYPE_N |
static int |
SENSORTYPE_TYPE_R |
static int |
SENSORTYPE_TYPE_S |
static int |
SENSORTYPE_TYPE_T |
_calhdl, _calibrationParam, _calpar, _calraw, _calref, _caltyp, _currentRawValue, _currentValue, _decexp, _highestValue, _iresol, _isScal, _isScal32, _logFrequency, _lowestValue, _offset, _prevTimedReport, _reportFrequency, _resolution, _scale, _timedReportCallbackSensor, _unit, _valueCallbackSensor, CALIBRATIONPARAM_INVALID, CURRENTRAWVALUE_INVALID, CURRENTVALUE_INVALID, HIGHESTVALUE_INVALID, LOGFREQUENCY_INVALID, LOWESTVALUE_INVALID, REPORTFREQUENCY_INVALID, RESOLUTION_INVALID, UNIT_INVALID
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YTemperature(String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeTimedReportCallback(YMeasure value) |
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
static YTemperature |
FindTemperature(String func)
Retrieves a temperature sensor for a given identifier.
|
static YTemperature |
FirstTemperature()
Starts the enumeration of temperature sensors currently accessible.
|
String |
get_command() |
int |
get_sensorType()
Returns the temperature sensor type.
|
String |
getCommand() |
int |
getSensorType()
Returns the temperature sensor type.
|
int |
loadThermistorResponseTable(ArrayList<Double> tempValues,
ArrayList<Double> resValues)
Retrieves the thermistor response table previously configured using the
set_thermistorResponseTable function.
|
YTemperature |
nextTemperature()
Continues the enumeration of temperature sensors started using yFirstTemperature().
|
int |
registerTimedReportCallback(YTemperature.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YTemperature.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_command(String newval) |
int |
set_sensorType(int newval)
Modifies the temperature sensor type.
|
int |
set_thermistorResponseTable(ArrayList<Double> tempValues,
ArrayList<Double> resValues)
Records a thermistor response table, in order to interpolate the temperature from
the measured resistance.
|
int |
set_unit(String newval)
Changes the measuring unit for the measured temperature.
|
int |
setCommand(String newval) |
int |
setSensorType(int newval)
Modifies the temperature sensor type.
|
int |
setUnit(String newval)
Changes the measuring unit for the measured temperature.
|
_applyCalibration, _decodeAvg, _decodeTimedReport, _decodeVal, _encodeCalibrationPoints, _parserHelper, calibrateFromPoints, FindSensor, FirstSensor, get_calibrationParam, get_currentRawValue, get_currentValue, get_highestValue, get_logFrequency, get_lowestValue, get_recordedData, get_reportFrequency, get_resolution, get_unit, getCalibrationParam, getCurrentRawValue, getCurrentValue, getHighestValue, getLogFrequency, getLowestValue, getReportFrequency, getResolution, getUnit, loadCalibrationPoints, nextSensor, registerTimedReportCallback, registerValueCallback, set_calibrationParam, set_highestValue, set_logFrequency, set_lowestValue, set_reportFrequency, set_resolution, setCalibrationParam, setHighestValue, setLogFrequency, setLowestValue, setReportFrequency, setResolution, startDataLogger, stopDataLogger
_AddToCache, _devRequest, _download, _escapeAttr, _FindFromCache, _json_get_array, _json_get_key, _json_get_string, _parse, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, describe, errMessage, errorMessage, errorType, errType, FindFunction, FirstFunction, 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, module, nextFunction, registerValueCallback, set_logicalName, set_userData, setLogicalName, setUserData, toString, userData
public static final int SENSORTYPE_DIGITAL
public static final int SENSORTYPE_TYPE_K
public static final int SENSORTYPE_TYPE_E
public static final int SENSORTYPE_TYPE_J
public static final int SENSORTYPE_TYPE_N
public static final int SENSORTYPE_TYPE_R
public static final int SENSORTYPE_TYPE_S
public static final int SENSORTYPE_TYPE_T
public static final int SENSORTYPE_PT100_4WIRES
public static final int SENSORTYPE_PT100_3WIRES
public static final int SENSORTYPE_PT100_2WIRES
public static final int SENSORTYPE_RES_OHM
public static final int SENSORTYPE_RES_NTC
public static final int SENSORTYPE_RES_LINEAR
public static final int SENSORTYPE_INVALID
public static final String COMMAND_INVALID
protected int _sensorType
protected String _command
protected YTemperature.UpdateCallback _valueCallbackTemperature
protected YTemperature.TimedReportCallback _timedReportCallbackTemperature
protected YTemperature(String func)
func
- : functionidprotected void _parseAttr(org.json.JSONObject json_val) throws org.json.JSONException
_parseAttr
in class YSensor
org.json.JSONException
public int set_unit(String newval) throws YAPI_Exception
newval
- : a string corresponding to the measuring unit for the measured temperatureYAPI_Exception
- on errorpublic int setUnit(String newval) throws YAPI_Exception
newval
- : a string corresponding to the measuring unit for the measured temperatureYAPI_Exception
- on errorpublic int get_sensorType() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getSensorType() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_sensorType(int newval) throws YAPI_Exception
newval
- : a value among YTemperature.SENSORTYPE_DIGITAL, YTemperature.SENSORTYPE_TYPE_K,
YTemperature.SENSORTYPE_TYPE_E, YTemperature.SENSORTYPE_TYPE_J, YTemperature.SENSORTYPE_TYPE_N,
YTemperature.SENSORTYPE_TYPE_R, YTemperature.SENSORTYPE_TYPE_S, YTemperature.SENSORTYPE_TYPE_T,
YTemperature.SENSORTYPE_PT100_4WIRES, YTemperature.SENSORTYPE_PT100_3WIRES,
YTemperature.SENSORTYPE_PT100_2WIRES, YTemperature.SENSORTYPE_RES_OHM,
YTemperature.SENSORTYPE_RES_NTC and YTemperature.SENSORTYPE_RES_LINEARYAPI_Exception
- on errorpublic int setSensorType(int newval) throws YAPI_Exception
newval
- : a value among Y_SENSORTYPE_DIGITAL, Y_SENSORTYPE_TYPE_K, Y_SENSORTYPE_TYPE_E,
Y_SENSORTYPE_TYPE_J, Y_SENSORTYPE_TYPE_N, Y_SENSORTYPE_TYPE_R, Y_SENSORTYPE_TYPE_S,
Y_SENSORTYPE_TYPE_T, Y_SENSORTYPE_PT100_4WIRES, Y_SENSORTYPE_PT100_3WIRES,
Y_SENSORTYPE_PT100_2WIRES, Y_SENSORTYPE_RES_OHM, Y_SENSORTYPE_RES_NTC and Y_SENSORTYPE_RES_LINEARYAPI_Exception
- on errorpublic String get_command() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getCommand() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public int setCommand(String newval) throws YAPI_Exception
YAPI_Exception
public static YTemperature FindTemperature(String func)
func
- : a string that uniquely characterizes the temperature sensorpublic int registerValueCallback(YTemperature.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 YSensor
public int registerTimedReportCallback(YTemperature.TimedReportCallback 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 an YMeasure object describing
the new advertised value.public int _invokeTimedReportCallback(YMeasure value)
_invokeTimedReportCallback
in class YSensor
public int set_thermistorResponseTable(ArrayList<Double> tempValues, ArrayList<Double> resValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, corresponding to all
temperatures (in degrees Celcius) for which the resistance of the
thermistor is specified.resValues
- : array of floating point numbers, corresponding to the resistance
values (in Ohms) for each of the temperature included in the first
argument, index by index.YAPI_Exception
- on errorpublic int loadThermistorResponseTable(ArrayList<Double> tempValues, ArrayList<Double> resValues) throws YAPI_Exception
tempValues
- : array of floating point numbers, that is filled by the function
with all temperatures (in degrees Celcius) for which the resistance
of the thermistor is specified.resValues
- : array of floating point numbers, that is filled by the function
with the value (in Ohms) for each of the temperature included in the
first argument, index by index.YAPI_Exception
- on errorpublic YTemperature nextTemperature()
public static YTemperature FirstTemperature()
Copyright © 2015. All rights reserved.