Interface tablet


public interface tablet

tablet.js contains various methods for interacting with the tablet hardware. It also contains the event contains necessary for registering for tablet hardware events.


Field Summary
static java.lang.String EVENT_TABLET_CHARGE_CHANGE
          The event constant used to register for the onTabletChargeChange event
static int REXEC_SCRIPTING_FAILURE
          If a script could not be generated with the requested command line
static int SHUTDOWN_FORCE
          Request that the system shutdown the OS and poweroff the hardware.
static int SHUTDOWN_POWEROFF
          Request that the system shutdown the OS and poweroff the hardware
static int SHUTDOWN_REBOOT
          Request that the system shutdown the OS and reboot the hardware
static int TABLET_LED_COLOR_GREEN
          Specifies the tablet's green LED
static int TABLET_LED_COLOR_ORANGE
          Specifies the tablet's orange LED
static int TABLET_LED_STATE_BLINK
          LED is or should be blinking
static int TABLET_LED_STATE_OFF
          LED is or should be off
static int TABLET_LED_STATE_ON
          LED is or should be on
static int TABLET_LED_STATE_UNKNOWN
          The state of the specified LED is unknown
 
Method Summary
 int getClientStackVersion()
          Obtains the client stack build number
 int getTabletCharge()
          Obtains the current tablet charge
 int getTabletChargeChangeThreshold()
          Obtains the tablet's charge change threshold
 java.lang.String getTabletID()
          Gets the tablet's unique identifier (Wireless card MAC address, colon delimited)
 int getTabletLED(byte color)
          Obtain the state of a LED on the tablet
 void onTabletChargeChange(int percent)
          This is the prototype for an event.
 int rexec(java.lang.String command)
          The ability to provide this function is currently under scrutiny Attempts to remotely invoke a command line operation.
 boolean setClockDay(java.lang.String day)
          Sets the day element of the OS clock
 boolean setClockHour(java.lang.String hour)
          Sets the hour element of the OS clock
 boolean setClockMinute(java.lang.String minute)
          Sets the minute element of the OS clock
 boolean setClockMonth(java.lang.String month)
          Sets the month element of the OS clock
 boolean setClockYear(java.lang.String year)
          Sets the year element of the OS clock
 boolean setTabletChargeChangeThreshold(int threshold)
          Sets the tablet's charge change threshold
 boolean setTabletLED(byte color, int state)
          Set the state of a LED on the tablet
 void shutdown(int request)
          Requests that the tablet shutdown
 

Field Detail

EVENT_TABLET_CHARGE_CHANGE

public static final java.lang.String EVENT_TABLET_CHARGE_CHANGE
The event constant used to register for the onTabletChargeChange event

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

SHUTDOWN_REBOOT

public static final int SHUTDOWN_REBOOT
Request that the system shutdown the OS and reboot the hardware

See Also:
shutdown(int), Constant Field Values

SHUTDOWN_POWEROFF

public static final int SHUTDOWN_POWEROFF
Request that the system shutdown the OS and poweroff the hardware

See Also:
shutdown(int), Constant Field Values

SHUTDOWN_FORCE

public static final int SHUTDOWN_FORCE
Request that the system shutdown the OS and poweroff the hardware. This option requests that some safety mechanisms can be ignored.

See Also:
shutdown(int), Constant Field Values

REXEC_SCRIPTING_FAILURE

public static final int REXEC_SCRIPTING_FAILURE
If a script could not be generated with the requested command line

See Also:
rexec(java.lang.String), Constant Field Values

TABLET_LED_STATE_UNKNOWN

public static final int TABLET_LED_STATE_UNKNOWN
The state of the specified LED is unknown

See Also:
setTabletLED(byte, int), getTabletLED(byte), Constant Field Values

TABLET_LED_STATE_ON

public static final int TABLET_LED_STATE_ON
LED is or should be on

See Also:
setTabletLED(byte, int), getTabletLED(byte), Constant Field Values

TABLET_LED_STATE_OFF

public static final int TABLET_LED_STATE_OFF
LED is or should be off

See Also:
setTabletLED(byte, int), getTabletLED(byte), Constant Field Values

TABLET_LED_STATE_BLINK

public static final int TABLET_LED_STATE_BLINK
LED is or should be blinking

See Also:
setTabletLED(byte, int), getTabletLED(byte), Constant Field Values

TABLET_LED_COLOR_GREEN

public static final int TABLET_LED_COLOR_GREEN
Specifies the tablet's green LED

See Also:
Constant Field Values

TABLET_LED_COLOR_ORANGE

public static final int TABLET_LED_COLOR_ORANGE
Specifies the tablet's orange LED

See Also:
Constant Field Values
Method Detail

onTabletChargeChange

public void onTabletChargeChange(int percent)
This is the prototype for an event. It is not actually implemented in this file. Reports a battery level change greater than the threshold

Parameters:
percent - The current battery charge percentage
See Also:
EVENT_TABLET_CHARGE_CHANGE
WATA Integration
Host Applicationcom.ibm.retail.saf.wata.host.settings.SettingsAgentManager
Host AppletPowerManagementHostApplet (TBD)
FlowThe host applet will query a setting handler that reads the current battery level from /proc/apm at regular intervals (e.g. 1 minute) to monitor change in the battery level. When the threshold is crossed, this event will be fired.
Uses: get hardware/power/battery.percentage

