|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsnserver.RXTXComm
public class RXTXComm
It is used for the communication with the BTnode over the serial port.
Field Summary | |
---|---|
private int |
baudrate
|
protected static java.lang.String |
defaultLogFile
|
private java.io.InputStream |
is
|
private java.io.OutputStream |
os
|
java.io.PrintStream |
out
|
private gnu.io.SerialPort |
port
|
gnu.io.CommPortIdentifier |
portId
|
private java.lang.String |
portName
|
private java.util.concurrent.Semaphore |
sem
|
private static java.util.concurrent.Semaphore |
sem_file
|
Constructor Summary | |
---|---|
RXTXComm()
|
Method Summary | |
---|---|
void |
close()
To close a connection. |
void |
deleteLog()
|
protected void |
finalize()
|
void |
lock()
|
void |
open(java.lang.String Name)
To open a connection to a special Socket. |
java.lang.String |
readLine()
|
java.lang.String |
readLine(long timeout)
To read a line on the com-port The function is reading until a "\n" is identify a line end or the time timeout is over |
protected void |
showPorts()
to show Ports Ports found: - Name: COM1 - String: gnu.io.CommPortIdentifier@56a499 - PortType: 1 - Hash: 5678233 - owner: null - Name: COM2 - ... |
void |
unlock()
|
void |
writeLine(java.lang.String command)
To write a line on the com-port It has to be safed with a semaphre. |
static void |
writeLog(java.lang.String s)
|
static void |
writeLog(java.lang.String f,
java.lang.String s)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public gnu.io.CommPortIdentifier portId
private gnu.io.SerialPort port
private java.lang.String portName
private int baudrate
private java.io.InputStream is
private java.io.OutputStream os
public java.io.PrintStream out
protected static java.lang.String defaultLogFile
private java.util.concurrent.Semaphore sem
private static java.util.concurrent.Semaphore sem_file
Constructor Detail |
---|
public RXTXComm()
Method Detail |
---|
protected void finalize()
finalize
in class java.lang.Object
public void open(java.lang.String Name)
open
in interface Communication
String
- Namepublic void close()
close
in interface Communication
protected void showPorts()
public java.lang.String readLine(long timeout)
long
- timeout (in milliseconds) the function
is reading timeout milliseconds on the port
before it gives back the result excepting a
line was ending with a /n.
public java.lang.String readLine()
readLine
in interface Communication
public void writeLine(java.lang.String command)
writeLine
in interface Communication
String
- command the command wich is written
to the port to the BTnode.public static void writeLog(java.lang.String s) throws java.io.IOException
java.io.IOException
public static void writeLog(java.lang.String f, java.lang.String s) throws java.io.IOException
java.io.IOException
public void deleteLog()
deleteLog
in interface Communication
public void lock()
lock
in interface Communication
public void unlock()
unlock
in interface Communication
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |