faa.misc.oneWire
Class oneWireBus

java.lang.Object
  extended by faa.misc.oneWire.oneWireBus

public class oneWireBus
extends java.lang.Object

oneWireBus represents a Dallas Semiconductor One-Wire Bus which actually consists of two wires. Source: oneWireBus.java

Version:
$Id: oneWireBus.java,v 3.1 2006/03/14 15:47:35 samf Exp $
Author:
David Lonkart
See Also:
oneWireBus

Field Summary
static byte ALARMSEARCH
          Byte used to send a AlarmSearch command.
static byte CONVERTT
          Byte used to send a ConvertT command.
static byte COPYSCRATCH
          Byte used to send a CopyScratchpad command.
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
private  java.io.InputStream from_bus
          InputStream object
static byte MATCHROM
          Byte used to send a MatchROM command.
static byte ONEBIT
          Byte used to send a one bit on the bus
static byte READPOWER
          Byte used to send a Read Power Supply command.
static byte READROM
          Byte used to send a ReadROM command.
static byte READSCRATCH
          Byte used to send a ReadScratchpad command.
static byte RECALLE2
          Byte used to send a RecallE2 command.
static byte RESET
          Byte used to send a Reset command.
private  SerialCommunicator sc
          Serial communicator object.
static byte SEARCHROM
          Byte used to send a SearchROM command.
static byte SKIPROM
          Byte used to send a SkipROM command.
private  java.io.OutputStream to_bus
          OuputStream object
static byte WRITESCRATCH
          Byte used to send a WriteScratchpad command.
static byte ZEROBIT
          Byte used to send a zero bit on the bus
 
Constructor Summary
oneWireBus(SerialCommunicator sc)
          Construct a new one wire bus.
 
Method Summary
 void AlarmSearch()
          Issue a Alarm Search command on the bus This allows the bus master to find all of the unique ROM codes of the devices on the bus that have an alarm set.
 void ConvertT()
          Issue a Convert T command on the bus Measure the temperature.
 void CopyScratch()
          Issue a Copy Scratchpad command on the bus Copy scratchpad data into EE memory.
 void MatchROM(byte[] ROMcode)
          Issue a Match ROM command on the bus This allows the bus master to address a single device by disabling (until RESET) all other devices not matching the ROMcode put on the wire.
 byte readByte()
          Read a byte from the bus.
 void ReadROM()
          Issue a Read ROM command on the bus This reads the 64 bit ROM code from a device when there is only one device on the entire bus.
 void ReadScratch()
          Issue a Read Scratchpad command on the bus Read data from the scratchpad of a particular device.
 void RecallE2()
          Issue a Recall E2 command on the bus Recall the EE memory values to the scratchpad.
 void Reset()
          Issue a RESET command on the bus
 void SearchROM()
          Issue a Search ROM command on the bus This allows the bus master to find all of the unique ROM codes of the devices on the bus.
 void SkipROM()
          Issue a Skip ROM command on the bus This allows the bus master to address the ONLY device on the bus without specifying the ROM code.
 byte writeByte(byte data)
          Write a byte on the bus.
 void WriteScratch()
          Issue a Write Scratchpad command on the bus Write data to the scratchpad of a particular device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values

ONEBIT

public static final byte ONEBIT
Byte used to send a one bit on the bus

See Also:
Constant Field Values

ZEROBIT

public static final byte ZEROBIT
Byte used to send a zero bit on the bus

See Also:
Constant Field Values

RESET

public static final byte RESET
Byte used to send a Reset command.

See Also:
Constant Field Values

READROM

public static final byte READROM
Byte used to send a ReadROM command.

See Also:
Constant Field Values

MATCHROM

public static final byte MATCHROM
Byte used to send a MatchROM command.

See Also:
Constant Field Values

SKIPROM

public static final byte SKIPROM
Byte used to send a SkipROM command.

See Also:
Constant Field Values

SEARCHROM

public static final byte SEARCHROM
Byte used to send a SearchROM command.

See Also:
Constant Field Values

ALARMSEARCH

public static final byte ALARMSEARCH
Byte used to send a AlarmSearch command.

