devs.motorpackage.asc16
Class ASC16

java.lang.Object
  extended by devs.motorpackage.asc16.ASC16

public class ASC16
extends java.lang.Object

Class implementing the interface to the ASC16 controller. Only basic functions are implemented becuse the controll is on higher level


Nested Class Summary
(package private)  class ASC16.InputReader
           
 
Field Summary
protected  boolean busy
           
static java.io.InputStream is
          Comment for is
static javax.comm.SerialPort mPort
          Comment for mPort
static javax.comm.CommPortIdentifier mPortId
          Comment for mPortId
static java.io.OutputStream os
          Comment for os
(package private) static java.util.Enumeration portList
           
static java.util.Vector servos
          Comment for servos
protected  int triggerLevel
           
 
Constructor Summary
ASC16(java.lang.String portName)
           
 
Method Summary
 void closePort()
          Close the currently open serial port
(package private)  java.io.InputStream getInputStream()
           
(package private)  java.io.OutputStream getOutputStream()
           
 void initPort(int baud)
           
static void main(java.lang.String[] args)
           
 void openPort(java.lang.String portName)
           
 void register(Servo s)
          Register a Servo with ASC16 controller to obtain direct feedback
 void sendInt(int i)
          Sends a command to the ASC16 micro-controller
 void sendInt(int[] i)
          Sends a array of integer representing a single command to the ASC16 This limits the problem of command mixing - easy
 void setTriggerLevel(int triggerLevel)
          Sets the trigger level of the ASC16 controller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mPortId

public static javax.comm.CommPortIdentifier mPortId
Comment for mPortId


mPort

public static javax.comm.SerialPort mPort
Comment for mPort


os

public static java.io.OutputStream os
Comment for os


is

public static java.io.InputStream is
Comment for is


portList

static java.util.Enumeration portList

servos

public static java.util.Vector servos
Comment for servos


triggerLevel

protected int triggerLevel

busy

protected boolean busy
Constructor Detail

ASC16

public ASC16(java.lang.String portName)
Parameters:
portName -
Method Detail

register

public void register(Servo s)
Register a Servo with ASC16 controller to obtain direct feedback

Parameters:
s - - Servo

sendInt

public void sendInt(int i)
Sends a command to the ASC16 micro-controller

Parameters:
i - - integer

sendInt

public void sendInt(int[] i)
Sends a array of integer representing a single command to the ASC16 This limits the problem of command mixing - easy

Parameters:
i -

openPort

public void openPort(java.lang.String portName)
              throws javax.comm.NoSuchPortException,
                     javax.comm.PortInUseException
Parameters:
portName -
Throws:
javax.comm.NoSuchPortException
javax.comm.PortInUseException

closePort

public void closePort()
Close the currently open serial port


initPort

public void initPort(int baud)
              throws javax.comm.UnsupportedCommOperationException
Parameters:
baud -
Throws:
javax.comm.UnsupportedCommOperationException

getOutputStream

java.io.OutputStream getOutputStream()
                               throws java.io.IOException
Returns:
OutputStream to use for communicating with the servo controller.
Throws:
java.io.IOException

getInputStream

java.io.InputStream getInputStream()
                             throws java.io.IOException
Returns:
InuputStream to use for communicating with the servo controller.
Throws:
java.io.IOException

setTriggerLevel

public void setTriggerLevel(int triggerLevel)
Sets the trigger level of the ASC16 controller

Parameters:
triggerLevel - - integer [0-3]

main

public static void main(java.lang.String[] args)