getTabletCharge

public int getTabletCharge()
Obtains the current tablet charge

Returns:
Returns the current charge on the tablet battery. Returns -1 if the percent cannot be determined.
WATA Integration
Host Applicationcom.ibm.retail.saf.wata.host.settings.SettingsAgentManager
Host AppletPowerManagementHostApplet (TBD)
FlowUses: get hardware/power/battery.percentage

setTabletChargeChangeThreshold

public boolean setTabletChargeChangeThreshold(int threshold)
Sets the tablet's charge change threshold

Parameters:
threshold - The delta threshold at which to deliver an "onChargeChange" event
Returns:
Returns whether the operation was successful
See Also:
onTabletChargeChange( int )
WATA Integration
Host ApplicationN/A
Host AppletPowerManagementHostApplet (TBD)
FlowThis setting will be maintined by the host applet. The setting is not persistent between power cycles.

getTabletChargeChangeThreshold

public int getTabletChargeChangeThreshold()
Obtains the tablet's charge change threshold

Returns:
Returns the charge delta threshold. Returns -1 if the operation fails.
WATA Integration
Host ApplicationN/A
Host AppletPowerManagementHostApplet (TBD)
FlowThis setting will be maintined by the host applet. The setting is not persistent between power cycles.

getTabletID

public java.lang.String getTabletID()
Gets the tablet's unique identifier (Wireless card MAC address, colon delimited)

Returns:
Returns the tablet's unique ID
WATA Integration
Host Applicationcom.ibm.retail.saf.wata.host.settings.SettingsAgentManager
Host AppletSettingsApplet
FlowUses: get hardware/tablet.id

setClockYear

public boolean setClockYear(java.lang.String year)
Sets the year element of the OS clock

Parameters:
year - Year representation (e.g. 2005)
Returns:
Returns whether the operation was successful

setClockMonth

public boolean setClockMonth(java.lang.String month)
Sets the month element of the OS clock

Parameters:
month - Month representation (e.g. 04)
Returns:
Returns whether the operation was successful

setClockDay

public boolean setClockDay(java.lang.String day)
Sets the day element of the OS clock

Parameters:
day - Day representation (e.g. 04)
Returns:
Returns whether the operation was successful

setClockHour

public boolean setClockHour(java.lang.String hour)
Sets the hour element of the OS clock

Parameters:
hour - Hour representation (e.g. 04)
Returns:
Returns whether the operation was successful

setClockMinute

public boolean setClockMinute(java.lang.String minute)
Sets the minute element of the OS clock

Parameters:
minute - Minute representation (e.g. 04)
Returns:
Returns whether the operation was successful

shutdown

public void shutdown(int request)
Requests that the tablet shutdown

Parameters:
request - The type of shutdown to perform
See Also:
SHUTDOWN_POWEROFF, SHUTDOWN_REBOOT, SHUTDOWN_FORCE
WATA Integration
Host Applicationcom.ibm.retail.saf.wata.host.settings.SettingsAgentManagerr
Host AppletSettingsApplet
FlowUses: set (state) hardware/power/system.state

rexec

public int rexec(java.lang.String command)
The ability to provide this function is currently under scrutiny Attempts to remotely invoke a command line operation.

Parameters:
command - A string representing a command as entered on a command line
Returns:
Returns the exit code of the command executed. May also be a constant indicating failure.
See Also:
REXEC_SCRIPTING_FAILURE
WATA Integration
Host Applicationcom.ibm.retail.saf.wata.host.settings.SettingsAgentManager
Host AppletSettingsApplet
FlowUses: set (command name) os/remote.execute (arguments..)

getClientStackVersion

public int getClientStackVersion()
Obtains the client stack build number

Returns:
Returns the build number of the software stack
WATA Integration
Host Applicationcom.ibm.retail.saf.wata.host.settings.SettingsAgentManager
Host AppletSettingsApplet
FlowUses: get software/stack/stack.version

setTabletLED

public boolean setTabletLED(byte color,
                            int state)
Set the state of a LED on the tablet

Parameters:
color - The color of the LED to change states
state - The new state of the LED
Returns:
Returns whether the change was successful
See Also:
TABLET_LED_COLOR_GREEN, TABLET_LED_COLOR_ORANGE, TABLET_LED_STATE_OFF, TABLET_LED_STATE_ON, TABLET_LED_STATE_BLINK
WATA Integration
Host Applicationcom.ibm.retail.saf.wata.host.settings.SettingsAgentManager
Host AppletSettingsApplet
FlowUses: set (state) hardware/led/(color)

getTabletLED

public int getTabletLED(byte color)
Obtain the state of a LED on the tablet

Parameters:
color - The color of the LED to query
Returns:
Returns the current state of an LED on the tablet
See Also:
TABLET_LED_COLOR_GREEN, TABLET_LED_COLOR_ORANGE, TABLET_LED_STATE_OFF, TABLET_LED_STATE_ON, TABLET_LED_STATE_BLINK, TABLET_LED_STATE_UNKNOWN
WATA Integration
Host Applicationcom.ibm.retail.saf.wata.host.settings.SettingsAgentManager
Host AppletSettingsApplet
FlowUses: get hardware/led/(color)