com.yoctopuce.YoctoAPI
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 |
_hslColor |
protected YColorLed.YMove |
_hslMove |
protected int |
_rgbColor |
protected int |
_rgbColorAtPowerOn |
protected YColorLed.YMove |
_rgbMove |
protected YColorLed.UpdateCallback |
_valueCallbackColorLed |
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, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YColorLed(String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
static YColorLed |
FindColorLed(String func)
Retrieves an RGB led for a given identifier.
|
static YColorLed |
FirstColorLed()
Starts the enumeration of RGB leds currently accessible.
|
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 |
getHslColor()
Returns the current HSL color of the led.
|
YColorLed.YMove |
getHslMove() |
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.
|
YColorLed.YMove |
getRgbMove() |
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 |
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 |
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 a 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 |
setHslMove(YColorLed.YMove newval) |
int |
setRgbColor(int newval)
Changes the current color of the led, using a RGB color.
|
int |
setRgbColorAtPowerOn(int newval)
Changes the color that the led will display by default when the module is turned on.
|
int |
setRgbMove(YColorLed.YMove newval) |
_AddToCache, _devRequest, _download, _FindFromCache, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, 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 RGBCOLOR_INVALID
public static final int HSLCOLOR_INVALID
public static final int RGBCOLORATPOWERON_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 YColorLed.UpdateCallback _valueCallbackColorLed
protected YColorLed(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_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 a RGB colorYAPI_Exception
- on errorpublic int setRgbColor(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the current color of the led, using a 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
- on errorpublic YColorLed.YMove getRgbMove() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_rgbMove(YColorLed.YMove newval) throws YAPI_Exception
YAPI_Exception
public int setRgbMove(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
- on errorpublic YColorLed.YMove getHslMove() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_hslMove(YColorLed.YMove newval) throws YAPI_Exception
YAPI_Exception
public int setHslMove(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 static YColorLed FindColorLed(String func)
func
- : 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 YColorLed nextColorLed()
public static YColorLed FirstColorLed()
Copyright © 2014. All rights reserved.