See Also:
Constant Field Values

WRITESCRATCH

public static final byte WRITESCRATCH
Byte used to send a WriteScratchpad command.

See Also:
Constant Field Values

READSCRATCH

public static final byte READSCRATCH
Byte used to send a ReadScratchpad command.

See Also:
Constant Field Values

COPYSCRATCH

public static final byte COPYSCRATCH
Byte used to send a CopyScratchpad command.

See Also:
Constant Field Values

CONVERTT

public static final byte CONVERTT
Byte used to send a ConvertT command.

See Also:
Constant Field Values

RECALLE2

public static final byte RECALLE2
Byte used to send a RecallE2 command.

See Also:
Constant Field Values

READPOWER

public static final byte READPOWER
Byte used to send a Read Power Supply command.

See Also:
Constant Field Values

sc

private SerialCommunicator sc
Serial communicator object.


to_bus

private java.io.OutputStream to_bus
OuputStream object


from_bus

private java.io.InputStream from_bus
InputStream object

Constructor Detail

oneWireBus

public oneWireBus(SerialCommunicator sc)
Construct a new one wire bus.

Method Detail

Reset

public void Reset()
           throws oneWireCmdFailure
Issue a RESET command on the bus

Throws:
oneWireCmdFailure

ReadROM

public void ReadROM()
             throws oneWireCmdFailure
Issue a Read ROM command on the bus This reads the 64 bit ROM code from a device when there is only one device on the entire bus.

Throws:
oneWireCmdFailure

MatchROM

public void MatchROM(byte[] ROMcode)
              throws oneWireCmdFailure
Issue a Match ROM command on the bus This allows the bus master to address a single device by disabling (until RESET) all other devices not matching the ROMcode put on the wire.

Throws:
oneWireCmdFailure

SkipROM

public void SkipROM()
             throws oneWireCmdFailure
Issue a Skip ROM command on the bus This allows the bus master to address the ONLY device on the bus without specifying the ROM code.

Throws:
oneWireCmdFailure

SearchROM

public void SearchROM()
               throws oneWireCmdFailure
Issue a Search ROM command on the bus This allows the bus master to find all of the unique ROM codes of the devices on the bus.

Throws:
oneWireCmdFailure

AlarmSearch

public void AlarmSearch()
                 throws oneWireCmdFailure
Issue a Alarm Search command on the bus This allows the bus master to find all of the unique ROM codes of the devices on the bus that have an alarm set.

Throws:
oneWireCmdFailure

WriteScratch

public void WriteScratch()
                  throws oneWireCmdFailure
Issue a Write Scratchpad command on the bus Write data to the scratchpad of a particular device. Requires a previous MatchROM or SkipROM command.

Throws:
oneWireCmdFailure

ReadScratch

public void ReadScratch()
                 throws oneWireCmdFailure
Issue a Read Scratchpad command on the bus Read data from the scratchpad of a particular device. Requires a previous MatchROM or SkipROM command.

Throws:
oneWireCmdFailure

CopyScratch

public void CopyScratch()
                 throws oneWireCmdFailure
Issue a Copy Scratchpad command on the bus Copy scratchpad data into EE memory. Requires a previous MatchROM or SkipROM command.

Throws:
oneWireCmdFailure

ConvertT

public void ConvertT()
              throws oneWireCmdFailure
Issue a Convert T command on the bus Measure the temperature. Requires a previous MatchROM or SkipROM command.

Throws:
oneWireCmdFailure

RecallE2

public void RecallE2()
              throws oneWireCmdFailure
Issue a Recall E2 command on the bus Recall the EE memory values to the scratchpad. Requires a previous MatchROM or SkipROM command.

Throws:
oneWireCmdFailure

writeByte

public byte writeByte(byte data)
               throws oneWireCmdFailure
Write a byte on the bus. Each bit of the data byte requires that an entire byte be written on the bus.

Throws:
oneWireCmdFailure

readByte

public byte readByte()
              throws oneWireCmdFailure
Read a byte from the bus.

Returns:
A byte from the bus.
Throws:
oneWireCmdFailure