public class

DLCradleManager

extends Object
java.lang.Object
   ↳ com.datalogic.cradle.DLCradleManager

Class Overview

This class provides access to Cradle related methods of the device.

Summary

Nested Classes
class DLCradleManager.Properties This class contains all the cradle properties identifiers. 
Public Methods
boolean addFailureEventListener(CradleFailureEventListener listener)
Add a Failure listener used to be notify about failure events occurred on the Cradle.
boolean addInsertionEventListener(CradleInsertionEventListener listener)
Add an Insertion listener used to be notify about insertion and extraction events from the Cradle.
boolean addUnlockEventListener(CradleUnlockEventListener listener)
Add a Unlock listener used to be notify about Lever status changed events occurred on the Cradle.
boolean addUnlockKeyEventListener(CradleUnlockKeyEventListener listener)
Add an Unlock Key Event listener used to be notify about Unlock Key events occurred on the Cradle.
boolean blinkLed(CradleLed id, int colorArgb, int blinkCount, int onDurationMs, int offDurationMs)
Blinks a specific LED on the cradle.
int firmwareUpgrade(String binaryPath, long size)
Performs Cradle Firmware update procedure.
int firmwareUpgradeAbort()
Abort Cradle Firmware update procedure
AvailableSourcePower getAvailableSourcePowerLevel()
This method was deprecated in revision 46. use getProperty(int, T) and AVAILABLE_SOURCE_POWER_LEVEL.
int getInsertionCount()
This method was deprecated in revision 46. use getProperty(int, T) and INSERTIONS_COUNT.
InsertionState getInsertionState()
This method was deprecated in revision 46. use getProperty(int, T) and INSERTION_STATE.
static DLCradleManager getInstance()
This method was deprecated in revision 46. use the public constructor
LeverStatus getLeverStatus()
This method was deprecated in revision 46. use getProperty(int, T) and LEVER_STATUS.
<T> T getProperty(int propertyId, T defaultValue)
Retrieves the value of the specified property.
int getSlotIndex()
This method was deprecated in revision 46. use getProperty(int, T) and SLOT_INDEX.
Type getType()
This method was deprecated in revision 46. use getProperty(int, T) and CRADLE_TYPE.
UnlockKeyStatus getUnlockKeyStatus()
This method was deprecated in revision 46. use getProperty(int, T) and UNLOCK_KEY_STATUS.
boolean isFastChargeSupported()
This method was deprecated in revision 46. use getProperty(int, T) and FAST_CHARGE_STATUS.
boolean isLedSupported(CradleLed id)
Checks if a specific LED is supported by the cradle.
boolean isPropertyReadOnly(int propertyId)
Checks if the specified property is read-only.
boolean isPropertySupported(int propertyId)
Checks if the specified property is supported by the cradle.
void lockDevice(boolean lock)
Lock or unlock the device into the cradle
int rebootCradle()
Reboot the Cradle.
boolean removeFailureEventListener(CradleFailureEventListener listener)
Remove a Failure listener previously added with the addFailureEventListener(CradleFailureEventListener) method.
boolean removeInsertionEventListener(CradleInsertionEventListener listener)
Remove an Insertion listener previously added with the addInsertionEventListener(CradleInsertionEventListener) method.
boolean removeUnlockEventListener(CradleUnlockEventListener listener)
Remove an Unlock listener previously added with the addUnlockEventListener(CradleUnlockEventListener) method.
boolean removeUnlockKeyEventListener(CradleUnlockKeyEventListener listener)
Remove an Unlock Key Event listener previously added with the addUnlockKeyEventListener(CradleUnlockKeyEventListener) method.
boolean setLed(CradleLed ledId, int colorARGB, boolean enable)
Sets the state of a specific LED on the cradle.
boolean setLeverStatus(LeverStatus levelStatus)
This method was deprecated in revision 46. use lockDevice(boolean)
<T> void setProperty(int propertyId, T value)
Sets the value of the specified property.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean addFailureEventListener (CradleFailureEventListener listener)

Added in revision 24

Add a Failure listener used to be notify about failure events occurred on the Cradle. If property ACTIVE_FAILURES is not supported, this listener cannot be added.

Parameters
listener The CradleFailureEventListener to be added.
Returns
  • boolean true in case of success, false otherwise.

public boolean addInsertionEventListener (CradleInsertionEventListener listener)

Added in revision 23

Add an Insertion listener used to be notify about insertion and extraction events from the Cradle. If property INSERTION_STATE is not supported, this listener cannot be added.

