Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.SerialHandler
Source: src/com/multiversesocial/hyperview/SerialHandler.java

SerialHandler

HyperView V3.2 — class
version V3.2 class

Summary

System.out.println("Write: "+str); System.out.println("SerialHandler(Object tNotifier,String tPort,int tBPSRate)");

Source file: SerialHandler.java

Hierarchy

Extends: none

Implements: Runnable, SerialPortEventListener, SerialHandlerConstants

Referenced HyperView classes

Media files used

Declaration & members

public class SerialHandler implements Runnable, SerialPortEventListener, SerialHandlerConstants

Declared in src/com/multiversesocial/hyperview/SerialHandler.java, lines 13–589. 32 field(s), 2 constructor(s), 19 method(s). Every member has an anchor you can link to (e.g. SerialHandler.html#<id>).

Fields (32)

DeclarationValue / initializerDescriptionSource
Color bottomColorNo comment in source; assigned in SerialHandler(); used in showBuffer().line 27
int BPSRate= 19200No comment in source; assigned in SerialHandler().line 36
static final int[] bpsRates= {115200, 57600, 38400, 19200, 14400, 9600, 4800, 2400, 1200, 300}No comment in source; used in getBPSRate1().line 16
public static int bufferSize= 1024No comment in source; used in SerialHandler(), run(), showBuffer(); name appears in 3 other source file(s): Externalizer, StateMachine, TextPane.line 31
String errorString= version + " - no errors"No comment in source; assigned in getChar().line 35
Color faceColorNo comment in source; assigned in SerialHandler(); used in showBuffer().line 25
int flags= 0No comment in source; assigned in SerialHandler().line 33
Gob gobNotifierNo comment in source; assigned in SerialHandler(), setGobNotifier(); used in run(), getBPSRate1(), showBuffer().line 43
InputStream inputStream1= nullNo comment in source; assigned in SerialHandler(); used in run().line 48
Font itemFontNo comment in source; assigned in showBuffer().line 29
int iterationNo comment in source; assigned in SerialHandler().line 50
Object objectNotifierNo comment in source; assigned in SerialHandler(), setObjectNotifier(); used in run().line 44
static OutputStream outputStream1No comment in source; assigned in SerialHandler(); used in out(), ser1Out().line 39
static CommPortIdentifier portIDNo comment in source; assigned in SerialHandler().line 41
static Enumeration portListNo comment in source; assigned in SerialHandler(); name appears in 3 other source file(s): HyperConnectionHandler, PortControlPane, PortInfo.line 42
static String portNameNo comment in source; assigned in SerialHandler().line 40
int recvCount= 0No comment in source; assigned in run().line 45
volatile int ser1IntPtrNo comment in source; assigned in SerialHandler(), run(); used in getString(), ser1Flush().line 47
volatile int ser1MainPtrNo comment in source; assigned in SerialHandler(), getString(), ser1Flush().line 47
volatile byte[] serial1Buffer= new byte[bufferSize]No comment in source; assigned in run(); used in getString(), showBuffer().line 46
static SerialPort serialPort1Todo duplicate to handle 2 or more portsline 38
StringBuilder stringBuilderNo comment in source; assigned in SerialHandler(); used in getString().line 15
Thread task= nullNo comment in source; assigned in start(), stop(); used in run().line 49
Color textColorNo comment in source; assigned in SerialHandler().line 24
volatile long timeoutNo comment in source; assigned in SerialHandler(), setTimeout(); used in getString().line 51
int tint= 0temporary intline 34
Font titleFontNo comment in source; assigned in showBuffer().line 28
Color topColorNo comment in source; assigned in SerialHandler(); used in showBuffer().line 26
final int TOTAL_BPS_RATES= bpsRates.lengthNo comment in source; used in getBPSRate1().line 20
static final String version= "SerialHandler V1.1" (constant)No comment in source; not referenced by name in this type’s methods.line 32
int viewHeightNo comment in source; assigned in SerialHandler(), showBuffer().line 23
int viewWidthNo comment in source; assigned in SerialHandler(), showBuffer().line 22

Constructors (2)

SignatureDescriptionSource
SerialHandler()1 statement(s); calls this().line 66
SerialHandler(Object tNotifier, String tPort, int tBPSRate)26 statement(s); calls super(), faceColor.brighter(), faceColor.darker(), Class.forName(drivername).newInstance(), Class.forName() …; creates StringBuilder.line 71

Methods (19)

SignatureDescriptionSource
static { … }Implicit default constructor generated by the compiler (not written in the source).implicit
String flush()2 statement(s).line 330
int getBPSRate1()4 statement(s); calls serialPort1.setSerialPortParams(), showBuffer(), ser1Out(), getString(), str.equals() ….line 336
char getC()Returns '\u0000'.line 325
char getChar(Object tNotifier)todo ... do it :)line 318
public String getString()9 statement(s); calls stringBuilder.setLength(), notifyAll(), wait(), stringBuilder.toString(), stringBuilder.append().line 419
public void out(String str)1 statement(s); calls outputStream1.write(), str.getBytes(), e.printStackTrace().line 53
public void run()6 statement(s); calls Thread.currentThread(), notifyAll(), wait(), inputStream1.available(), inputStream1.read() ….
Implements Runnable.run()
line 213
public void ser1Flush()1 statement(s).line 496
public void ser1Out(String str)1 statement(s); calls outputStream1.write(), str.getBytes(), e.printStackTrace().line 401
public void serialEvent(SerialPortEvent event)synchronize ensures atomic access to BUFFER_FULL bit.
Implements SerialPortEventListener.serialEvent()
line 285
int setBPSRate1(int tVal)3 statement(s); calls serialPort1.setSerialPortParams(), e.printStackTrace().line 381
public void setGobNotifier(Gob tNotifier)Sets gobNotifier = (Gob)tNotifier.line 579
public void setObjectNotifier(Object tNotifier)Sets objectNotifier = tNotifier.line 584
public void setTimeout(int tTime)Sets timeout = tTime.line 414
public void showBuffer()1 statement(s); calls showBuffer().line 505
public void showBuffer(BasicPane tPane)33 statement(s); calls g.setColor(), g.fillRect(), g.drawLine(), g.setFont(), g.drawString() …; creates Font, StringBuilder.line 514
public synchronized void start()2 statement(s); calls task.start(); creates Thread.line 200
public synchronized void stop()Sets task = null.line 206

Examples

Real usage taken from elsewhere in the HyperView 3.2 source (file and line shown; source path src/com/multiversesocial/hyperview/).

instantiation — SerialPane.java, line 110

  110  curView.serialPortHandler = new SerialHandler((Object) this, portString, 115200);

declaration — HyperView.java, line 367

  367  SerialHandler serialPortHandler;
Hits--