public class OWPath
extends java.lang.Object
// open a path to the temp device
path.open();
// read the temp device
byte[] state = tc.readDevice();
tc.doTemperatureConvert(state);
state = tc.readDevice();
System.out.println("Temperature of " +
address + " is " +
tc.getTemperature(state) + " C");
// close the path to the device
path.close();
OWPathElement
,
SwitchContainer
,
OneWireContainer05
,
OneWireContainer12
,
OneWireContainer1F
Constructor and Description |
---|
OWPath(DSPortAdapter adapter)
Create a new 1-Wire path with no elemements.
|
OWPath(DSPortAdapter adapter,
OWPath currentOWPath)
Create a new path with a starting path.
|
Modifier and Type | Method and Description |
---|---|
void |
add(OneWireContainer owc,
int channel)
Add a 1-Wire path element to this 1-Wire path.
|
void |
close()
Close each element in this 1-Wire path in reverse order.
|
void |
copy(OWPath currentOWPath)
Copy the elements from the provided 1-Wire path into this 1-Wire path.
|
boolean |
equals(OWPath compareOWPath)
Compare this 1-Wire path with another.
|
java.util.Enumeration |
getAllOWPathElements()
Get an enumeration of all of the 1-Wire path elements in
this 1-Wire path.
|
void |
open()
Open this 1-Wire path so that a remote device can be accessed.
|
java.lang.String |
toString()
Get a string representation of this 1-Wire path.
|
public OWPath(DSPortAdapter adapter)
copy
and/or
add
.public OWPath(DSPortAdapter adapter, OWPath currentOWPath)
add
.adapter
- where the 1-Wire path is basedcurrentPath
- starting value of this 1-Wire pathadd
public void copy(OWPath currentOWPath)
currentOWPath
- path to copy frompublic void add(OneWireContainer owc, int channel)
owc
- 1-Wire device switchchannel
- of device that represents this 1-Wire path elementcopy
public boolean equals(OWPath compareOWPath)
compareOWPath
- 1-Wire path to compare to true
if the 1-Wire paths are the samepublic java.util.Enumeration getAllOWPathElements()
OWPathElement
public java.lang.String toString()
toString
in class java.lang.Object
public void open() throws OneWireException, OneWireIOException
OneWireIOException
- on a 1-Wire communication error such as
no device present or a CRC read from the device is incorrect. This could be
caused by a physical interruption in the 1-Wire Network due to
shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.OneWireException
- on a communication or setup error with the 1-Wire
adapter.public void close() throws OneWireException, OneWireIOException
OneWireIOException
- on a 1-Wire communication error such as
no device present or a CRC read from the device is incorrect. This could be
caused by a physical interruption in the 1-Wire Network due to
shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.OneWireException
- on a communication or setup error with the 1-Wire
adapter.Copyright © 1999-2012 Maxim Integrated Products. All Rights Reserved.