public class YDualPower extends YFunction
| Modifier and Type | Class and Description |
|---|---|
static interface |
YDualPower.TimedReportCallback
TimedReportCallback for DualPower
|
static interface |
YDualPower.UpdateCallback
Deprecated UpdateCallback for DualPower
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
_extVoltage |
protected int |
_powerControl |
protected int |
_powerState |
protected YDualPower.UpdateCallback |
_valueCallbackDualPower |
static int |
EXTVOLTAGE_INVALID
invalid extVoltage value
|
static int |
POWERCONTROL_AUTO
invalid powerControl value
|
static int |
POWERCONTROL_FROM_EXT |
static int |
POWERCONTROL_FROM_USB |
static int |
POWERCONTROL_INVALID |
static int |
POWERCONTROL_OFF |
static int |
POWERSTATE_FROM_EXT |
static int |
POWERSTATE_FROM_USB |
static int |
POWERSTATE_INVALID |
static int |
POWERSTATE_OFF
invalid powerState 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 |
YDualPower(String func) |
protected |
YDualPower(YAPIContext ctx,
String func) |
| Modifier and Type | Method and Description |
|---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YDualPower |
FindDualPower(String func)
Retrieves a dual power switch for a given identifier.
|
static YDualPower |
FindDualPowerInContext(YAPIContext yctx,
String func)
Retrieves a dual power switch for a given identifier in a YAPI context.
|
static YDualPower |
FirstDualPower()
Starts the enumeration of dual power switches currently accessible.
|
static YDualPower |
FirstDualPowerInContext(YAPIContext yctx)
Starts the enumeration of dual power switches currently accessible.
|
int |
get_extVoltage()
Returns the measured voltage on the external power source, in millivolts.
|
int |
get_powerControl()
Returns the selected power source for module functions that require lots of current.
|
int |
get_powerState()
Returns the current power source for module functions that require lots of current.
|
int |
getExtVoltage()
Returns the measured voltage on the external power source, in millivolts.
|
int |
getPowerControl()
Returns the selected power source for module functions that require lots of current.
|
int |
getPowerState()
Returns the current power source for module functions that require lots of current.
|
YDualPower |
nextDualPower()
Continues the enumeration of dual power switches started using yFirstDualPower().
|
int |
registerValueCallback(YDualPower.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_powerControl(int newval)
Changes the selected power source for module functions that require lots of current.
|
int |
setPowerControl(int newval)
Changes the selected power source for module functions that require lots of current.
|
_AddToCache, _clearDataStreamCache, _decode_json_int, _decode_json_string, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _is_valid_pass, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, _uploadEx, 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_serialNumber, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, isReadOnly, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userDatapublic static final int POWERSTATE_OFF
public static final int POWERSTATE_FROM_USB
public static final int POWERSTATE_FROM_EXT
public static final int POWERSTATE_INVALID
public static final int POWERCONTROL_AUTO
public static final int POWERCONTROL_FROM_USB
public static final int POWERCONTROL_FROM_EXT
public static final int POWERCONTROL_OFF
public static final int POWERCONTROL_INVALID
public static final int EXTVOLTAGE_INVALID
protected int _powerState
protected int _powerControl
protected int _extVoltage
protected YDualPower.UpdateCallback _valueCallbackDualPower
protected YDualPower(YAPIContext ctx, String func)
func - : functionidprotected YDualPower(String func)
func - : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val)
throws Exception
_parseAttr in class YFunctionExceptionpublic int get_powerState()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getPowerState()
throws YAPI_Exception
YAPI_Exception - on errorpublic int get_powerControl()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getPowerControl()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_powerControl(int newval)
throws YAPI_Exception
newval - : a value among YDualPower.POWERCONTROL_AUTO, YDualPower.POWERCONTROL_FROM_USB,
YDualPower.POWERCONTROL_FROM_EXT and YDualPower.POWERCONTROL_OFF corresponding to the selected
power source for module functions that require lots of currentYAPI_Exception - on errorpublic int setPowerControl(int newval)
throws YAPI_Exception
newval - : a value among YDualPower.POWERCONTROL_AUTO, YDualPower.POWERCONTROL_FROM_USB,
YDualPower.POWERCONTROL_FROM_EXT and YDualPower.POWERCONTROL_OFF corresponding to the selected
power source for module functions that require lots of currentYAPI_Exception - on errorpublic int get_extVoltage()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getExtVoltage()
throws YAPI_Exception
YAPI_Exception - on errorpublic static YDualPower FindDualPower(String func)
func - : a string that uniquely characterizes the dual power switch, for instance
SERVORC1.dualPower.public static YDualPower FindDualPowerInContext(YAPIContext yctx, String func)
yctx - : a YAPI contextfunc - : a string that uniquely characterizes the dual power switch, for instance
SERVORC1.dualPower.public int registerValueCallback(YDualPower.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 YFunctionpublic YDualPower nextDualPower()
public static YDualPower FirstDualPower()
public static YDualPower FirstDualPowerInContext(YAPIContext yctx)
yctx - : a YAPI context.Copyright © 2026. All rights reserved.