Parameters
listener The CradleInsertionEventListener to be added.
Returns
  • boolean true in case of success, false otherwise.

public boolean addUnlockEventListener (CradleUnlockEventListener listener)

Added in revision 24

Add a Unlock listener used to be notify about Lever status changed events occurred on the Cradle. If property LEVER_STATUS is not supported, this listener cannot be added.

Parameters
listener The CradleUnlockEventListener to be added.
Returns
  • boolean true in case of success, false otherwise.

public boolean addUnlockKeyEventListener (CradleUnlockKeyEventListener listener)

Added in revision 23

Add an Unlock Key Event listener used to be notify about Unlock Key events occurred on the Cradle. If property UNLOCK_KEY_STATUS is not supported, this listener cannot be added.

Parameters
listener The CradleUnlockKeyEventListener to be added.
Returns
  • boolean true in case of success, false otherwise.

public boolean blinkLed (CradleLed id, int colorArgb, int blinkCount, int onDurationMs, int offDurationMs)

Added in revision 46

Blinks a specific LED on the cradle. This method allows blinking a specific LED identified by its ID. The blink count, duration of the ON state, and duration of the OFF state can be configured.

Parameters
id The CradleLed representing the LED to be blinked.
colorArgb The ARGB color value to set for the LED during blinking.
blinkCount The number of times the LED should blink. Range: [0 : 65535]. If set to 0, the LED will blink indefinitely.
onDurationMs The duration (in milliseconds) the LED stays ON during each blink. Range: [0 : 65535].
offDurationMs The duration (in milliseconds) the LED stays OFF during each blink. Range: [0 : 65535].
Returns
  • true if the operation was successful, false otherwise.

public int firmwareUpgrade (String binaryPath, long size)

Added in revision 23

Performs Cradle Firmware update procedure.

Parameters
binaryPath the String path where the binary file is stored.
size the String dimension of the binary file.
Returns
  • boolean true in case of success, false otherwise.
Throws
in case of error.

public int firmwareUpgradeAbort ()

Added in revision 34

Abort Cradle Firmware update procedure

Returns
  • Integer true in case of success, false otherwise.

public AvailableSourcePower getAvailableSourcePowerLevel ()

Added in revision 16

This method was deprecated in revision 46.
use getProperty(int, T) and AVAILABLE_SOURCE_POWER_LEVEL.

Returns the available source power to charge the Device into the Cradle as instance of AvailableSourcePower.

Returns

public int getInsertionCount ()

Added in revision 33

This method was deprecated in revision 46.
use getProperty(int, T) and INSERTIONS_COUNT.

Returns the current insertion count for this Cradle slot

Returns
  • Integer of the current insertion count for this Cradle slot.

public InsertionState getInsertionState ()

Added in revision 16

This method was deprecated in revision 46.
use getProperty(int, T) and INSERTION_STATE.

Returns the position of the Device related to the Cradle as instance of InsertionState.

Returns

public static DLCradleManager getInstance ()

Added in revision 16

This method was deprecated in revision 46.
use the public constructor

Returns an instance of the DLCradleManager.

Returns
  • The Cradle Manager.

public LeverStatus getLeverStatus ()

Added in revision 24

This method was deprecated in revision 46.
use getProperty(int, T) and LEVER_STATUS.

Returns the current position related to the Cradle lever.

Returns

public T getProperty (int propertyId, T defaultValue)

Added in revision 46

Retrieves the value of the specified property. This method fetches the value of the property identified by the given property ID, as defined in the DLCradleManager.Properties class. If the property is not found or an error occurs, the default value provided is returned.

Parameters
propertyId The identifier of the property to retrieve, as defined in DLCradleManager.Properties.
defaultValue The default value to return if the property is not found.
Returns
  • The value of the property, or the default value if the property is not found.

public int getSlotIndex ()

Added in revision 33

This method was deprecated in revision 46.
use getProperty(int, T) and SLOT_INDEX.

Returns the Cradle slot index where the device is inserted in. This value is persistent in the cradle memory and it couldn't be changed.

Returns
  • Integer of the Cradle slot index where the device is inserted in.

public Type getType ()

Added in revision 27

This method was deprecated in revision 46.
use getProperty(int, T) and CRADLE_TYPE.

Returns the Cradle type.

Returns
  • Type of the Cradle where the device is inserted in.

public UnlockKeyStatus getUnlockKeyStatus ()

Added in revision 23

