danger.system
Class Hardware

java.lang.Object
  |
  +--danger.system.Hardware

public class Hardware
extends java.lang.Object

Hardware is a class that represents system peripherals


Field Summary
static int AT_CHANNEL_COMMAND1
           
static int AT_CHANNEL_COMMAND2
           
static int AT_CHANNEL_COMMAND3
           
static int AT_CHANNEL_UNSOLICITED
           
static int kKeyRepeatDelayMax
           
static int kKeyRepeatDelayMin
           
static int kKeyRepeatRateMax
           
static int kKeyRepeatRateMin
           
static int MICJACK_CAMERA
           
static int MICJACK_HEADSET
           
static int MICJACK_NONE
           
 
Constructor Summary
Hardware()
           
 
Method Summary
static void beginVoiceActivity()
           
static void bootSuccess()
          Called when the system has gotten far enough to consider this boot a success.
static void cancelKeyboardActiveMeta()
           
static void debugEnableTracing(java.lang.String type, boolean on)
           
static void disconnectBattery()
           
static void dumpTCPStates()
           
static void enableGenieDebugging()
           
static void enableKansas(boolean inIsEnabled)
           
static void enableRadio(boolean inIsEnabled)
           
static void enableRadioData(boolean inIsEnabled)
           
static void enableRestartOnX(boolean inIsEnabled)
           
static void endVoiceActivity()
           
static void enterKeyGuardMode(boolean flag)
           
static boolean enterSleepMode()
          Put the hardware to sleep until some event happens or an alarm expires.
static int findFile(int id)
           
static int getAbsoluteTime()
          Return the number of seconds since boot.
static danger.io.ATInterface getATInterface(int channel)
          Obtain an instance of a GSM 07.10 AT command interpreter to talk to the radio.
static int getBatteryLevel()
          See how full the battery is.
static int getBatteryState()
          See what the battery charger is doing.
static int getBootCount()
           
static java.lang.String getBootMode()
           
static int getContrast()
           
static int getContrastMax()
           
static int getContrastMin()
           
static int getDate()
           
static java.lang.String getDeviceID()
           
static java.lang.String getDeviceIDType()
           
static int getFlashSize()
           
static int getKeyRepeatDelay()
           
static int getKeyRepeatRate()
           
static int getLightLevel()
           
static int getMicjackStatus()
           
static danger.system.Phone getPhoneInterface()
           
static java.lang.String getRadioResetReason()
           
static int getRAMSize()
           
static int getScreenColorSpace()
           
static int getSystemTime()
          return system time in milliseconds -- this may not be directly related to the Date maintained by the realtime clock.
static int getWheelAcceleration()
           
static void hackResetRadio()
           
static void installFont(java.lang.String name, byte[] data)
           
static void installImpl(danger.system.HardwareImpl inImpl)
           
static int installSquash(byte[][] data, Rect progress)
           
static int installSquash(byte[] data, Rect progress)
           
static boolean isBacklightOn()
           
static boolean isHingeOpen()
           
static boolean isRadioDataEnabled()
           
static boolean isRadioEnabled()
           
static boolean isSafeToUpgrade()
           
static boolean isSIMPresent()
           
static boolean isUSBOnline()
           
static int lastBootState()
           
static int loadFile(int id, byte[] buffer)
           
static int loadFile(int id, char[] buffer)
           
static int loadFile(int id, int[] buffer)
           
static void markEventLog(int data)
           
static void notifyCrossedLacBoundary()
           
static void notifyRadioAttach(boolean isAttached)
           
static int ping(java.lang.String name)
           
static void pollMicjack(boolean poll)
           
static void powerOff()
           
static void reboot()
           
static int removeBundleFromFlash(Bundle b)
          returns 0 on success
static void resetDeepSleepTimeout(int timeout)
           
static void resetSleepTimeout()
           
static void setBacklight(boolean on)
           
static void setContrast(int contrast)
           
static void setDate(int date)
           
static void setKeyRepeatDelay(int inDelay)
           
static void setKeyRepeatRate(int inRate)
           
static void setLEDHSV(int hue, int purity, int brightness)
           
static void setLEDRGB(int red, int green, int blue)
           
static void setTimeZoneOffset(int offset)
           
static void setWheelAcceleration(int inAcceleration)
           
static void startBusy()
           
static void stopBusy()
           
static void traceroute(java.lang.String name)
           
static void useLightMeter(boolean use)
           
static boolean useProxySockets()
           
static boolean useReducedScreenDepth(boolean r)
           
static void vibrate(int inDuration)
           
static void wakeupFromSleep()
           
