public class RGBLight extends LegoService
Modifier and Type | Class and Description |
---|---|
static class |
RGBLight.RGBLightMode |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SERVICE_RGB_LIGHT_NAME |
callbackHelper, connectInfo, inputFormat, io
Modifier | Constructor and Description |
---|---|
protected |
RGBLight(ConnectInfo connectInfo,
IO io) |
Modifier and Type | Method and Description |
---|---|
static RGBLight |
createService(ConnectInfo connectInfo,
IO io) |
boolean |
equals(java.lang.Object o) |
java.lang.Integer |
getColor() |
int |
getColorIndex() |
java.lang.Integer |
getDefaultColor() |
int |
getDefaultColorIndex() |
InputFormat |
getDefaultInputFormat()
The default input format that will be uploaded to the device for this service upon discovery of the service.
|
RGBLight.RGBLightMode |
getRGBMode()
The current mode of the RGB
|
java.lang.String |
getServiceName() |
void |
handleUpdatedValueData(byte[] valueData)
Handle new value data from device (may be overwritten in sub-classes)
|
int |
hashCode() |
void |
setColor(int rgbColor) |
void |
setColorIndex(int index) |
void |
setRGBMode(RGBLight.RGBLightMode rgbMode)
Sets the current mode of the RGB
|
void |
switchOff()
Switch off the RGB light on the device
|
void |
switchToDefaultColor()
Switch to the default Color (i.e.
|
addValidDataFormat, didReceiveInputFormat, didReceiveValueData, didRequestConnectInfo, getConnectInfo, getDevice, getFloatFromData, getInputFormat, getInputFormatMode, getIntegerFromData, getIo, getNumberFromValueData, getNumberFromValueData, getNumbersFromValueDataSet, getNumbersFromValueDataSet, getValidDataFormats, getValueAsFloat, getValueAsInteger, getValueData, handleUpdatedInputFormat, isInternalService, registerCallbackListener, removeValidDataFormat, sendReadValueRequest, sendResetStateRequest, setDevice, unregisterCallbackListener, updateCurrentInputFormatWithNewMode, updateInputFormat, writeData
public static final java.lang.String SERVICE_RGB_LIGHT_NAME
protected RGBLight(ConnectInfo connectInfo, IO io)
public static RGBLight createService(ConnectInfo connectInfo, IO io)
public java.lang.String getServiceName()
getServiceName
in class LegoService
public InputFormat getDefaultInputFormat()
LegoService
getDefaultInputFormat
in class LegoService
InputFormat
of the servicepublic void setColor(int rgbColor)
public java.lang.Integer getColor()
public java.lang.Integer getDefaultColor()
public int getColorIndex()
public void setColorIndex(int index)
public int getDefaultColorIndex()
public RGBLight.RGBLightMode getRGBMode()
public void setRGBMode(RGBLight.RGBLightMode rgbMode)
rgbMode
- The new RGB modepublic void switchOff()
public void switchToDefaultColor()
public void handleUpdatedValueData(byte[] valueData) throws LDSDKError
LegoService
handleUpdatedValueData
in class LegoService
valueData
- received value dataLDSDKError
- if received data could not be verifiedpublic boolean equals(java.lang.Object o)
equals
in class LegoService
public int hashCode()
hashCode
in class LegoService