module_standard.wSerial
Class Serial

Object
  extended by Thread
      extended by module_standard.wSerial.Serial
All Implemented Interfaces:
Runnable, java.util.EventListener, javax.comm.SerialPortEventListener

public class Serial
extends Thread
implements javax.comm.SerialPortEventListener


A_doc
Licence.


Nested Class Summary
 
Nested classes/interfaces inherited from class Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
(package private)  int ackControl
           
static int ACKCONTROL_ACKPF
           
static int ACKCONTROL_BYTE
           
static int ACKCONTROL_STRING
           
static int ACKCONTROL_STRINGCRLF
           
static int ACKCONTROL_STX_BYTES_ETX1_ETX2
           
(package private)  boolean ackPF
           
static String ACKPF
           
(package private)  byte[] buffRet
           
(package private)  boolean busy
           
(package private)  boolean debug
           
(package private)  Gp gpAbc
           
(package private)  InputStreamReader in
           
(package private)  boolean init
           
static int LENGTH_TRAME
           
(package private)  String name
           
(package private)  boolean open
           
(package private)  OutputStream out
           
(package private)  String portCom
           
(package private)  int prefix
           
(package private)  javax.comm.SerialPort serialPort
           
(package private)  int suffix1
           
(package private)  int suffix2
           
(package private)  boolean trace
           
(package private)  int trameLength
           
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Serial(Gp gpAbc, String portCom, int ackControl, String name)
           
 
Method Summary
 void close()
           
 int getAckControl()
           
 byte[] getBTrame()
           
 String getPortCom()
           
 long getSleep()
           
 String getSTrame()
           
 boolean isAckPF()
           
 boolean isBusy()
           
 boolean isCTS()
           
 boolean isOpen()
           
 boolean isOpenTimeOut()
           
 boolean isTrace()
           
 javax.comm.CommPortIdentifier listePortsDispo()
           
 boolean open()
           
 boolean open(int speed, String parity, int nbbit, int nbstop)
           
 void run()
           
 void serialEvent(javax.comm.SerialPortEvent ev)
           
 void setAckControl(int ackControl)
           
 void setAckPF(boolean ackPF)
           
 void setBusy(boolean busy)
           
 void setDebug(boolean enable)
           
 void setDTR(boolean enable)
           
 void setPortParams(int speed, String parity, int nbbit, int nbstop)
           
 void setRTS(boolean enable)
           
 void setSleep(long sleep)
           
 void setTrace(boolean trace)
           
 void setTrameParams(int prefix, int length, int suffix1, int suffix2)
           
 void write(int i)
           
 void write(String txt)
           
 
Methods inherited from class Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LENGTH_TRAME

public static int LENGTH_TRAME

ACKPF

public static String ACKPF

ACKCONTROL_STRING

public static final int ACKCONTROL_STRING
See Also:
Constant Field Values

ACKCONTROL_STRINGCRLF

public static final int ACKCONTROL_STRINGCRLF
See Also:
Constant Field Values

ACKCONTROL_BYTE

public static final int ACKCONTROL_BYTE
See Also:
Constant Field Values

ACKCONTROL_STX_BYTES_ETX1_ETX2

public static final int ACKCONTROL_STX_BYTES_ETX1_ETX2
See Also:
Constant Field Values

ACKCONTROL_ACKPF

public static final int ACKCONTROL_ACKPF
See Also:
Constant Field Values

out

OutputStream out

in

InputStreamReader in

serialPort

javax.comm.SerialPort serialPort

portCom

String portCom

debug

boolean debug

init

boolean init

open

boolean open

trace

boolean trace

ackControl

int ackControl

ackPF

boolean ackPF

buffRet

byte[] buffRet

prefix

int prefix

suffix1

int suffix1

suffix2

int suffix2

trameLength

int trameLength

busy

boolean busy

name

String name

gpAbc

Gp gpAbc
Constructor Detail

Serial

public Serial(Gp gpAbc,
              String portCom,
              int ackControl,
              String name)
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

open

public boolean open()

isOpenTimeOut

public boolean isOpenTimeOut()

isOpen

public boolean isOpen()

open

public boolean open(int speed,
                    String parity,
                    int nbbit,
                    int nbstop)

setPortParams

public void setPortParams(int speed,
                          String parity,
                          int nbbit,
                          int nbstop)

setTrameParams

public void setTrameParams(int prefix,
                           int length,
                           int suffix1,
                           int suffix2)

close

public void close()

listePortsDispo

public javax.comm.CommPortIdentifier listePortsDispo()

getAckControl

public int getAckControl()

setAckControl

public void setAckControl(int ackControl)

setDebug

public void setDebug(boolean enable)

write

public void write(String txt)

write

public void write(int i)

serialEvent

public void serialEvent(javax.comm.SerialPortEvent ev)
Specified by:
serialEvent in interface javax.comm.SerialPortEventListener

getSleep

public long getSleep()

isBusy

public boolean isBusy()

setBusy

public void setBusy(boolean busy)

setSleep

public void setSleep(long sleep)

setRTS

public void setRTS(boolean enable)

setDTR

public void setDTR(boolean enable)

isCTS

public boolean isCTS()

getBTrame

public byte[] getBTrame()

getSTrame

public String getSTrame()

setAckPF

public void setAckPF(boolean ackPF)

isAckPF

public boolean isAckPF()

isTrace

public boolean isTrace()

setTrace

public void setTrace(boolean trace)

getPortCom

public String getPortCom()