public class YColorLedCluster extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YColorLedCluster.TimedReportCallback
TimedReportCallback for ColorLedCluster
|
static interface |
YColorLedCluster.UpdateCallback
Deprecated UpdateCallback for ColorLedCluster
|
Modifier and Type | Field and Description |
---|---|
protected int |
_activeLedCount |
protected int |
_blinkSeqMaxCount |
protected int |
_blinkSeqMaxSize |
protected String |
_command |
protected int |
_ledType |
protected int |
_maxLedCount |
protected YColorLedCluster.UpdateCallback |
_valueCallbackColorLedCluster |
static int |
ACTIVELEDCOUNT_INVALID
invalid activeLedCount value
|
static int |
BLINKSEQMAXCOUNT_INVALID
invalid blinkSeqMaxCount value
|
static int |
BLINKSEQMAXSIZE_INVALID
invalid blinkSeqMaxSize value
|
static String |
COMMAND_INVALID
invalid command value
|
static int |
LEDTYPE_INVALID |
static int |
LEDTYPE_RGB
invalid ledType value
|
static int |
LEDTYPE_RGBW |
static int |
MAXLEDCOUNT_INVALID
invalid maxLedCount 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 |
YColorLedCluster(String func) |
protected |
YColorLedCluster(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 seqIndex,
int hslValue,
int delay)
Adds an HSL transition to a sequence.
|
int |
addJumpToBlinkSeq(int seqIndex,
int linkSeqIndex)
Adds to a sequence a jump to another sequence.
|
int |
addMirrorToBlinkSeq(int seqIndex)
Adds a mirror ending to a sequence.
|
int |
addRgbMoveToBlinkSeq(int seqIndex,
int rgbValue,
int delay)
Adds an RGB transition to a sequence.
|
int |
addUnlinkToBlinkSeq(int seqIndex)
Adds a to a sequence a hard stop code.
|
static YColorLedCluster |
FindColorLedCluster(String func)
Retrieves a RGB LED cluster for a given identifier.
|
static YColorLedCluster |
FindColorLedClusterInContext(YAPIContext yctx,
String func)
Retrieves a RGB LED cluster for a given identifier in a YAPI context.
|
static YColorLedCluster |
FirstColorLedCluster()
Starts the enumeration of RGB LED clusters currently accessible.
|
static YColorLedCluster |
FirstColorLedClusterInContext(YAPIContext yctx)
Starts the enumeration of RGB LED clusters currently accessible.
|
int |
get_activeLedCount()
Returns the number of LEDs currently handled by the device.
|
int |
get_blinkSeqMaxCount()
Returns the maximum number of sequences that the device can handle.
|
int |
get_blinkSeqMaxSize()
Returns the maximum length of sequences.
|
ArrayList<Integer> |
get_blinkSeqSignatures(int seqIndex,
int count)
Returns a list on 32 bit signatures for specified blinking sequences.
|
ArrayList<Integer> |
get_blinkSeqState(int seqIndex,
int count)
Returns a list of integers with the started state for specified blinking sequences.
|
ArrayList<Integer> |
get_blinkSeqStateAtPowerOn(int seqIndex,
int count)
Returns a list of integers with the "auto-start at power on" flag state for specified blinking sequences.
|
ArrayList<Integer> |
get_blinkSeqStateSpeed(int seqIndex,
int count)
Returns a list of integers with the current speed for specified blinking sequences.
|
String |
get_command() |
int |
get_ledType()
Returns the RGB LED type currently handled by the device.
|
ArrayList<Integer> |
get_linkedSeqArray(int ledIndex,
int count)
Returns a list on sequence index for each RGB LED.
|
int |
get_maxLedCount()
Returns the maximum number of LEDs that the device can handle.
|
ArrayList<Integer> |
get_rgbColorArray(int ledIndex,
int count)
Returns a list on 24bit RGB color values with the current colors displayed on
the RGB LEDs.
|
ArrayList<Integer> |
get_rgbColorArrayAtPowerOn(int ledIndex,
int count)
Returns a list on 24bit RGB color values with the RGB LEDs startup colors.
|
byte[] |
get_rgbColorBuffer(int ledIndex,
int count)
Returns a binary buffer with content from the LED RGB buffer, as is.
|
int |
getActiveLedCount()
Returns the number of LEDs currently handled by the device.
|
int |
getBlinkSeqMaxCount()
Returns the maximum number of sequences that the device can handle.
|
int |
getBlinkSeqMaxSize()
Returns the maximum length of sequences.
|
int |
getLedType()
Returns the RGB LED type currently handled by the device.
|
int |
getMaxLedCount()
Returns the maximum number of LEDs that the device can handle.
|
int |
hsl_move(int ledIndex,
int count,
int hslValue,
int delay)
Allows you to modify the current color of a group of adjacent LEDs to another color, in a seamless and
autonomous manner.
|
int |
hsl2rgb(int hslValue) |
int |
hsl2rgbInt(int temp1,
int temp2,
int temp3) |
int |
hslArray_move(ArrayList<Integer> hslList,
int delay)
Sets up a smooth HSL color transition to the specified pixel-by-pixel list of HSL
color codes.
|
int |
hslArrayOfs_move(int ledIndex,
ArrayList<Integer> hslList,
int delay)
Sets up a smooth HSL color transition to the specified pixel-by-pixel list of HSL
color codes.
|
int |
linkLedToBlinkSeq(int ledIndex,
int count,
int seqIndex,
int offset)
Links adjacent LEDs to a specific sequence.
|
int |
linkLedToBlinkSeqAtPowerOn(int ledIndex,
int count,
int seqIndex,
int offset)
Links adjacent LEDs to a specific sequence at device power-on.
|
int |
linkLedToPeriodicBlinkSeq(int ledIndex,
int count,
int seqIndex,
int periods)
Links adjacent LEDs to a specific sequence.
|
YColorLedCluster |
nextColorLedCluster()
Continues the enumeration of RGB LED clusters started using yFirstColorLedCluster().
|
int |
registerValueCallback(YColorLedCluster.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
resetBlinkSeq(int seqIndex)
Stops a sequence execution and resets its contents.
|
int |
rgb_move(int ledIndex,
int count,
int rgbValue,
int delay)
Allows you to modify the current color of a group of adjacent LEDs to another color, in a seamless and
autonomous manner.
|
int |
rgbArray_move(ArrayList<Integer> rgbList,
int delay)
Sets up a smooth RGB color transition to the specified pixel-by-pixel list of RGB
color codes.
|
int |
rgbArrayOfs_move(int ledIndex,
ArrayList<Integer> rgbList,
int delay)
Sets up a smooth RGB color transition to the specified pixel-by-pixel list of RGB
color codes.
|
int |
saveBlinkSeq(int seqIndex)
Saves the definition of a sequence.
|
int |
saveLedsConfigAtPowerOn()
Saves the LEDs power-on configuration.
|
int |
saveLedsState() |
int |
sendCommand(String command) |
int |
set_activeLedCount(int newval)
Changes the number of LEDs currently handled by the device.
|
int |
set_blinkSeqSpeed(int seqIndex,
int speed)
Changes the execution speed of a sequence.
|
int |
set_blinkSeqStateAtPowerOn(int seqIndex,
int autostart)
Configures a sequence to make it start automatically at device
startup.
|
int |
set_command(String newval) |
int |
set_hslColor(int ledIndex,
int count,
int hslValue)
Changes the current color of consecutive LEDs in the cluster, using a HSL color.
|
int |
set_hslColorArray(int ledIndex,
ArrayList<Integer> hslList)
Sends 24bit HSL colors (provided as a list of integers) to the LED HSL buffer, as is.
|
int |
set_hslColorAtPowerOn(int ledIndex,
int count,
int hslValue)
Changes the color at device startup of consecutive LEDs in the cluster, using a HSL color.
|
int |
set_hslColorBuffer(int ledIndex,
byte[] buff)
Sends a binary buffer to the LED HSL buffer, as is.
|
int |
set_ledType(int newval)
Changes the RGB LED type currently handled by the device.
|
int |
set_rgbColor(int ledIndex,
int count,
int rgbValue)
Changes the current color of consecutive LEDs in the cluster, using a RGB color.
|
int |
set_rgbColorArray(int ledIndex,
ArrayList<Integer> rgbList)
Sends 24bit RGB colors (provided as a list of integers) to the LED RGB buffer, as is.
|
int |
set_rgbColorAtPowerOn(int ledIndex,
int count,
int rgbValue)
Changes the color at device startup of consecutive LEDs in the cluster, using a RGB color.
|
int |
set_rgbColorBuffer(int ledIndex,
byte[] buff)
Sends a binary buffer to the LED RGB buffer, as is.
|
int |
setActiveLedCount(int newval)
Changes the number of LEDs currently handled by the device.
|
int |
setLedType(int newval)
Changes the RGB LED type currently handled by the device.
|
int |
startBlinkSeq(int seqIndex)
Starts a sequence execution: every LED linked to that sequence starts to
run it in a loop.
|
int |
stopBlinkSeq(int seqIndex)
Stops a sequence execution.
|
int |
unlinkLedFromBlinkSeq(int ledIndex,
int count)
Unlinks adjacent LEDs from a 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_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final int ACTIVELEDCOUNT_INVALID
public static final int LEDTYPE_RGB
public static final int LEDTYPE_RGBW
public static final int LEDTYPE_INVALID
public static final int MAXLEDCOUNT_INVALID
public static final int BLINKSEQMAXCOUNT_INVALID
public static final int BLINKSEQMAXSIZE_INVALID
public static final String COMMAND_INVALID
protected int _activeLedCount
protected int _ledType
protected int _maxLedCount
protected int _blinkSeqMaxCount
protected int _blinkSeqMaxSize
protected String _command
protected YColorLedCluster.UpdateCallback _valueCallbackColorLedCluster
protected YColorLedCluster(YAPIContext ctx, String func)
func
- : functionidprotected YColorLedCluster(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YFunction
Exception
public int get_activeLedCount() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getActiveLedCount() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_activeLedCount(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the number of LEDs currently handled by the deviceYAPI_Exception
- on errorpublic int setActiveLedCount(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the number of LEDs currently handled by the deviceYAPI_Exception
- on errorpublic int get_ledType() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLedType() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_ledType(int newval) throws YAPI_Exception
newval
- : either YColorLedCluster.LEDTYPE_RGB or YColorLedCluster.LEDTYPE_RGBW, according to
the RGB LED type currently handled by the deviceYAPI_Exception
- on errorpublic int setLedType(int newval) throws YAPI_Exception
newval
- : either Y_LEDTYPE_RGB or Y_LEDTYPE_RGBW, according to the RGB LED type currently
handled by the deviceYAPI_Exception
- on errorpublic int get_maxLedCount() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getMaxLedCount() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_blinkSeqMaxCount() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBlinkSeqMaxCount() 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 String get_command() throws YAPI_Exception
YAPI_Exception
public int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public static YColorLedCluster FindColorLedCluster(String func)
func
- : a string that uniquely characterizes the RGB LED clusterpublic static YColorLedCluster FindColorLedClusterInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the RGB LED clusterpublic int registerValueCallback(YColorLedCluster.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 set_rgbColor(int ledIndex, int count, int rgbValue) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.rgbValue
- : new color.YAPI_Exception
- on errorpublic int set_rgbColorAtPowerOn(int ledIndex, int count, int rgbValue) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.rgbValue
- : new color.YAPI_Exception
- on errorpublic int set_hslColorAtPowerOn(int ledIndex, int count, int hslValue) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.hslValue
- : new color.YAPI_Exception
- on errorpublic int set_hslColor(int ledIndex, int count, int hslValue) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.hslValue
- : new color.YAPI_Exception
- on errorpublic int rgb_move(int ledIndex, int count, int rgbValue, int delay) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.rgbValue
- : new color (0xRRGGBB).delay
- : transition duration in msYAPI_Exception
- on errorpublic int hsl_move(int ledIndex, int count, int hslValue, int delay) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.hslValue
- : new color (0xHHSSLL).delay
- : transition duration in msYAPI_Exception
- on errorpublic int addRgbMoveToBlinkSeq(int seqIndex, int rgbValue, int delay) throws YAPI_Exception
seqIndex
- : sequence index.rgbValue
- : target color (0xRRGGBB)delay
- : transition duration in msYAPI_Exception
- on errorpublic int addHslMoveToBlinkSeq(int seqIndex, int hslValue, int delay) throws YAPI_Exception
seqIndex
- : sequence index.hslValue
- : target color (0xHHSSLL)delay
- : transition duration in msYAPI_Exception
- on errorpublic int addMirrorToBlinkSeq(int seqIndex) throws YAPI_Exception
seqIndex
- : sequence index.YAPI_Exception
- on errorpublic int addJumpToBlinkSeq(int seqIndex, int linkSeqIndex) throws YAPI_Exception
seqIndex
- : sequence index.linkSeqIndex
- : index of the sequence to chain.YAPI_Exception
- on errorpublic int addUnlinkToBlinkSeq(int seqIndex) throws YAPI_Exception
seqIndex
- : sequence index.YAPI_Exception
- on errorpublic int linkLedToBlinkSeq(int ledIndex, int count, int seqIndex, int offset) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.seqIndex
- : sequence index.offset
- : execution offset in ms.YAPI_Exception
- on errorpublic int linkLedToBlinkSeqAtPowerOn(int ledIndex, int count, int seqIndex, int offset) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.seqIndex
- : sequence index.offset
- : execution offset in ms.YAPI_Exception
- on errorpublic int linkLedToPeriodicBlinkSeq(int ledIndex, int count, int seqIndex, int periods) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.seqIndex
- : sequence index.periods
- : number of periods to show on LEDs.YAPI_Exception
- on errorpublic int unlinkLedFromBlinkSeq(int ledIndex, int count) throws YAPI_Exception
ledIndex
- : index of the first affected LED.count
- : affected LED count.YAPI_Exception
- on errorpublic int startBlinkSeq(int seqIndex) throws YAPI_Exception
seqIndex
- : index of the sequence to start.YAPI_Exception
- on errorpublic int stopBlinkSeq(int seqIndex) throws YAPI_Exception
seqIndex
- : index of the sequence to stop.YAPI_Exception
- on errorpublic int resetBlinkSeq(int seqIndex) throws YAPI_Exception
seqIndex
- : index of the sequence to resetYAPI_Exception
- on errorpublic int set_blinkSeqStateAtPowerOn(int seqIndex, int autostart) throws YAPI_Exception
seqIndex
- : index of the sequence to reset.autostart
- : 0 to keep the sequence turned off and 1 to start it automatically.YAPI_Exception
- on errorpublic int set_blinkSeqSpeed(int seqIndex, int speed) throws YAPI_Exception
seqIndex
- : index of the sequence to start.speed
- : sequence running speed (-1000...1000).YAPI_Exception
- on errorpublic int saveLedsConfigAtPowerOn() throws YAPI_Exception
YAPI_Exception
- on errorpublic int saveLedsState() throws YAPI_Exception
YAPI_Exception
public int saveBlinkSeq(int seqIndex) throws YAPI_Exception
seqIndex
- : index of the sequence to start.YAPI_Exception
- on errorpublic int set_rgbColorBuffer(int ledIndex, byte[] buff) throws YAPI_Exception
ledIndex
- : index of the first LED which should be updatedbuff
- : the binary buffer to sendYAPI_Exception
- on errorpublic int set_rgbColorArray(int ledIndex, ArrayList<Integer> rgbList) throws YAPI_Exception
ledIndex
- : index of the first LED which should be updatedrgbList
- : a list of 24bit RGB codes, in the form 0xRRGGBBYAPI_Exception
- on errorpublic int rgbArrayOfs_move(int ledIndex, ArrayList<Integer> rgbList, int delay) throws YAPI_Exception
ledIndex
- : index of the first LED which should be updatedrgbList
- : a list of target 24bit RGB codes, in the form 0xRRGGBBdelay
- : transition duration in msYAPI_Exception
- on errorpublic int rgbArray_move(ArrayList<Integer> rgbList, int delay) throws YAPI_Exception
rgbList
- : a list of target 24bit RGB codes, in the form 0xRRGGBBdelay
- : transition duration in msYAPI_Exception
- on errorpublic int set_hslColorBuffer(int ledIndex, byte[] buff) throws YAPI_Exception
ledIndex
- : index of the first LED which should be updatedbuff
- : the binary buffer to sendYAPI_Exception
- on errorpublic int set_hslColorArray(int ledIndex, ArrayList<Integer> hslList) throws YAPI_Exception
ledIndex
- : index of the first LED which should be updatedhslList
- : a list of 24bit HSL codes, in the form 0xHHSSLLYAPI_Exception
- on errorpublic int hslArray_move(ArrayList<Integer> hslList, int delay) throws YAPI_Exception
hslList
- : a list of target 24bit HSL codes, in the form 0xHHSSLLdelay
- : transition duration in msYAPI_Exception
- on errorpublic int hslArrayOfs_move(int ledIndex, ArrayList<Integer> hslList, int delay) throws YAPI_Exception
ledIndex
- : index of the first LED which should be updatedhslList
- : a list of target 24bit HSL codes, in the form 0xHHSSLLdelay
- : transition duration in msYAPI_Exception
- on errorpublic byte[] get_rgbColorBuffer(int ledIndex, int count) throws YAPI_Exception
ledIndex
- : index of the first LED which should be returnedcount
- : number of LEDs which should be returnedYAPI_Exception
- on errorpublic ArrayList<Integer> get_rgbColorArray(int ledIndex, int count) throws YAPI_Exception
ledIndex
- : index of the first LED which should be returnedcount
- : number of LEDs which should be returnedYAPI_Exception
- on errorpublic ArrayList<Integer> get_rgbColorArrayAtPowerOn(int ledIndex, int count) throws YAPI_Exception
ledIndex
- : index of the first LED which should be returnedcount
- : number of LEDs which should be returnedYAPI_Exception
- on errorpublic ArrayList<Integer> get_linkedSeqArray(int ledIndex, int count) throws YAPI_Exception
ledIndex
- : index of the first LED which should be returnedcount
- : number of LEDs which should be returnedYAPI_Exception
- on errorpublic ArrayList<Integer> get_blinkSeqSignatures(int seqIndex, int count) throws YAPI_Exception
seqIndex
- : index of the first blinking sequence which should be returnedcount
- : number of blinking sequences which should be returnedYAPI_Exception
- on errorpublic ArrayList<Integer> get_blinkSeqStateSpeed(int seqIndex, int count) throws YAPI_Exception
seqIndex
- : index of the first sequence speed which should be returnedcount
- : number of sequence speeds which should be returnedYAPI_Exception
- on errorpublic ArrayList<Integer> get_blinkSeqStateAtPowerOn(int seqIndex, int count) throws YAPI_Exception
seqIndex
- : index of the first blinking sequence which should be returnedcount
- : number of blinking sequences which should be returnedYAPI_Exception
- on errorpublic ArrayList<Integer> get_blinkSeqState(int seqIndex, int count) throws YAPI_Exception
seqIndex
- : index of the first blinking sequence which should be returnedcount
- : number of blinking sequences which should be returnedYAPI_Exception
- on errorpublic int hsl2rgbInt(int temp1, int temp2, int temp3)
public int hsl2rgb(int hslValue)
public YColorLedCluster nextColorLedCluster()
public static YColorLedCluster FirstColorLedCluster()
public static YColorLedCluster FirstColorLedClusterInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2018. All rights reserved.