public interface LEDDevice extends Device
The LED device object is obtained from the POSTerminal
, its' as follows:
LEDDevice lEDDevice = (LEDDevice) POSTerminal.getInstance().getDevice("cloudpos.device.led");Among them, the "cloudpos.device.led" string is to identify the LED device, defined by the specific implementation.
Uses the LED device object to control the operation of the LED device.
An app can request permission to access the device, as shown below:
<uses-permission android:name="android.permission.CLOUDPOS_LED" />
Device
Modifier and Type | Field and Description |
---|---|
static int |
STATUS_OFF
Light off
|
static int |
STATUS_ON
Light on
|
Modifier and Type | Method and Description |
---|---|
void |
blink(byte color,
long delayTurnOn,
long delayTurnOff,
int counts)
This method causes the LED to blink a specified number of times.
|
void |
blink(long delayTurnOn,
long delayTurnOff,
int counts)
This method causes the LED to blink a specified number of times.
|
void |
cancelBlink()
This method cancels the blink of the LED.
|
int |
getLogicalID()
Gets the current using logicalID.
|
int |
getStatus()
Gets the LED current status.
|
void |
open(int logicalID)
Opens the control of the LED.
|
void |
startBlink(byte color,
long delayTurnOn,
long delayTurnOff,
int counts)
This method causes the LED to begin blinking continuously.
|
void |
startBlink(long delayTurnOn,
long delayTurnOff)
This method causes the LED to begin blinking continuously.
|
void |
startBlink(long delayTurnOn,
long delayTurnOff,
int counts)
This method causes the LED to begin blinking continuously.
|
void |
turnOff()
Turn off the LED.
|
void |
turnOn()
Turn on the LED.
|
cancelRequest, close, getFailCount, getUsageCount, open
static final int STATUS_OFF
static final int STATUS_ON
void open(int logicalID) throws DeviceException
logicalID
- The logical ID of the device to open.DeviceException
- for the standard reasons that are documented in
DeviceException
.int getLogicalID() throws DeviceException
DeviceException
- for the standard reasons that are documented in
DeviceException
.void startBlink(long delayTurnOn, long delayTurnOff, int counts) throws DeviceException
cancelBlink()
and abort the operation.delayTurnOn
- The time in milliseconds that the LED must be ON.delayTurnOff
- The time in milliseconds that the LED must be OFF.counts
- The number of times the LED is required to blink.DeviceException
- for the standard reasons that are documented in
DeviceException
.void startBlink(byte color, long delayTurnOn, long delayTurnOff, int counts) throws DeviceException
cancelBlink()
and abort the operation.color
- The color of the LED.delayTurnOn
- The time in milliseconds that the LED must be ON.delayTurnOff
- The time in milliseconds that the LED must be OFF.counts
- The number of times the LED is required to blink.DeviceException
- for the standard reasons that are documented in
DeviceException
.void startBlink(long delayTurnOn, long delayTurnOff) throws DeviceException
cancelBlink()
and abort the operation.delayTurnOn
- The time in milliseconds that the LED must be ON.delayTurnOff
- The time in milliseconds that the LED must be OFF.DeviceException
- for the standard reasons that are documented in
DeviceException
.void cancelBlink() throws DeviceException
DeviceException
- for the standard reasons that are documented in
DeviceException
.void blink(long delayTurnOn, long delayTurnOff, int counts) throws DeviceException
delayTurnOn
- The time in milliseconds that the LED must be ON.delayTurnOff
- The time in milliseconds that the LED must be OFF.counts
- The number of times the LED is required to blink.DeviceException
- for the standard reasons that are documented in
DeviceException
.void blink(byte color, long delayTurnOn, long delayTurnOff, int counts) throws DeviceException
color
- the color of the LED.delayTurnOn
- the time in milliseconds that the LED must be ON.delayTurnOff
- the time in milliseconds that the LED must be OFF.counts
- the number of times the LED is required to blink.DeviceException
- for the standard reasons that are documented in
DeviceException
.int getStatus() throws DeviceException
STATUS_OFF
or STATUS_ON
DeviceException
- for the standard reasons that are documented in
DeviceException
.void turnOn() throws DeviceException
LED will continue to be bright, until call turnOff()
or Device.close()
DeviceException
- for the standard reasons that are documented in
DeviceException
.void turnOff() throws DeviceException
LED will off.
DeviceException
- for the standard reasons that are documented in
DeviceException
.