public class

SelfshoppingLedManager

extends Object
java.lang.Object
   ↳ com.datalogic.extension.selfshopping.led.SelfshoppingLedManager

Class Overview

The LED Manager used in the Selfshopping Extension SDK. It allows to command the different LEDs available on the device, using specific APIs dependent on the type of LED in use. The currently available types of LED are the standard Led, that can blink or be turned ON/OFF, and the DimmingLed, in which is also possible to set the brightness and start a dimming sequence. It is also possible to command the LEDs through specific LedAction objects.

Summary

Constants
int EVENT_ID_BATTERY_CHARGING ID for the battery charging event.
int EVENT_ID_BOOT_ANIMATION ID for the boot animation event.
int EVENT_ID_END_OF_CHARGE ID for the end of charge event.
int EVENT_ID_SHUTDOWN ID for the shutdown event.
int LED_ID_BOTTOM ID of the bottom LED.
int LED_ID_LEFT ID of the left LED.
int LED_ID_LEFT_AND_RIGHT ID of the left and right LEDs.
int LED_ID_LEFT_AND_RIGHT_ALTERNATE ID of the left and right alternative LEDs.
int LED_ID_RIGHT ID of the right LED.
Public Methods
Led acquireLed(int id, Context context)
Acquires a LED given its ID and the current application context.
boolean applyAction(LedAction action)
Applies a LedAction, corresponding to a method invocation on a specific LED.
List<LedEvent> getAvailableLedEvents()
Returns a list of all available LED events, being them predefined or created by applications.
List<Led> getAvailableLeds()
Returns a list of all available LEDs on this device.
static SelfshoppingLedManager getInstance()
Returns an instance of the SelfshoppingLedManager.
Led getLed(int id)
Retrieves a LED given its ID.
LedEvent getLedEvent(int id)
Retrieves a LED event given its ID.
void releaseLed(int id, Context context)
Releases a previously acquired LED by specifying its id and the current application context.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int EVENT_ID_BATTERY_CHARGING

Added in revision 2

ID for the battery charging event.

Constant Value: 2 (0x00000002)

public static final int EVENT_ID_BOOT_ANIMATION

Added in revision 2

ID for the boot animation event.

Constant Value: 1 (0x00000001)

public static final int EVENT_ID_END_OF_CHARGE

Added in revision 2

ID for the end of charge event.

Constant Value: 3 (0x00000003)

public static final int EVENT_ID_SHUTDOWN

Added in revision 2

ID for the shutdown event.

Constant Value: 0 (0x00000000)

public static final int LED_ID_BOTTOM

Added in revision 2

ID of the bottom LED.

Constant Value: 2 (0x00000002)

public static final int LED_ID_LEFT

Added in revision 2

ID of the left LED.

Constant Value: 0 (0x00000000)

public static final int LED_ID_LEFT_AND_RIGHT

Added in revision 3

ID of the left and right LEDs. In this configuration the two LEDs will be commanded simultaneously.

Constant Value: 3 (0x00000003)

public static final int LED_ID_LEFT_AND_RIGHT_ALTERNATE

Added in revision 3

ID of the left and right alternative LEDs. In this configuration only one of the two LEDs will be on while blinking and they will alternate.

Constant Value: 4 (0x00000004)

public static final int LED_ID_RIGHT

Added in revision 2

ID of the right LED.

Constant Value: 1 (0x00000001)

Public Methods

public Led acquireLed (int id, Context context)

Added in revision 2

Acquires a LED given its ID and the current application context. The LED acquired will be locked and cannot be controlled by other applications or by LED events. The method will return null in case the ID is not correct or the LED is already used by another application or a LED event.

Parameters
id The ID of the LED to retrieve.
context The application context.
Returns
  • The Led instance associated with this ID if it exists and is not in use, null otherwise.

public boolean applyAction (LedAction action)

Added in revision 2

Applies a LedAction, corresponding to a method invocation on a specific LED.

Parameters
action The LedAction to apply.

public List<LedEvent> getAvailableLedEvents ()

Added in revision 2

Returns a list of all available LED events, being them predefined or created by applications.

Returns
  • The list of available LED events.

public List<Led> getAvailableLeds ()

Added in revision 2

Returns a list of all available LEDs on this device.

Returns
  • The list of available LEDs.

public static SelfshoppingLedManager getInstance ()

Added in revision 2

Returns an instance of the SelfshoppingLedManager.

Returns
  • The Selfshopping LED Manager.

public Led getLed (int id)

Added in revision 2

Retrieves a LED given its ID. This method always returns the given LED if the ID is correct, however any control on the LED is not guaranteed to work if the LED is already used for other operations, such as running LED events.

Parameters
id The ID of the LED to retrieve.
Returns
  • The Led instance associated with this ID if it exists, null otherwise.

public LedEvent getLedEvent (int id)

Added in revision 2

Retrieves a LED event given its ID.

Parameters
id The ID of the LED event to retrieve.
Returns
  • The LedEvent instance associated with this ID if it exists, null otherwise.

public void releaseLed (int id, Context context)

Added in revision 2

Releases a previously acquired LED by specifying its id and the current application context.

Parameters
id The ID of the LED to retrieve.
context The application context.