public class YLed extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YLed.TimedReportCallback
TimedReportCallback for Led
|
static interface |
YLed.UpdateCallback
Deprecated UpdateCallback for Led
|
Modifier and Type | Field and Description |
---|---|
protected int |
_blinking |
protected int |
_luminosity |
protected int |
_power |
protected YLed.UpdateCallback |
_valueCallbackLed |
static int |
BLINKING_AWARE |
static int |
BLINKING_CALL |
static int |
BLINKING_INVALID |
static int |
BLINKING_PANIC |
static int |
BLINKING_RELAX |
static int |
BLINKING_RUN |
static int |
BLINKING_STILL
invalid blinking value
|
static int |
LUMINOSITY_INVALID
invalid luminosity value
|
static int |
POWER_INVALID |
static int |
POWER_OFF
invalid power value
|
static int |
POWER_ON |
_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 |
YLed(String func) |
protected |
YLed(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YLed |
FindLed(String func)
Retrieves a LED for a given identifier.
|
static YLed |
FindLedInContext(YAPIContext yctx,
String func)
Retrieves a LED for a given identifier in a YAPI context.
|
static YLed |
FirstLed()
Starts the enumeration of LEDs currently accessible.
|
static YLed |
FirstLedInContext(YAPIContext yctx)
Starts the enumeration of LEDs currently accessible.
|
int |
get_blinking()
Returns the current LED signaling mode.
|
int |
get_luminosity()
Returns the current LED intensity (in per cent).
|
int |
get_power()
Returns the current LED state.
|
int |
getBlinking()
Returns the current LED signaling mode.
|
int |
getLuminosity()
Returns the current LED intensity (in per cent).
|
int |
getPower()
Returns the current LED state.
|
YLed |
nextLed()
Continues the enumeration of LEDs started using yFirstLed().
|
int |
registerValueCallback(YLed.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_blinking(int newval)
Changes the current LED signaling mode.
|
int |
set_luminosity(int newval)
Changes the current LED intensity (in per cent).
|
int |
set_power(int newval)
Changes the state of the LED.
|
int |
setBlinking(int newval)
Changes the current LED signaling mode.
|
int |
setLuminosity(int newval)
Changes the current LED intensity (in per cent).
|
int |
setPower(int newval)
Changes the state of the LED.
|
_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_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, userData
public static final int POWER_OFF
public static final int POWER_ON
public static final int POWER_INVALID
public static final int LUMINOSITY_INVALID
public static final int BLINKING_STILL
public static final int BLINKING_RELAX
public static final int BLINKING_AWARE
public static final int BLINKING_RUN
public static final int BLINKING_CALL
public static final int BLINKING_PANIC
public static final int BLINKING_INVALID
protected int _power
protected int _luminosity
protected int _blinking
protected YLed.UpdateCallback _valueCallbackLed
protected YLed(YAPIContext ctx, String func)
func
- : functionidprotected YLed(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int get_power() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getPower() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_power(int newval) throws YAPI_Exception
newval
- : either YLed.POWER_OFF or YLed.POWER_ON, according to the state of the LEDYAPI_Exception
- on errorpublic int setPower(int newval) throws YAPI_Exception
newval
- : either Y_POWER_OFF or Y_POWER_ON, according to the state of the LEDYAPI_Exception
- on errorpublic int get_luminosity() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLuminosity() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_luminosity(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the current LED intensity (in per cent)YAPI_Exception
- on errorpublic int setLuminosity(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the current LED intensity (in per cent)YAPI_Exception
- on errorpublic int get_blinking() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBlinking() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_blinking(int newval) throws YAPI_Exception
newval
- : a value among YLed.BLINKING_STILL, YLed.BLINKING_RELAX, YLed.BLINKING_AWARE,
YLed.BLINKING_RUN, YLed.BLINKING_CALL and YLed.BLINKING_PANIC corresponding to the current LED signaling modeYAPI_Exception
- on errorpublic int setBlinking(int newval) throws YAPI_Exception
newval
- : a value among Y_BLINKING_STILL, Y_BLINKING_RELAX, Y_BLINKING_AWARE, Y_BLINKING_RUN,
Y_BLINKING_CALL and Y_BLINKING_PANIC corresponding to the current LED signaling modeYAPI_Exception
- on errorpublic static YLed FindLed(String func)
func
- : a string that uniquely characterizes the LEDpublic static YLed FindLedInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the LEDpublic int registerValueCallback(YLed.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 YLed nextLed()
public static YLed FirstLed()
public static YLed FirstLedInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2019. All rights reserved.