This method was deprecated in revision 46.
use getProperty(int, T) and UNLOCK_KEY_STATUS.

Returns the current position related to the unlock key.

Returns

public boolean isFastChargeSupported ()

Added in revision 46

This method was deprecated in revision 46.
use getProperty(int, T) and FAST_CHARGE_STATUS.

return if fast charge is supported by the Cradle.

public boolean isLedSupported (CradleLed id)

Added in revision 46

Checks if a specific LED is supported by the cradle. This method verifies whether the cradle supports a specific LED identified by its ID.

Parameters
id The CradleLed representing the LED to be checked.
Returns
  • true if the LED is supported, false otherwise.

public boolean isPropertyReadOnly (int propertyId)

Added in revision 46

Checks if the specified property is read-only. This method determines whether the given property identifier, defined in the DLCradleManager.Properties class, is read-only. Read-only properties can only be accessed but not modified.

Parameters
propertyId The identifier of the property to check, as defined in DLCradleManager.Properties.
Returns
  • true if the property is read-only, false otherwise.

public boolean isPropertySupported (int propertyId)

Added in revision 46

Checks if the specified property is supported by the cradle. This method verifies whether the given property identifier, defined in the DLCradleManager.Properties class, is supported by the cradle. If the property is supported, it can be accessed or modified depending on its read-only status.

Parameters
propertyId The identifier of the property to check, as defined in DLCradleManager.Properties.
Returns
  • true if the property is supported, false otherwise.

public void lockDevice (boolean lock)

Added in revision 46

Lock or unlock the device into the cradle

Parameters
lock true to lock the device, false to unlock the device.

public int rebootCradle ()

Added in revision 27

Reboot the Cradle.

Returns
  • int Returns 1 if the cradle has been rebooted sucessfully, error otherwise.
Throws
in case of error.

public boolean removeFailureEventListener (CradleFailureEventListener listener)

Added in revision 24

Remove a Failure listener previously added with the addFailureEventListener(CradleFailureEventListener) method. If property ACTIVE_FAILURES is not supported, this listener cannot be removed.

Parameters
listener The CradleFailureEventListener to be removed.
Returns
  • boolean true in case of success, false otherwise.

public boolean removeInsertionEventListener (CradleInsertionEventListener listener)

Added in revision 23

Remove an Insertion listener previously added with the addInsertionEventListener(CradleInsertionEventListener) method. If property INSERTION_STATE is not supported, this listener cannot be removed.

Parameters
listener The CradleInsertionEventListener to be removed.
Returns
  • boolean true in case of success, false otherwise.

public boolean removeUnlockEventListener (CradleUnlockEventListener listener)

Added in revision 24

Remove an Unlock listener previously added with the addUnlockEventListener(CradleUnlockEventListener) method. If property LEVER_STATUS is not supported, this listener cannot be removed.

Parameters
listener The CradleUnlockEventListener to be removed.
Returns
  • boolean true in case of success, false otherwise.

public boolean removeUnlockKeyEventListener (CradleUnlockKeyEventListener listener)

Added in revision 23

Remove an Unlock Key Event listener previously added with the addUnlockKeyEventListener(CradleUnlockKeyEventListener) method. If property UNLOCK_KEY_STATUS is not supported, this listener cannot be removed.

Parameters
listener The CradleUnlockKeyEventListener to be removed.
Returns
  • boolean true in case of success, false otherwise.

public boolean setLed (CradleLed ledId, int colorARGB, boolean enable)

Added in revision 46

Sets the state of a specific LED on the cradle. This method allows enabling or disabling a specific LED identified by its ID. The LED color can also be set using an ARGB value.

Parameters
ledId The CradleLed representing the LED to be controlled.
colorARGB The ARGB color value to set for the LED.
enable true to enable the LED, false to disable it.
Returns
  • true if the operation was successful, false otherwise.

public boolean setLeverStatus (LeverStatus levelStatus)

Added in revision 24

This method was deprecated in revision 46.
use lockDevice(boolean)

Sets the new position related to the Cradle lever.

Parameters
levelStatus The required LeverStatus of the Cradle lever.
Returns
  • boolean true in case of success, false otherwise.

public void setProperty (int propertyId, T value)

Added in revision 46

Sets the value of the specified property. This method updates the value of the property identified by the given property ID, as defined in the DLCradleManager.Properties class. If the property is read-only or unsupported, the operation will fail.

Parameters
propertyId The identifier of the property to set, as defined in DLCradleManager.Properties.
value The new value to assign to the property.