public class YPwmPowerSource extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YPwmPowerSource.TimedReportCallback
TimedReportCallback for PwmPowerSource
|
static interface |
YPwmPowerSource.UpdateCallback
Deprecated UpdateCallback for PwmPowerSource
|
Modifier and Type | Field and Description |
---|---|
protected int |
_powerMode |
protected YPwmPowerSource.UpdateCallback |
_valueCallbackPwmPowerSource |
static int |
POWERMODE_EXT_V |
static int |
POWERMODE_INVALID |
static int |
POWERMODE_OPNDRN |
static int |
POWERMODE_USB_3V |
static int |
POWERMODE_USB_5V
invalid powerMode 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 |
YPwmPowerSource(String func) |
protected |
YPwmPowerSource(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
static YPwmPowerSource |
FindPwmPowerSource(String func)
Retrieves a voltage source for a given identifier.
|
static YPwmPowerSource |
FindPwmPowerSourceInContext(YAPIContext yctx,
String func)
Retrieves a voltage source for a given identifier in a YAPI context.
|
static YPwmPowerSource |
FirstPwmPowerSource()
Starts the enumeration of Voltage sources currently accessible.
|
static YPwmPowerSource |
FirstPwmPowerSourceInContext(YAPIContext yctx)
Starts the enumeration of Voltage sources currently accessible.
|
int |
get_powerMode()
Returns the selected power source for the PWM on the same device.
|
int |
getPowerMode()
Returns the selected power source for the PWM on the same device.
|
YPwmPowerSource |
nextPwmPowerSource()
Continues the enumeration of Voltage sources started using yFirstPwmPowerSource().
|
int |
registerValueCallback(YPwmPowerSource.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_powerMode(int newval)
Changes the PWM power source.
|
int |
setPowerMode(int newval)
Changes the PWM power source.
|
_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 POWERMODE_USB_5V
public static final int POWERMODE_USB_3V
public static final int POWERMODE_EXT_V
public static final int POWERMODE_OPNDRN
public static final int POWERMODE_INVALID
protected int _powerMode
protected YPwmPowerSource.UpdateCallback _valueCallbackPwmPowerSource
protected YPwmPowerSource(YAPIContext ctx, String func)
func
- : functionidprotected YPwmPowerSource(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_powerMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getPowerMode() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_powerMode(int newval) throws YAPI_Exception
newval
- : a value among YPwmPowerSource.POWERMODE_USB_5V, YPwmPowerSource.POWERMODE_USB_3V,
YPwmPowerSource.POWERMODE_EXT_V and YPwmPowerSource.POWERMODE_OPNDRN corresponding to the PWM power sourceYAPI_Exception
- on errorpublic int setPowerMode(int newval) throws YAPI_Exception
newval
- : a value among Y_POWERMODE_USB_5V, Y_POWERMODE_USB_3V, Y_POWERMODE_EXT_V and
Y_POWERMODE_OPNDRN corresponding to the PWM power sourceYAPI_Exception
- on errorpublic static YPwmPowerSource FindPwmPowerSource(String func)
func
- : a string that uniquely characterizes the voltage sourcepublic static YPwmPowerSource FindPwmPowerSourceInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the voltage sourcepublic int registerValueCallback(YPwmPowerSource.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 YPwmPowerSource nextPwmPowerSource()
public static YPwmPowerSource FirstPwmPowerSource()
public static YPwmPowerSource FirstPwmPowerSourceInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2017. All rights reserved.