public class YPowerOutput extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YPowerOutput.TimedReportCallback
TimedReportCallback for PowerOutput
|
static interface |
YPowerOutput.UpdateCallback
Deprecated UpdateCallback for PowerOutput
|
Modifier and Type | Field and Description |
---|---|
protected YPowerOutput.UpdateCallback |
_valueCallbackPowerOutput |
protected int |
_voltage |
static int |
VOLTAGE_INVALID |
static int |
VOLTAGE_OFF
invalid voltage value
|
static int |
VOLTAGE_OUT3V3 |
static int |
VOLTAGE_OUT5V |
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YPowerOutput(String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
static YPowerOutput |
FindPowerOutput(String func)
Retrieves a dual power ouput control for a given identifier.
|
static YPowerOutput |
FirstPowerOutput()
Starts the enumeration of dual power ouput controls currently accessible.
|
int |
get_voltage()
Returns the voltage on the power ouput featured by
the module.
|
int |
getVoltage()
Returns the voltage on the power ouput featured by
the module.
|
YPowerOutput |
nextPowerOutput()
Continues the enumeration of dual power ouput controls started using yFirstPowerOutput().
|
int |
registerValueCallback(YPowerOutput.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_voltage(int newval)
Changes the voltage on the power output provided by the
module.
|
int |
setVoltage(int newval)
Changes the voltage on the power output provided by the
module.
|
_AddToCache, _clearDataStreamCache, _devRequest, _download, _escapeAttr, _FindFromCache, _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, 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 VOLTAGE_OFF
public static final int VOLTAGE_OUT3V3
public static final int VOLTAGE_OUT5V
public static final int VOLTAGE_INVALID
protected int _voltage
protected YPowerOutput.UpdateCallback _valueCallbackPowerOutput
protected YPowerOutput(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_voltage() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getVoltage() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_voltage(int newval) throws YAPI_Exception
newval
- : a value among YPowerOutput.VOLTAGE_OFF, YPowerOutput.VOLTAGE_OUT3V3 and
YPowerOutput.VOLTAGE_OUT5V corresponding to the voltage on the power output provided by the
moduleYAPI_Exception
- on errorpublic int setVoltage(int newval) throws YAPI_Exception
newval
- : a value among Y_VOLTAGE_OFF, Y_VOLTAGE_OUT3V3 and Y_VOLTAGE_OUT5V corresponding to
the voltage on the power output provided by the
moduleYAPI_Exception
- on errorpublic static YPowerOutput FindPowerOutput(String func)
func
- : a string that uniquely characterizes the power ouput controlpublic int registerValueCallback(YPowerOutput.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 YPowerOutput nextPowerOutput()
public static YPowerOutput FirstPowerOutput()
Copyright © 2015. All rights reserved.