static void writeNetLog(int priority, java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AT_CHANNEL_UNSOLICITED

public static final int AT_CHANNEL_UNSOLICITED

AT_CHANNEL_COMMAND1

public static final int AT_CHANNEL_COMMAND1

AT_CHANNEL_COMMAND2

public static final int AT_CHANNEL_COMMAND2

AT_CHANNEL_COMMAND3

public static final int AT_CHANNEL_COMMAND3

MICJACK_NONE

public static final int MICJACK_NONE

MICJACK_HEADSET

public static final int MICJACK_HEADSET

MICJACK_CAMERA

public static final int MICJACK_CAMERA

kKeyRepeatRateMin

public static final int kKeyRepeatRateMin

kKeyRepeatRateMax

public static final int kKeyRepeatRateMax

kKeyRepeatDelayMin

public static final int kKeyRepeatDelayMin

kKeyRepeatDelayMax

public static final int kKeyRepeatDelayMax
Constructor Detail

Hardware

public Hardware()
Method Detail

installImpl

public static void installImpl(danger.system.HardwareImpl inImpl)

vibrate

public static void vibrate(int inDuration)

setBacklight

public static void setBacklight(boolean on)

isBacklightOn

public static boolean isBacklightOn()

setLEDHSV

public static void setLEDHSV(int hue,
                             int purity,
                             int brightness)

setLEDRGB

public static void setLEDRGB(int red,
                             int green,
                             int blue)

getDate

public static int getDate()

setDate

public static void setDate(int date)

setTimeZoneOffset

public static void setTimeZoneOffset(int offset)

getSystemTime

public static int getSystemTime()
return system time in milliseconds -- this may not be directly related to the Date maintained by the realtime clock. It will wrap (flip from + to -) every 49.71 hours

getAbsoluteTime

public static int getAbsoluteTime()
Return the number of seconds since boot. Unlike GetSystemTime(), this will advance during sleep and power-off as well.

isHingeOpen

public static boolean isHingeOpen()

getBatteryLevel

public static int getBatteryLevel()
See how full the battery is.
Returns:
0..1000; 0 is empty, 1000 is full.

getBatteryState

public static int getBatteryState()
See what the battery charger is doing.
Returns:
EventType.BATTERY_* values.

getBootMode

public static java.lang.String getBootMode()
Returns:
"diags" or "normal"

getBootCount

public static int getBootCount()

reboot

public static void reboot()

resetSleepTimeout

public static void resetSleepTimeout()

resetDeepSleepTimeout

public static void resetDeepSleepTimeout(int timeout)

enterSleepMode

public static boolean enterSleepMode()
Put the hardware to sleep until some event happens or an alarm expires.
Returns:
true if we timed out or a software event happened, false if a hardware event happened.

enterKeyGuardMode

public static void enterKeyGuardMode(boolean flag)

wakeupFromSleep

public static void wakeupFromSleep()

powerOff

public static void powerOff()

disconnectBattery

public static void disconnectBattery()

getLightLevel

public static int getLightLevel()

getContrast

public static int getContrast()

useLightMeter

public static void useLightMeter(boolean use)

setContrast

public static void setContrast(int contrast)

getContrastMin

public static int getContrastMin()

getContrastMax

public static int getContrastMax()

getDeviceID

public static java.lang.String getDeviceID()

getDeviceIDType

public static java.lang.String getDeviceIDType()

bootSuccess

public static void bootSuccess()
Called when the system has gotten far enough to consider this boot a success.

lastBootState

public static int lastBootState()

useProxySockets

public static boolean useProxySockets()

getPhoneInterface

public static danger.system.Phone getPhoneInterface()

isSIMPresent

public static boolean isSIMPresent()

enableRadio

public static void enableRadio(boolean inIsEnabled)

isRadioEnabled

public static boolean isRadioEnabled()

enableRadioData

public static void enableRadioData(boolean inIsEnabled)

isRadioDataEnabled

public static boolean isRadioDataEnabled()

notifyRadioAttach

public static void notifyRadioAttach(boolean isAttached)

setKeyRepeatRate

public static void setKeyRepeatRate(int inRate)

getKeyRepeatRate

public static int getKeyRepeatRate()

setKeyRepeatDelay

public static void setKeyRepeatDelay(int inDelay)

getKeyRepeatDelay

public static int getKeyRepeatDelay()

cancelKeyboardActiveMeta

public static void cancelKeyboardActiveMeta()

setWheelAcceleration

public static void setWheelAcceleration(int inAcceleration)

getWheelAcceleration

public static int getWheelAcceleration()

writeNetLog

public static void writeNetLog(int priority,
                               java.lang.String s)

dumpTCPStates

public static void dumpTCPStates()

getATInterface

public static danger.io.ATInterface getATInterface(int channel)
                                            throws java.lang.Exception
Obtain an instance of a GSM 07.10 AT command interpreter to talk to the radio. Multiple interfaces are multiplexed on the radio.

beginVoiceActivity

public static void beginVoiceActivity()

endVoiceActivity

public static void endVoiceActivity()

getMicjackStatus

public static int getMicjackStatus()

pollMicjack

public static void pollMicjack(boolean poll)

isUSBOnline

public static boolean isUSBOnline()

isSafeToUpgrade

public static boolean isSafeToUpgrade()

enableRestartOnX

public static void enableRestartOnX(boolean inIsEnabled)

enableKansas

public static void enableKansas(boolean inIsEnabled)

enableGenieDebugging

public static void enableGenieDebugging()

getFlashSize

public static int getFlashSize()

getRAMSize

public static int getRAMSize()

getRadioResetReason

public static java.lang.String getRadioResetReason()

debugEnableTracing

public static void debugEnableTracing(java.lang.String type,
                                      boolean on)

loadFile

public static int loadFile(int id,
                           byte[] buffer)

loadFile

public static int loadFile(int id,
                           char[] buffer)

loadFile

public static int loadFile(int id,
                           int[] buffer)

findFile

public static int findFile(int id)

getScreenColorSpace

public static int getScreenColorSpace()

useReducedScreenDepth

public static boolean useReducedScreenDepth(boolean r)

ping

public static int ping(java.lang.String name)

traceroute

public static void traceroute(java.lang.String name)

hackResetRadio

public static void hackResetRadio()

notifyCrossedLacBoundary

public static void notifyCrossedLacBoundary()

startBusy

public static void startBusy()

stopBusy

public static void stopBusy()

installSquash

public static int installSquash(byte[] data,
                                Rect progress)

installSquash

public static int installSquash(byte[][] data,
                                Rect progress)

removeBundleFromFlash

public static int removeBundleFromFlash(Bundle b)
returns 0 on success

installFont

public static void installFont(java.lang.String name,
                               byte[] data)

markEventLog

public static void markEventLog(int data)


Danger Confidential. Copyright © 2000-2003, Danger Inc.