|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.system.TINIOS
The TINIOS
class contains static methods to read
the state of the running tasks and set system configuration variables.
The default encoding String is also kept here.
Field Summary | |
static int |
BLAST_ALL
Flag used with blastHeapOnReboot() to reinitializes heap and stored system variables on next boot. |
static int |
BLAST_HEAP
Flag used with blastHeapOnReboot() to reinitializes heap on next boot. |
static int |
FS_MODIFICATION_OCCURRED
Filesystem modification occurred on last reboot. |
static int |
HEAP_CLEAR_OCCURRED
Heap clearing occurred on last reboot. |
static int |
MASTER_ERASE_OCCURRED
Master erase occurred on last reboot. |
static int |
NETWORK_CONFIGURATION_RESTORED
Network configuration was restored on last reboot. |
Method Summary | |
static void |
blastHeapOnReboot(int blastType)
Calling this function will cause the heap to be destroyed (reinitialized) on the next boot. |
static void |
disablePowerFailRecovery()
Disables the ability to recover after a power fail in a critical, atomic heap modification. |
static void |
enableSerialPort1()
Deprecated. |
static void |
enableSerialPort1(boolean enable)
Enables or disables serial port 1. |
static void |
execute(Object[] commandLine,
SystemInputStream in,
SystemPrintStream out,
SystemPrintStream err,
Hashtable env)
Executes a command in the shell. |
static void |
feedWatchdog()
Resets (feeds) the Watchdog timer. |
static int |
getBootState()
Returns the restore state from last reboot. |
static Hashtable |
getCurrentEnvironment()
Returns a copy of the current environment. |
static byte |
getCurrentUID()
Returns the user ID of the current user. |
static String |
getCurrentUserName()
Returns the name of the current user logged in. |
static int |
getExternalSerialPortAddress(int portNum)
Gets the address of the external serial port described by portNum. |
static boolean |
getExternalSerialPortEnable(int portNum)
Gets the state of the external serial port described by portNum. |
static boolean |
getExternalSerialPortSearchEnable()
Returns true if a search for serial ports 2 and 3 will be performed on boot. |
static int |
getFreeRAM()
Gets the free RAM. |
static String |
getFromCurrentEnvironment(String key)
Gets the value of the given key from the current environment. |
static int |
getLCDAddress()
Gets the address of the LCD port. |
static int |
getOwnerIDByTaskID(int taskid)
Gets the owner of specified task ID. |
static boolean |
getRecoveryHash(byte[] recoveryHash)
Returns the recovery hash. |
static boolean |
getRTSCTSFlowControlEnable(int portNumber)
Returns the state of the RTS/CTS flow control for the given port. |
static boolean |
getSerialBootMessagesState()
Deprecated. |
static com.dalsemi.shell.TINIShell |
getShell()
Returns the current shell. |
static String |
getShellName()
Returns the name of the shell. |
static String |
getShellVersion()
Returns the version of the shell. |
static Hashtable |
getSystemEnvironment()
Returns the system environment. |
static int |
getTaskID()
Gets this tasks ID |
static String[] |
getTaskTable()
Returns the task table. |
static int[] |
getTaskTableIDs()
Returns the task table ID list. |
static String |
getTimeZone()
Gets a string representing the current Timezone. |
static String |
getTINIHWVersion()
Gets a string representing the TINI HW Version. |
static String |
getTINIOSFirmwareVersion()
Gets a string representing the TINI OS Firmware Version. |
static String |
getTINISerialNumber()
Gets the hardware serial number. |
static int |
getUIDByUserName(String username)
Returns the ID of the user with the given user name. |
static String |
getUserNameByUID(byte uid)
Returns the user name that corresponds to the given user ID. |
static boolean |
isAdmin(byte uid)
Determines if the given user ID has administrative rights. |
static boolean |
isConsoleOutputEnabled()
Returns the state of bootup messages. |
static boolean |
isCurrentTaskInit()
Returns true if the current process is the init process (HEX file in bank 7). |
static boolean |
isCurrentUserAdmin()
Indicates whether or not the current user has admin privileges. |
static boolean |
isTaskRunning(int taskid)
Checks to see if task with specified ID is running |
static void |
killTask(int taskID)
Stops and removes task from system. |
static void |
lockInitProcesses()
Allows root to protect the 1st two processes from being killed by non admin users. |
static int |
login(String userName,
String password)
Logs a user into the system and sets his privilege level correctly. |
static void |
logout(Object info)
Logs the current user out of the system and returns the privilege level of the current process to the default state. |
static void |
reboot()
Performs an orderly system reboot. |
static void |
setConsoleOutputEnabled(boolean set)
Sets the state of the bootup messages. |
static void |
setDebugMessagesState(boolean on)
Sets the state of debug messages. |
static void |
setExternalSerialPortAddress(int portNum,
int address)
Sets the address of the external serial port described by portNum. |
static void |
setExternalSerialPortEnable(int portNum,
boolean enable)
Sets the state of the external serial port. |
static void |
setExternalSerialPortSearchEnable(boolean enable)
Searches for serial ports 2 and 3 on boot if enabled. |
static void |
setIrDAClockPinState(boolean on)
Turn on or off the IrDA clock pin (P3.5). |
static void |
setLCDAddress(int address)
Sets the address of the LCD Port |
static void |
setRecoveryHash(byte[] recoveryHash)
Sets the recovery hash. |
static boolean |
setRTSCTSFlowControlEnable(int portNumber,
boolean enable)
Enables RTS/CTS hardware flow control for the given serial port. |
static void |
setSerialBootMessagesState(boolean on)
Sets the state of serial boot up messages. |
static void |
setShell(com.dalsemi.shell.TINIShell newShell)
Sets the system shell. |
static void |
setTimeZone(String zone)
Sets the current timezone. |
static void |
setWatchdogTimeout(int mstimeout)
Sets the TINI Watchdog timeout. |
static void |
sleepProcess(int ms)
Delays a process for ms milliseconds. |
static long |
uptimeMillis()
Gets the approximate number of milliseconds the system has been running. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int NETWORK_CONFIGURATION_RESTORED
public static final int MASTER_ERASE_OCCURRED
public static final int HEAP_CLEAR_OCCURRED
public static final int FS_MODIFICATION_OCCURRED
public static final int BLAST_HEAP
public static final int BLAST_ALL
Method Detail |
public static boolean getRecoveryHash(byte[] recoveryHash)
byte
- array to be filled in with the recovery hash.public static void setRecoveryHash(byte[] recoveryHash)
recovery
- hash to be storedpublic static int getBootState()
public static void setShell(com.dalsemi.shell.TINIShell newShell) throws SecurityException
newShell
- new shell for the system to usepublic static int login(String userName, String password)
userName
- user name of the user logging inpassword
- password for this userpublic static void logout(Object info)
info
- any extra information needed in the logout processpublic static boolean isCurrentUserAdmin()
true
if the user has admin rights,
false
otherwisepublic static byte getCurrentUID()
public static boolean isAdmin(byte uid)
uid
- the user ID.true
if the user is an administrator,
false
otherwise.public static String getUserNameByUID(byte uid)
uid
- user id to checkpublic static int getUIDByUserName(String username)
username
- user username to check.public static String getCurrentUserName()
public static Hashtable getSystemEnvironment()
public static Hashtable getCurrentEnvironment()
public static String getFromCurrentEnvironment(String key)
key
- The key to lookup in the current environment.null
if the key
is not set in the current environment.public static void execute(Object[] commandLine, SystemInputStream in, SystemPrintStream out, SystemPrintStream err, Hashtable env) throws Exception
commandLine
- An Object array containing the command in the first element,
followed by any parameters need for that command in a String[] in the second element.in
- The stream the command will use to get input.out
- The stream used to report non-critical messages.err
- The stream used to report critical messages.env
- A table of environment variables.public static String getShellName()
public static String getShellVersion()
public static com.dalsemi.shell.TINIShell getShell()
public static boolean isConsoleOutputEnabled()
public static void setConsoleOutputEnabled(boolean set)
set
- true if output should be enabled, false if it should be disabledpublic static boolean getExternalSerialPortEnable(int portNum)
IllegalArgumentException
for all other
specified ports.portNum
- specifies number of external serial portpublic static void setExternalSerialPortEnable(int portNum, boolean enable)
IllegalArgumentException
for all other
specified ports.portNum
- specifies number of external serial portenable
- true to enable, false to disablepublic static boolean getExternalSerialPortSearchEnable()
public static void setExternalSerialPortSearchEnable(boolean enable)
enable
- true if enabled, false if disabledpublic static int getExternalSerialPortAddress(int portNum)
IllegalArgumentException
for all other
specified ports.portNum
- specifies number of external serial portpublic static void setExternalSerialPortAddress(int portNum, int address)
IllegalArgumentException
for all other
specified ports.portNum
- specifies number of external serial portaddress
- specifies address of external serial portpublic static void setIrDAClockPinState(boolean on)
on
- true to enable IrDA clock, false to disablepublic static void setWatchdogTimeout(int mstimeout)
mstimeout
- - timeout, in milliseconds. Don't set this too low,
because Java ain't that quick! Set to zero to turn off
the watchdog.public static void feedWatchdog()
public static String getTINIOSFirmwareVersion()
public static String getTINIHWVersion()
public static final String getTINISerialNumber()
public static void setTimeZone(String zone) throws IllegalArgumentException
zone
- timezone stringpublic static String getTimeZone()
public static boolean isCurrentTaskInit()
Thread.sleep()
public static final void sleepProcess(int ms)
ms
milliseconds.ms
- the amout of time to sleepThread.sleep()
public static int getTaskID()
public static void lockInitProcesses()
public static int getOwnerIDByTaskID(int taskid)
taskid
- public static boolean isTaskRunning(int taskid)
taskid
- ID of taskpublic static String[] getTaskTable()
public static int[] getTaskTableIDs()
public static void killTask(int taskID)
taskID
- Task ID of task to killpublic static final int getFreeRAM()
public static final void reboot()
public static final boolean getSerialBootMessagesState()
public static final void setSerialBootMessagesState(boolean on)
on
- sets to true to turn on boot messages, false to turn offpublic static final void setDebugMessagesState(boolean on)
on
- sets to true to turn on debug messages, false to turn offpublic static int getLCDAddress()
public static void setLCDAddress(int address)
-
- the address of the LCD portpublic static final long uptimeMillis()
public static final void blastHeapOnReboot(int blastType)
blastType
- - BLAST_HEAP for heap reinit only
BLAST_ALL for heap reinit and stored system variable initpublic static final void disablePowerFailRecovery()
public static final void enableSerialPort1()
public static final void enableSerialPort1(boolean enable)
true
- to enabled serial port 1, false will disable serial port 1public static boolean setRTSCTSFlowControlEnable(int portNumber, boolean enable) throws javax.comm.UnsupportedCommOperationException
portNumber
- - the number of the port number to enable RTS/CTS flow
controlenable
- - enables or disables the RTS/CTS hardware flow control for the given
portpublic static boolean getRTSCTSFlowControlEnable(int portNumber)
portNumber
- - the number of the port to get RTS/CTS flow control
information.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |