|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
JTModel
JTModel - holds the JTerm connection details and response.
SerialPort - serial connections for Java Copyright (C) 2005 Martin C Gregorie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Contact Martin Gregorie at
martin@gregorie.org.
Read the GNU General Public License.
| Field Summary | |
java.lang.String |
MSDOS
|
java.lang.String |
OS9
|
java.lang.String |
UNIX
|
| Constructor Summary | |
JTModel(JTerm theApp,
java.lang.String progName,
int debug)
The only constructor. |
|
| Method Summary | |
void |
closePort()
Stop polling the server. |
int |
connectServer(java.lang.String host,
int port)
Open a connection to spd, the SerialPort server. |
void |
disconnectServer()
Close the server connection and mark as inactive. |
java.lang.String |
getError()
Return the error description. |
java.lang.String |
getHostname()
Return the TCP/IP hostname of the server. |
java.lang.String |
getOSList()
Return the operating system list, used to identify the target operating system. |
java.lang.String |
getPortList()
Return the serial port list. |
java.lang.String |
getPortName()
Return the serial port name. |
int |
getPortNumber()
Return the server's TCP/IP port number. |
java.lang.String |
getPortParameters()
Return the serial port parameters. |
java.lang.String |
getResponse()
Retrieve any data received from the serial connection. |
int |
getTabSpace()
Return the (target operating system dependent) tab spacing. |
java.lang.String |
getTitle()
Return the frame title. |
boolean |
isConnectedToPort()
Returns true if a serial connection is open. |
boolean |
isConnectedToServer()
Returns true if the server connection is open. |
boolean |
isErrorCondition()
Check whether an error has ocurred. |
boolean |
isOSSelected()
Check whether an operating system has been selected. |
boolean |
isResponse()
Check whether new data has been received from the serial port. |
void |
keyTyped(char c)
Accept a single character input by the keyboard. |
int |
openPort(java.lang.String port)
Cause spd to open the specified serial port. |
void |
scanForData()
Poll the server for data. |
void |
serialError()
Trap and report SerialPort errors. |
void |
setOSName(java.lang.String name)
Store the OS name. |
int |
setPortParameters(java.lang.String params)
Store the serial port parameters. |
void |
startReader()
Create and start a thread to poll the server for input. |
void |
updateCompleted()
Clear the changed flag. |
| Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final java.lang.String UNIX
public final java.lang.String OS9
public final java.lang.String MSDOS
| Constructor Detail |
public JTModel(JTerm theApp,
java.lang.String progName,
int debug)
| Method Detail |
public int connectServer(java.lang.String host,
int port)
public void disconnectServer()
public int openPort(java.lang.String port)
public void closePort()
public java.lang.String getError()
public java.lang.String getHostname()
public java.lang.String getOSList()
public java.lang.String getPortList()
public java.lang.String getPortName()
public int getPortNumber()
public java.lang.String getPortParameters()
public java.lang.String getResponse()
public int getTabSpace()
public java.lang.String getTitle()
public boolean isConnectedToServer()
public boolean isConnectedToPort()
public boolean isErrorCondition()
public boolean isResponse()
public boolean isOSSelected()
public void keyTyped(char c)
Accept a single character input by the keyboard. Pass it to the server and restart the timer so that the next scan interval is short because input is expected.
NOTE: This function puts an error message on the screen if there is no serial connection open.
public void scanForData()
Poll the server for data. If any is available it is appended to the receive buffer, the reader thread is prepared to accept more data and screen updating is triggered.
Returns true if and data was received.
public void serialError()
public void setOSName(java.lang.String name)
public int setPortParameters(java.lang.String params)
public void startReader()
Create and start a thread to poll the server for input.
The Timer is initially set to its minimum interval so that restarting it when a key has been typed will get a fast response. Its delay time is immediately reset to the maximum interval so the server will be polled slowly until data is transferred.
public void updateCompleted()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||