public class YColorLed extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YColorLed.TimedReportCallback
TimedReportCallback for ColorLed
|
static interface |
YColorLed.UpdateCallback
Deprecated UpdateCallback for ColorLed
|
static class |
YColorLed.YMove |
Modifier and Type | Field and Description |
---|---|
protected int |
_blinkSeqMaxSize |
protected int |
_blinkSeqSignature |
protected int |
_blinkSeqSize |
protected String |
_command |
protected int |
_hslColor |
protected YColorLed.YMove |
_hslMove |
protected int |
_rgbColor |
protected int |
_rgbColorAtPowerOn |
protected YColorLed.YMove |
_rgbMove |
protected YColorLed.UpdateCallback |
_valueCallbackColorLed |
static int |
BLINKSEQMAXSIZE_INVALID
invalid blinkSeqMaxSize value
|
static int |
BLINKSEQSIGNATURE_INVALID
invalid blinkSeqSignature value
|
static int |
BLINKSEQSIZE_INVALID
invalid blinkSeqSize value
|
static String |
COMMAND_INVALID
invalid command value
|
static int |
HSLCOLOR_INVALID
invalid hslColor value
|
static YColorLed.YMove |
HSLMOVE_INVALID |
static int |
RGBCOLOR_INVALID
invalid rgbColor value
|
static int |
RGBCOLORATPOWERON_INVALID
invalid rgbColorAtPowerOn value
|
static YColorLed.YMove |
RGBMOVE_INVALID |
_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 |
YColorLed(String func) |
protected |
YColorLed(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
int |
addHslMoveToBlinkSeq(int HSLcolor,
int msDelay)
Add a new transition to the blinking sequence, the move will
be performed in the HSL space.
|
int |
addRgbMoveToBlinkSeq(int RGBcolor,
int msDelay)
Adds a new transition to the blinking sequence, the move is
performed in the RGB space.
|
static YColorLed |
FindColorLed(String func)
Retrieves an RGB LED for a given identifier.
|
static YColorLed |
FindColorLedInContext(YAPIContext yctx,
String func)
Retrieves an RGB LED for a given identifier in a YAPI context.
|
static YColorLed |
FirstColorLed()
Starts the enumeration of RGB LEDs currently accessible.
|
static YColorLed |
FirstColorLedInContext(YAPIContext yctx)
Starts the enumeration of RGB LEDs currently accessible.
|
int |
get_blinkSeqMaxSize()
Returns the maximum length of the blinking sequence.
|
int |
get_blinkSeqSignature()
Return the blinking sequence signature.
|
int |
get_blinkSeqSize()
Returns the current length of the blinking sequence.
|
String |
get_command() |
int |
get_hslColor()
Returns the current HSL color of the LED.
|
YColorLed.YMove |
get_hslMove() |
int |
get_rgbColor()
Returns the current RGB color of the LED.
|
int |
get_rgbColorAtPowerOn()
Returns the configured color to be displayed when the module is turned on.
|
YColorLed.YMove |
get_rgbMove() |
int |
getBlinkSeqMaxSize()
Returns the maximum length of the blinking sequence.
|
int |
getBlinkSeqSignature()
Return the blinking sequence signature.
|
int |
getBlinkSeqSize()
Returns the current length of the blinking sequence.
|
int |
getHslColor()
Returns the current HSL color of the LED.
|
int |
getRgbColor()
Returns the current RGB color of the LED.
|
int |
getRgbColorAtPowerOn()
Returns the configured color to be displayed when the module is turned on.
|
int |
hslMove(int hsl_target,
int ms_duration)
Performs a smooth transition in the HSL color space between the current color and a target color.
|
YColorLed |
nextColorLed()
Continues the enumeration of RGB LEDs started using yFirstColorLed().
|
int |
registerValueCallback(YColorLed.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
resetBlinkSeq()
Resets the preprogrammed blinking sequence.
|
int |
rgbMove(int rgb_target,
int ms_duration)
Performs a smooth transition in the RGB color space between the current color and a target color.
|
int |
sendCommand(String command) |
int |
set_command(String newval) |
int |
set_hslColor(int newval)
Changes the current color of the LED, using a color HSL.
|
int |
set_hslMove(YColorLed.YMove newval) |
int |
set_rgbColor(int newval)
Changes the current color of the LED, using an RGB color.
|
int |
set_rgbColorAtPowerOn(int newval)
Changes the color that the LED will display by default when the module is turned on.
|
int |
set_rgbMove(YColorLed.YMove newval) |
int |
setHslColor(int newval)
Changes the current color of the LED, using a color HSL.
|
int |
setRgbColor(int newval)
Changes the current color of the LED, using an RGB color.
|
int |
setRgbColorAtPowerOn(int newval)
Changes the color that the LED will display by default when the module is turned on.
|
int |
startBlinkSeq()
Starts the preprogrammed blinking sequence.
|
int |
stopBlinkSeq()
Stops the preprogrammed blinking sequence.
|
_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 RGBCOLOR_INVALID
public static final int HSLCOLOR_INVALID
public static final int RGBCOLORATPOWERON_INVALID
public static final int BLINKSEQSIZE_INVALID
public static final int BLINKSEQMAXSIZE_INVALID
public static final int BLINKSEQSIGNATURE_INVALID
public static final String COMMAND_INVALID
public static final YColorLed.YMove RGBMOVE_INVALID
public static final YColorLed.YMove HSLMOVE_INVALID
protected int _rgbColor
protected int _hslColor
protected YColorLed.YMove _rgbMove
protected YColorLed.YMove _hslMove
protected int _rgbColorAtPowerOn
protected int _blinkSeqSize
protected int _blinkSeqMaxSize
protected int _blinkSeqSignature
protected String _command
protected YColorLed.UpdateCallback _valueCallbackColorLed
protected YColorLed(YAPIContext ctx, String func)
func
- : functionidprotected YColorLed(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int get_rgbColor() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getRgbColor() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_rgbColor(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the current color of the LED, using an RGB colorYAPI_Exception
- on errorpublic int setRgbColor(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the current color of the LED, using an RGB colorYAPI_Exception
- on errorpublic int get_hslColor() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getHslColor() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_hslColor(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the current color of the LED, using a color HSLYAPI_Exception
- on errorpublic int setHslColor(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the current color of the LED, using a color HSLYAPI_Exception
- on errorpublic YColorLed.YMove get_rgbMove() throws YAPI_Exception
YAPI_Exception
public int set_rgbMove(YColorLed.YMove newval) throws YAPI_Exception
YAPI_Exception
public int rgbMove(int rgb_target, int ms_duration) throws YAPI_Exception
rgb_target
- : desired RGB color at the end of the transitionms_duration
- : duration of the transition, in millisecondYAPI_Exception
- on errorpublic YColorLed.YMove get_hslMove() throws YAPI_Exception
YAPI_Exception
public int set_hslMove(YColorLed.YMove newval) throws YAPI_Exception
YAPI_Exception
public int hslMove(int hsl_target, int ms_duration) throws YAPI_Exception
hsl_target
- : desired HSL color at the end of the transitionms_duration
- : duration of the transition, in millisecondYAPI_Exception
- on errorpublic int get_rgbColorAtPowerOn() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getRgbColorAtPowerOn() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_rgbColorAtPowerOn(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the color that the LED will display by default when the
module is turned onYAPI_Exception
- on errorpublic int setRgbColorAtPowerOn(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the color that the LED will display by default when the
module is turned onYAPI_Exception
- on errorpublic int get_blinkSeqSize() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBlinkSeqSize() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_blinkSeqMaxSize() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBlinkSeqMaxSize() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_blinkSeqSignature() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBlinkSeqSignature() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_command() throws YAPI_Exception
YAPI_Exception
public int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public static YColorLed FindColorLed(String func)
func
- : a string that uniquely characterizes the RGB LEDpublic static YColorLed FindColorLedInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the RGB LEDpublic int registerValueCallback(YColorLed.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 int sendCommand(String command) throws YAPI_Exception
YAPI_Exception
public int addHslMoveToBlinkSeq(int HSLcolor, int msDelay) throws YAPI_Exception
HSLcolor
- : desired HSL color when the transition is completedmsDelay
- : duration of the color transition, in milliseconds.YAPI_Exception
- on errorpublic int addRgbMoveToBlinkSeq(int RGBcolor, int msDelay) throws YAPI_Exception
RGBcolor
- : desired RGB color when the transition is completedmsDelay
- : duration of the color transition, in milliseconds.YAPI_Exception
- on errorpublic int startBlinkSeq() throws YAPI_Exception
YAPI_Exception
- on errorpublic int stopBlinkSeq() throws YAPI_Exception
YAPI_Exception
- on errorpublic int resetBlinkSeq() throws YAPI_Exception
YAPI_Exception
- on errorpublic YColorLed nextColorLed()
public static YColorLed FirstColorLed()
public static YColorLed FirstColorLedInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2019. All rights reserved.