|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.devices.bbElec.BBElec
public class BBElec
Base class for Serial-to-whatever devices from B&B Electronics, Ottawa IL
| Field Summary | |
|---|---|
protected java.io.InputStream |
_in
|
protected static org.apache.log4j.Logger |
_log4j
|
protected java.io.OutputStream |
_out
|
protected gnu.io.SerialPort |
_serPort
|
protected long |
_tmout
|
protected static long |
DFLT_TMOUT
|
| Constructor Summary | |
|---|---|
BBElec(gnu.io.SerialPort serport)
Constructor |
|
BBElec(gnu.io.SerialPort serport,
long tmout)
Constructor |
|
| Method Summary | |
|---|---|
int |
cmdWith16bitReply(byte[] cmd)
Send a command, get 16 bit reply |
int |
cmdWith16bitReply(byte[] cmd,
long tmout)
Send a command, get 16 bit reply |
int |
cmdWith32bitReply(byte[] cmd)
Send a command, get 32 bit reply |
int |
cmdWith32bitReply(byte[] cmd,
long tmout)
Send a command, get 32 bit reply |
protected void |
inFlush()
Flush InputStream |
int |
readResponse(byte[] buf,
int nbytes)
Read a response from the device |
int |
readResponse(byte[] buf,
int offset,
int nbytes,
long tmout)
Read a response from the device |
int |
readResponse(byte[] buf,
int nbytes,
long tmout)
Read a response from the device |
void |
send16bitCmd(byte[] cmd,
int parm)
Write a command with 16 bit parameter to the device |
void |
sendCmd(byte[] cmd)
Write a command to the device |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.log4j.Logger _log4j
protected static final long DFLT_TMOUT
protected gnu.io.SerialPort _serPort
protected java.io.InputStream _in
protected java.io.OutputStream _out
protected long _tmout
| Constructor Detail |
|---|
public BBElec(gnu.io.SerialPort serport,
long tmout)
throws java.io.IOException
serport - gnu.io.SerialPort that's connected to the devicetmout - Timeout for I/O in milliseconds
java.io.IOException
public BBElec(gnu.io.SerialPort serport)
throws java.io.IOException
serport - gnu.io.SerialPort that's connected to the device
java.io.IOException| Method Detail |
|---|
protected void inFlush()
public void sendCmd(byte[] cmd)
throws java.io.IOException
cmd - Command to send to device
java.io.IOException
public void send16bitCmd(byte[] cmd,
int parm)
throws java.io.IOException
cmd - Command to send to deviceparm - 16 bit parameter
java.io.IOException
public int readResponse(byte[] buf,
int offset,
int nbytes,
long tmout)
throws java.io.IOException
buf - Byte buffer to receive responseoffset - Where to start filling in buffernbytes - Number of bytes expectedtmout - Time to wait in milliseconds
java.io.IOException
public int readResponse(byte[] buf,
int nbytes,
long tmout)
throws java.io.IOException
buf - Byte buffer to receive responsenbytes - Number of bytes expectedtmout - Time to wait in milliseconds
java.io.IOException
public int readResponse(byte[] buf,
int nbytes)
throws java.io.IOException
buf - Byte buffer to receive responsenbytes - Number of bytes expected
java.io.IOException
public int cmdWith16bitReply(byte[] cmd,
long tmout)
throws java.io.IOException
cmd - Command to sendtmout - Time to wait in milliseconds
java.io.IOException
public int cmdWith16bitReply(byte[] cmd)
throws java.io.IOException
cmd - Command to send
java.io.IOException
public int cmdWith32bitReply(byte[] cmd,
long tmout)
throws java.io.IOException
cmd - Command to sendtmout - Time to wait in milliseconds
java.io.IOException
public int cmdWith32bitReply(byte[] cmd)
throws java.io.IOException
cmd - Command to send
java.io.IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||