Interface cradle


public interface cradle

cradle.js contains the methods necessary to interact with the cradle. It also contains the event constants necessary to register for cradle events.


Field Summary
static java.lang.String EVENT_CRADLE_CHANGE
          The event constant used to register for the onCradleChange event
static int SLOT_REPAIR_CLEARED
          The primary and backup areas were corrupt.
static int SLOT_REPAIR_FAILED
          The repair operation failed.
static int SLOT_REPAIR_PRIMARY_RESTORED
          The slot information repair operation restored the primary area from the backup.
static int SLOT_REPAIR_PRIMARY_VALID
          The slot information repair operation was unnecessary.
 
Method Summary
 int getRackLocation()
          Obtains the current or last known rack location
 int getRackNumber()
          Obtains the current or last known rack number
 int getSlotNumber()
          Obtains the current or last known slot number
 int getStoreNumber()
          Obtains the current or last known store number
 boolean isCradled()
           
 void onCradleChange(java.lang.String slotNumber, java.lang.String rackNumber, java.lang.String rackLocation, java.lang.String storeNumber)
          This is the prototype for an event.
 boolean setRackLocation(int n)
          Sets the rack location value of the current cradle (valid values 1-0xfe).
 boolean setRackNumber(int n)
          Sets the rack number of the current cradle (valid values 1-0xfe).
 boolean setSlotNumber(int n)
          Sets the slot number of the current cradle (valid values 1-9).
 boolean setStoreNumber(int n)
          Sets the store number of the current cradle (valid values 1-0xfffe).
 int slotInformationRepair()
          If the slot information is in error, this method can be used to restore the slot information areas.
 

Field Detail

SLOT_REPAIR_PRIMARY_VALID

public static final int SLOT_REPAIR_PRIMARY_VALID
The slot information repair operation was unnecessary. The primary slot area information is valid.

See Also:
Constant Field Values

SLOT_REPAIR_PRIMARY_RESTORED

public static final int SLOT_REPAIR_PRIMARY_RESTORED
The slot information repair operation restored the primary area from the backup.

See Also:
Constant Field Values

SLOT_REPAIR_CLEARED

public static final int SLOT_REPAIR_CLEARED
The primary and backup areas were corrupt. To fix the problem, both areas were cleared to make the areas valid.

See Also:
Constant Field Values

SLOT_REPAIR_FAILED

public static final int SLOT_REPAIR_FAILED
The repair operation failed. For instance, if the tablet is not docked or a communication error was encountered.

See Also:
Constant Field Values

EVENT_CRADLE_CHANGE

public static final java.lang.String EVENT_CRADLE_CHANGE
The event constant used to register for the onCradleChange event

See Also:
basic.registerForEvent(String), Constant Field Values
Method Detail

slotInformationRepair

public int slotInformationRepair()
If the slot information is in error, this method can be used to restore the slot information areas.

Returns:
Returns a constant indicating the result of the operation
See Also:
SLOT_REPAIR_PRIMARY_VALID, SLOT_REPAIR_PRIMARY_RESTORED, SLOT_REPAIR_CLEARED, SLOT_REPAIR_FAILED

onCradleChange

public void onCradleChange(java.lang.String slotNumber,
                           java.lang.String rackNumber,
                           java.lang.String rackLocation,
                           java.lang.String storeNumber)
This is the prototype for an event. It is not actually implemented in this file. Triggered whenever the tablet goes into or out of a cradle slot

Parameters:
slotNumber - the slot number into which the tablet has been docked. Empty string when the tablet leaves the cradle/slot.
rackNumber - the rack number into which the tablet has been docked. Empty string when the tablet leaves the cradle/slot.
rackLocation - the location of the rack into which the tablet has been docked. Empty string when the tablet leaves the cradle/slot.
storeNumber - the store number of the rack into which the tablet has been docked. Empty string when the tablet leaves the cradle/slot.
See Also:
EVENT_CRADLE_CHANGE
WATA Integration
Host Application(TBD)
Host Applet(TBD)
Message Classes(TBD)

isCradled

public boolean isCradled()
Returns:
Returns true when the tablet is in a rack cradle

getSlotNumber

public int getSlotNumber()
Obtains the current or last known slot number

Returns:
Returns the slot number that the tablet was last or currently in. (1-9) are valid slot numbers. 0x0 is returned when the slot number is unassigned. 0xff is returned when the information cannot be provided.

getRackNumber

public int getRackNumber()
Obtains the current or last known rack number

Returns:
Returns the rack number that the tablet was last is currently in. (1-0xfe) are valid rack numbers. 0x0 is returned when the rack number is unassigned. 0xff is returned when the information cannot be provided.

getRackLocation

public int getRackLocation()
Obtains the current or last known rack location

Returns:
Returns the location of the rack that the tablet was last or currently cradled in. (1-0xfe) are valid locations. 0x0 is returned when the rack location is unassigned. 0xff is returned when the information cannot be provided.

getStoreNumber

public int getStoreNumber()
Obtains the current or last known store number

Returns:
Returns the store number of the rack that the tablet was last or currently in. (1-0xfffe) are valid store numbers. 0x0 is returned when the store number is unassigned. 0xffff is returned when the information cannot be provided.

setSlotNumber

public boolean setSlotNumber(int n)
Sets the slot number of the current cradle (valid values 1-9). The tablet must currently be cradled when called.

Parameters:
n - The slot number to program
Returns:
Returns true if the operation was successful
See Also:
isCradled()

setRackNumber

public boolean setRackNumber(int n)
Sets the rack number of the current cradle (valid values 1-0xfe). The tablet must currently be cradled when called.

Parameters:
n - The rack number to program
Returns:
Returns true if the operation was successful
See Also:
isCradled()

setRackLocation

public boolean setRackLocation(int n)
Sets the rack location value of the current cradle (valid values 1-0xfe). The tablet must currently be cradled when called.

Parameters:
n - The rack location to program
Returns:
Returns true if the operation was successful
See Also:
isCradled()

setStoreNumber

public boolean setStoreNumber(int n)
Sets the store number of the current cradle (valid values 1-0xfffe). The tablet must currently be cradled when called.

Parameters:
n - The store number to program
Returns:
Returns true if the operation was successful
See Also:
isCradled()