4.8. ILedCommandBuilder
added in version 1.13.0
An interface to provide functions to generate commands for the LED control.
Constant
Name
Contents
LED constants
Method
Name
Contents
A command to set the LED blink mode during presenter/bezel operation is generated and added to the command buffer.
A command to set the LED ON/OFF time in presenter/bezel operation is generated and added to the command buffer.
A command to blink the LED is generated and added to the command buffer.
Gets the command buffer (generated command).
This interface is only for models with LED indicator.This table shows the supported methods for each model.
Model/Emulation |
TUP500 | SK1-211/221/V211 | SK1-211/221/V211 Presenter | SK1-311/321/V311 | SK1-311/V311 Presenter |
---|---|---|---|---|---|
StarLine | StarPRNT | StarPRNT | StarPRNT | StarPRNT | |
appendAutomaticBlinkMode |
✔ | ✔ | ✔ | ✔ | ✔ |
appendAutomaticBlinkInterval |
✔ | ✔ | ✔[1] | ✔ | ✔[1] |
appendBlink |
✔ | - | ✔ | - | ✔ |
getCommands |
✔ | ✔ | ✔ | ✔ | ✔ |
[1] | In firmware version 1.0, if onTime or offTime is specified as 0, it is set to 100 milliseconds. |
4.8.1. Led
added in version 1.13.0
LED constants
Declaration
enum Led { Printing, Error, Idle }
Constants
Name
Contents
Printing
LED indicating printing or presenter/bezel operation
Error
LED indicating error
Idle
LED indicating idling
4.8.2. appendAutomaticBlinkMode
added in version 1.13.0
A command to set the LED blink mode during presenter/bezel operation is generated and added to the command buffer.
Declaration
void appendAutomaticBlinkMode(Led... led);
Parameter
Name
Contents
Type
led
LED constantsSpecifies the LED to blink.If nothing is specified for the argument, blinking will not be performed.The combination of parameters which can be set in the led argument are the following.
LedModel
Combination of parameters which can be set
Star
PrintingErrorPrinting, ErrorSK
PrintingErrorPrinting, ErrorPrinting, Error, IdleReturn value
None
Exception
Class
Contents
IllegalArgumentException
The combination of parameters which cannot be set in the led argument is specified.
Examples
private void print() { ... Led[] leds; switch (mAutomaticBlinkLedControlSpinner.getSelectedItemPosition()) { default: case 0: leds = new Led[] { Led.Printing, Led.Error }; break; case 1: leds = new Led[] { Led.Printing }; break; case 2: leds = new Led[] { Led.Error }; break; case 3: leds = new Led[] { }; break; case 4: leds = new Led[] { Led.Printing, Led.Error, Led.Idle }; break; } LedModel model = ModelCapability.getLedModel(mPrinterSettings.getModelIndex()); ILedCommandBuilder ledBuilder = StarIoExt.createLedCommandBuilder(model); try { ledBuilder.appendAutomaticBlinkMode(leds); List ledList = Arrays.asList(leds); if (ledList.contains(Led.Printing)) { ledBuilder.appendAutomaticBlinkInterval(Led.Printing, printingLedOnTime, printingLedOffTime); } if (ledList.contains(Led.Error)) { ledBuilder.appendAutomaticBlinkInterval(Led.Error, errorLedOnTime, errorLedOffTime); } if (ledList.contains(Led.Idle)) { ledBuilder.appendAutomaticBlinkInterval(Led.Idle, idleLedOnTime, idleLedOffTime); } } catch (IllegalArgumentException e) { ... } ... }
Refer to LedFragment.java.
4.8.3. appendAutomaticBlinkInterval
added in version 1.13.0
A command to set the LED ON/OFF time in presenter/bezel operation is generated and added to the command buffer.
Declaration
void appendAutomaticBlinkInterval(Led led, int onTime, int offTime);
Parameter
Name
Contents
Type
led
LED constantsSpecifies the LED to blink.onTime
On time (Units : mSec)Settable range: 0 - 25500int
offTime
Off time (Units : mSec)Settable range: 0 - 25500int
The parameters which can be set in the led argument are the following.
LedModel
Parameters which can be set
Star
PrintingErrorSK
PrintingErrorIdleReturn value
None
Exception
Class
Contents
IllegalArgumentException
Parameter is out of range
Examples
Refer to the example of the appendAutomaticBlinkMode method.
4.8.4. appendBlink
added in version 1.13.0
A command to blink the LED is generated and added to the command buffer.
Declaration
void appendBlink(Led led, int repeat, int onTime, int offTime);
Parameter
Name
Contents
Type
led
LED constantsSpecifies the LED to blink.repeat
Repeat countSettable range: 0 or moreint
onTime
On time (Units : mSec)Settable range: 1 - 25500int
offTime
Off time (Units : mSec)Settable range: 1 - 25500int
The parameters which can be set in the led argument are the following.
LedModel
Parameters which can be set
Star
PrintingErrorSK
PrintingErrorIdleReturn value
None
Exception
Class
Contents
IllegalArgumentException
Parameter is out of range
Examples
private void blinkLed() { mProgressDialog.show(); Led led; switch (mBlinkLedControlSpinner.getSelectedItemPosition()) { default: case 0: led = Led.Printing; break; case 1: led = Led.Error; break; } ... LedModel model = ModelCapability.getLedModel(mPrinterSettings.getModelIndex()); ILedCommandBuilder builder = StarIoExt.createLedCommandBuilder(model); try { builder.appendBlink(led, repeat, onTime, offTime); } catch (IllegalArgumentException e) { ... } byte[] commands = builder.getCommands(); }
Refer to LedFragment.java.
4.8.5. getCommands
added in version 1.13.0
Gets the command buffer (generated command).
Declaration
byte[] getCommands();
Parameter
None
Return value
Contents
Type
Command buffer (generated command)
byte[]