|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.onewire.adapter.DSPortAdapter
The abstract base class for all 1-Wire port
adapter objects. An implementation class of this type is therefore
independent of the adapter type. Instances of valid DSPortAdapter's are
retrieved from methods in
OneWireAccessProvider
.
The DSPortAdapter methods can be organized into the following categories:
OneWireAccessProvider
,
OneWireContainer
Field Summary | |
static int |
CONDITION_AFTER_BIT
Condition for power state change, after next bit communication |
static int |
CONDITION_AFTER_BYTE
Condition for power state change, after next byte communication |
static int |
CONDITION_NOW
Condition for power state change, immediate |
static int |
DELIVERY_CURRENT_DETECT
Duration used in delivering power to the 1-Wire, current detect |
static int |
DELIVERY_EPROM
Duration used in delivering power to the 1-Wire, 480 us |
static int |
DELIVERY_FOUR_SECONDS
Duration used in delivering power to the 1-Wire, 4 second |
static int |
DELIVERY_HALF_SECOND
Duration used in delivering power to the 1-Wire, 1/2 second |
static int |
DELIVERY_INFINITE
Duration used in delivering power to the 1-Wire, infinite |
static int |
DELIVERY_ONE_SECOND
Duration used in delivering power to the 1-Wire, 1 second |
static int |
DELIVERY_SMART_DONE
Duration used in delivering power to the 1-Wire, smart complete |
static int |
DELIVERY_TWO_SECONDS
Duration used in delivering power to the 1-Wire, 2 seconds |
static char |
LEVEL_BREAK
1-Wire Network level, (strong pulldown to 0Volts, reset 1-Wire) |
static char |
LEVEL_NORMAL
1-Wire Network level, normal (weak 5Volt pullup) |
static char |
LEVEL_POWER_DELIVERY
1-Wire Network level, (strong 5Volt pullup, used for power delivery) |
static char |
LEVEL_PROGRAM
1-Wire Network level, (strong 12Volt pullup, used to program eprom ) |
static int |
RESET_ALARM
1-Wire Network reset result = alarm |
static int |
RESET_NOPRESENCE
1-Wire Network reset result = no presence |
static int |
RESET_PRESENCE
1-Wire Network reset result = presence |
static int |
RESET_SHORT
1-Wire Network reset result = shorted |
static int |
SPEED_FLEX
Speed modes for 1-Wire Network, flexible for long lines |
static int |
SPEED_HYPERDRIVE
Speed modes for 1-Wire Network, hyperdrive |
static int |
SPEED_OVERDRIVE
Speed modes for 1-Wire Network, overdrive |
static int |
SPEED_REGULAR
Speed modes for 1-Wire Network, regular |
Constructor Summary | |
DSPortAdapter()
|
Method Summary | |
abstract boolean |
adapterDetected()
Detects adapter presence on the selected port. |
void |
assertSelect(byte[] address)
Selects the specified iButton or 1-Wire device by broadcasting its address. |
void |
assertSelect(long address)
Selects the specified iButton or 1-Wire device by broadcasting its address. |
void |
assertSelect(String address)
Selects the specified iButton or 1-Wire device by broadcasting its address. |
abstract boolean |
beginExclusive(boolean blocking)
Gets exclusive use of the 1-Wire to communicate with an iButton or 1-Wire Device. |
boolean |
canBreak()
Returns whether adapter can physically support 0 volt 'break' mode. |
boolean |
canDeliverPower()
Returns whether the adapter can physically support strong 5 volt power mode. |
boolean |
canDeliverSmartPower()
Returns whether the adapter can physically support "smart" strong 5 volt power mode. |
boolean |
canFlex()
Returns whether the adapter can physically support flex speed mode. |
boolean |
canHyperdrive()
Returns whether the adapter can physically support hyperdrive mode. |
boolean |
canOverdrive()
Returns whether adapter can physically support overdrive mode. |
boolean |
canProgram()
Returns whether adapter can physically support 12 volt power mode. |
abstract void |
dataBlock(byte[] dataBlock,
int off,
int len)
Sends a block of data and returns the data received in the same array. |
abstract void |
endExclusive()
Relinquishes exclusive control of the 1-Wire Network. |
boolean |
equals(Object o)
Returns true if the given object is the same or equivalent to this DSPortAdapter. |
void |
excludeFamily(byte[] family)
Takes an array of bytes containing family codes to avoid when finding iButtons or 1-Wire devices. |
void |
excludeFamily(int family)
Takes an integer family code to avoid when searching for iButtons. |
abstract boolean |
findFirstDevice()
Returns true if the first iButton or 1-Wire device
is found on the 1-Wire Network. |
abstract boolean |
findNextDevice()
Returns true if the next iButton or 1-Wire device
is found. |
abstract void |
freePort()
Frees ownership of the selected port, if it is currently owned, back to the system. |
String |
getAdapterAddress()
Retrieves the address of the adapter, if it has one. |
abstract String |
getAdapterName()
Retrieves the name of the port adapter as a string. |
String |
getAdapterVersion()
Retrieves the version of the adapter. |
abstract void |
getAddress(byte[] address)
Copies the 'current' 1-Wire device address being used by the adapter into the array. |
long |
getAddressAsLong()
Gets the 'current' 1-Wire device address being used by the adapter as a long. |
String |
getAddressAsString()
Gets the 'current' 1-Wire device address being used by the adapter as a String. |
Enumeration |
getAllDeviceContainers()
Returns an enumeration of OneWireContainer objects corresponding
to all of the iButtons or 1-Wire devices found on the 1-Wire Network. |
abstract boolean |
getBit()
Gets a bit from the 1-Wire Network. |
abstract void |
getBlock(byte[] arr,
int len)
Gets a block of data from the 1-Wire Network and write it into the provided array. |
abstract void |
getBlock(byte[] arr,
int off,
int len)
Gets a block of data from the 1-Wire Network and write it into the provided array. |
abstract byte[] |
getBlock(int len)
Gets a block of data from the 1-Wire Network. |
abstract int |
getByte()
Gets a byte from the 1-Wire Network. |
abstract String |
getClassVersion()
Retrieves a version string for this class. |
OneWireContainer |
getDeviceContainer()
Constructs a OneWireContainer object using the current 1-Wire network address. |
OneWireContainer |
getDeviceContainer(byte[] address)
Constructs a OneWireContainer object with a user supplied 1-Wire network address. |
OneWireContainer |
getDeviceContainer(long address)
Constructs a OneWireContainer object with a user supplied 1-Wire network address. |
OneWireContainer |
getDeviceContainer(String address)
Constructs a OneWireContainer object with a user supplied 1-Wire network address. |
OneWireContainer |
getFirstDeviceContainer()
Returns a OneWireContainer object corresponding to the first iButton
or 1-Wire device found on the 1-Wire Network. |
OneWireContainer |
getNextDeviceContainer()
Returns a OneWireContainer object corresponding to the next iButton
or 1-Wire device found. |
abstract String |
getPortName()
Retrieves the name of the selected port as a String . |
abstract Enumeration |
getPortNames()
Retrieves a list of the platform appropriate port names for this adapter. |
abstract String |
getPortTypeDescription()
Retrieves a description of the port required by this port adapter. |
int |
getSpeed()
Returns the current data transfer speed on the 1-Wire Network. |
boolean |
isAlarming(byte[] address)
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network and in an alarm state. |
boolean |
isAlarming(long address)
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network and in an alarm state. |
boolean |
isAlarming(String address)
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network and in an alarm state. |
boolean |
isPresent(byte[] address)
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network. |
boolean |
isPresent(long address)
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network. |
boolean |
isPresent(String address)
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network. |
abstract void |
putBit(boolean bitValue)
Sends a bit to the 1-Wire Network. |
abstract void |
putByte(int byteValue)
Sends a byte to the 1-Wire Network. |
void |
registerOneWireContainerClass(int family,
Class OneWireContainerClass)
Registers a user provided OneWireContainer class. |
abstract int |
reset()
Sends a Reset to the 1-Wire Network. |
boolean |
select(byte[] address)
Selects the specified iButton or 1-Wire device by broadcasting its address. |
boolean |
select(long address)
Selects the specified iButton or 1-Wire device by broadcasting its address. |
boolean |
select(String address)
Selects the specified iButton or 1-Wire device by broadcasting its address. |
abstract boolean |
selectPort(String portName)
Specifies a platform appropriate port name for this adapter. |
abstract void |
setNoResetSearch()
Sets the 1-Wire Network search to not perform a 1-Wire reset before a search. |
void |
setPowerDuration(int timeFactor)
Sets the duration to supply power to the 1-Wire Network. |
void |
setPowerNormal()
Sets the 1-Wire Network voltage to normal level. |
void |
setProgramPulseDuration(int timeFactor)
Sets the duration for providing a program pulse on the 1-Wire Network. |
abstract void |
setSearchAllDevices()
Sets the 1-Wire Network search to find all iButtons and 1-Wire devices whether they are in an 'Alarm' state or not and restores the default setting of providing a 1-Wire reset command before each search. |
abstract void |
setSearchOnlyAlarmingDevices()
Sets the 1-Wire Network search to find only iButtons and 1-Wire devices that are in an 'Alarm' state that signals a need for attention. |
void |
setSpeed(int speed)
Sets the new speed of data transfer on the 1-Wire Network. |
void |
startBreak()
Sets the 1-Wire Network voltage to 0 volts. |
boolean |
startPowerDelivery(int changeCondition)
Sets the 1-Wire Network voltage to supply power to a 1-Wire device. |
boolean |
startProgramPulse(int changeCondition)
Sets the 1-Wire Network voltage to eprom programming level. |
void |
targetAllFamilies()
Removes any selectivity during a search for iButtons or 1-Wire devices by family type. |
void |
targetFamily(byte[] family)
Takes an array of bytes to use for selectively searching for acceptable family codes. |
void |
targetFamily(int family)
Takes an integer to selectively search for this desired family type. |
String |
toString()
Returns a string representation of this DSPortAdapter, in the format of " |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int SPEED_REGULAR
public static final int SPEED_FLEX
public static final int SPEED_OVERDRIVE
public static final int SPEED_HYPERDRIVE
public static final char LEVEL_NORMAL
public static final char LEVEL_POWER_DELIVERY
public static final char LEVEL_BREAK
public static final char LEVEL_PROGRAM
public static final int RESET_NOPRESENCE
public static final int RESET_PRESENCE
public static final int RESET_ALARM
public static final int RESET_SHORT
public static final int CONDITION_NOW
public static final int CONDITION_AFTER_BIT
public static final int CONDITION_AFTER_BYTE
public static final int DELIVERY_HALF_SECOND
public static final int DELIVERY_ONE_SECOND
public static final int DELIVERY_TWO_SECONDS
public static final int DELIVERY_FOUR_SECONDS
public static final int DELIVERY_SMART_DONE
public static final int DELIVERY_INFINITE
public static final int DELIVERY_CURRENT_DETECT
public static final int DELIVERY_EPROM
Constructor Detail |
public DSPortAdapter()
Method Detail |
public abstract String getAdapterName()
String
representation of the port adapter.public abstract String getPortTypeDescription()
String
description of the port type required.public abstract String getClassVersion()
public abstract Enumeration getPortNames()
OneWireException
exception.Enumeration
of type String
that contains the port
namespublic void registerOneWireContainerClass(int family, Class OneWireContainerClass) throws OneWireException
OneWireContainer
class.
Using this method will override the Dallas Semiconductor provided
container class when using the getDeviceContainer() method. The
registered container state is only stored for the current
instance of DSPortAdapter
, and is not statically shared.
The OneWireContainerClass
must extend
com.dalsemi.onewire.container.OneWireContainer
otherwise a ClassCastException
will be thrown.
The older duplicate family will be removed from registration when
a collision occurs.
Passing null as a parameter for the OneWireContainerClass
will result
in the removal of any entry associated with the family.family
- the code of the family type to associate with this class.OneWireContainerClass
- User provided classOneWireException
- If OneWireContainerClass
is not found.ClassCastException
- If user supplied OneWireContainer
does not
extend com.dalsemi.onewire.container.OneWireContainer
.public abstract boolean selectPort(String portName) throws OneWireIOException, OneWireException
PortInUseException
will be thrown.portName
- name of the target port, retrieved from
getPortNames()true
if the port was aquired, false
if the port is not available.OneWireIOException
- If port does not exist, or unable to communicate with port.OneWireException
- If port does not existpublic abstract void freePort() throws OneWireException
OneWireException
- If port does not existpublic abstract String getPortName() throws OneWireException
String
.String
of selected portOneWireException
- if valid port not yet selectedpublic abstract boolean adapterDetected() throws OneWireIOException, OneWireException
true
if the adapter is confirmed to be connected to
the selected port, false
if the adapter is not connected.OneWireIOException
- OneWireException
- public String getAdapterVersion() throws OneWireIOException, OneWireException
String
of the adapter version. It will return
"OneWireIOException
- on a 1-Wire communication error such as
no device present. 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
adapterpublic String getAdapterAddress() throws OneWireIOException, OneWireException
String
of the adapter address. It will return "OneWireIOException
- on a 1-Wire communication error such as
no device present. 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
adapterAddress
public boolean canOverdrive() throws OneWireIOException, OneWireException
true
if this port adapter can do OverDrive,
false
otherwise.OneWireIOException
- on a 1-Wire communication error with the adapterOneWireException
- on a setup error with the 1-Wire
adapterpublic boolean canHyperdrive() throws OneWireIOException, OneWireException
true
if this port adapter can do HyperDrive,
false
otherwise.OneWireIOException
- on a 1-Wire communication error with the adapterOneWireException
- on a setup error with the 1-Wire
adapterpublic boolean canFlex() throws OneWireIOException, OneWireException
true
if this port adapter can do flex speed,
false
otherwise.OneWireIOException
- on a 1-Wire communication error with the adapterOneWireException
- on a setup error with the 1-Wire
adapterpublic boolean canProgram() throws OneWireIOException, OneWireException
true
if this port adapter can do Program voltage,
false
otherwise.OneWireIOException
- on a 1-Wire communication error with the adapterOneWireException
- on a setup error with the 1-Wire
adapterpublic boolean canDeliverPower() throws OneWireIOException, OneWireException
true
if this port adapter can do strong 5 volt
mode, false
otherwise.OneWireIOException
- on a 1-Wire communication error with the adapterOneWireException
- on a setup error with the 1-Wire
adapterpublic boolean canDeliverSmartPower() throws OneWireIOException, OneWireException
true
if this port adapter can do "smart" strong
5 volt mode, false
otherwise.OneWireIOException
- on a 1-Wire communication error with the adapterOneWireException
- on a setup error with the 1-Wire
adapterpublic boolean canBreak() throws OneWireIOException, OneWireException
true
if this port adapter can do break,
false
otherwise.OneWireIOException
- on a 1-Wire communication error with the adapterOneWireException
- on a setup error with the 1-Wire
adapterpublic Enumeration getAllDeviceContainers() throws OneWireIOException, OneWireException
OneWireContainer
objects corresponding
to all of the iButtons or 1-Wire devices found on the 1-Wire Network.
If no devices are found, then an empty enumeration will be returned.
In most cases, all further communication with the device is done
through the OneWireContainer.Enumeration
of OneWireContainer
objects
found on the 1-Wire Network.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic OneWireContainer getFirstDeviceContainer() throws OneWireIOException, OneWireException
OneWireContainer
object corresponding to the first iButton
or 1-Wire device found on the 1-Wire Network. If no devices are found,
then a null
reference will be returned. In most cases, all further
communication with the device is done through the OneWireContainer
.OneWireContainer
object found on the
1-Wire Network, or null
if no devices found.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic OneWireContainer getNextDeviceContainer() throws OneWireIOException, OneWireException
OneWireContainer
object corresponding to the next iButton
or 1-Wire device found. The previous 1-Wire device found is used
as a starting point in the search. If no devices are found,
then a null
reference will be returned. In most cases, all further
communication with the device is done through the OneWireContainer
.OneWireContainer
object found on the
1-Wire Network, or null
if no iButtons found.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract boolean findFirstDevice() throws OneWireIOException, OneWireException
true
if the first iButton or 1-Wire device
is found on the 1-Wire Network.
If no devices are found, then false
will be returned.true
if an iButton or 1-Wire device is found.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract boolean findNextDevice() throws OneWireIOException, OneWireException
true
if the next iButton or 1-Wire device
is found. The previous 1-Wire device found is used
as a starting point in the search. If no more devices are found
then false
will be returned.true
if an iButton or 1-Wire device is found.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract void getAddress(byte[] address)
address
- An array to be filled with the current iButton address.Address
public long getAddressAsLong()
long
representation of the iButton addressAddress
public String getAddressAsString()
String
representation of the iButton addressAddress
public boolean isPresent(byte[] address) throws OneWireIOException, OneWireException
address
- device address to verify is presenttrue
if device is present, else
false
.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterAddress
public boolean isPresent(long address) throws OneWireIOException, OneWireException
address
- device address to verify is presenttrue
if device is present, else
false
.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterAddress
public boolean isPresent(String address) throws OneWireIOException, OneWireException
address
- device address to verify is presenttrue
if device is present, else
false
.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterAddress
public boolean isAlarming(byte[] address) throws OneWireIOException, OneWireException
address
- device address to verify is present and alarmingtrue
if device is present and alarming, else
false
.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterAddress
public boolean isAlarming(long address) throws OneWireIOException, OneWireException
address
- device address to verify is present and alarmingtrue
if device is present and alarming, else
false
.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterAddress
public boolean isAlarming(String address) throws OneWireIOException, OneWireException
address
- device address to verify is present and alarmingtrue
if device is present and alarming, else
false
.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterAddress
public boolean select(byte[] address) throws OneWireIOException, OneWireException
address
- address of iButton or 1-Wire device to selecttrue
if device address was sent, false
otherwise.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterisPresent(byte[])
,
Address
public boolean select(long address) throws OneWireIOException, OneWireException
address
- address of iButton or 1-Wire device to selecttrue
if device address was sent,false
otherwise.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterisPresent(byte[])
,
Address
public boolean select(String address) throws OneWireIOException, OneWireException
address
- address of iButton or 1-Wire device to selecttrue
if device address was sent,false
otherwise.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterisPresent(byte[])
,
Address
public void assertSelect(byte[] address) throws OneWireIOException, OneWireException
address
- address of iButton or 1-Wire device to selectOneWireIOException
- on a 1-Wire communication error, or if their
are no devices on the 1-Wire net.OneWireException
- on a setup error with the 1-Wire adapterisPresent(byte[])
,
Address
public void assertSelect(long address) throws OneWireIOException, OneWireException
address
- address of iButton or 1-Wire device to selecttrue
if device address was sent,false
otherwise.OneWireIOException
- on a 1-Wire communication error, or if their
are no devices on the 1-Wire net.OneWireException
- on a setup error with the 1-Wire adapterisPresent(byte[])
,
Address
public void assertSelect(String address) throws OneWireIOException, OneWireException
address
- address of iButton or 1-Wire device to selectOneWireIOException
- on a 1-Wire communication error, or if their
are no devices on the 1-Wire net.OneWireException
- on a setup error with the 1-Wire adapterisPresent(byte[])
,
Address
public abstract void setSearchOnlyAlarmingDevices()
setNoResetSearch()
public abstract void setNoResetSearch()
public abstract void setSearchAllDevices()
setNoResetSearch()
public void targetAllFamilies()
targetFamily(int)
,
targetFamily(byte[])
,
excludeFamily(int)
,
excludeFamily(byte[])
public void targetFamily(int family)
family
- the code of the family type to target for searchesAddress
,
targetAllFamilies()
public void targetFamily(byte[] family)
family
- array of the family types to target for searchesAddress
,
targetAllFamilies()
public void excludeFamily(int family)
family
- the code of the family type NOT to target in searchesAddress
,
targetAllFamilies()
public void excludeFamily(byte[] family)
family
- array of family cods NOT to target for searchesAddress
,
targetAllFamilies()
public abstract boolean beginExclusive(boolean blocking) throws OneWireException
It can be called through the OneWireContainer class by the end application if they want to ensure exclusive use. If it is not called around several methods then it will be called inside each method.
blocking
- true
if want to block waiting
for an excluse access to the adaptertrue
if blocking was false and a
exclusive session with the adapter was aquiredOneWireException
- on a setup error with the 1-Wire adapterpublic abstract void endExclusive()
public abstract void putBit(boolean bitValue) throws OneWireIOException, OneWireException
bitValue
- the bit value to send to the 1-Wire Network.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract boolean getBit() throws OneWireIOException, OneWireException
OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract void putByte(int byteValue) throws OneWireIOException, OneWireException
byteValue
- the byte value to send to the 1-Wire Network.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract int getByte() throws OneWireIOException, OneWireException
OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract byte[] getBlock(int len) throws OneWireIOException, OneWireException
len
- length of data bytes to receiveOneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract void getBlock(byte[] arr, int len) throws OneWireIOException, OneWireException
arr
- array in which to write the received byteslen
- length of data bytes to receiveOneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract void getBlock(byte[] arr, int off, int len) throws OneWireIOException, OneWireException
arr
- array in which to write the received bytesoff
- offset into the array to startlen
- length of data bytes to receiveOneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract void dataBlock(byte[] dataBlock, int off, int len) throws OneWireIOException, OneWireException
dataBlock
- array of data to transfer to and from the 1-Wire Network.off
- offset into the array of data to startlen
- length of data to send / receive starting at 'off'OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic abstract int reset() throws OneWireIOException, OneWireException
OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic void setPowerDuration(int timeFactor) throws OneWireIOException, OneWireException
Note: to avoid getting an exception, use the canDeliverPower() and canDeliverSmartPower() method to check it's availability.
timeFactor
- OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic boolean startPowerDelivery(int changeCondition) throws OneWireIOException, OneWireException
Note: to avoid getting an exception, use the canDeliverPower() and canDeliverSmartPower() method to check it's availability.
changeCondition
- true
if the voltage change was successful,
false
otherwise.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic void setProgramPulseDuration(int timeFactor) throws OneWireIOException, OneWireException
Note: to avoid getting an exception, use the canDeliverPower() method to check it's availability.
timeFactor
- OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapterpublic boolean startProgramPulse(int changeCondition) throws OneWireIOException, OneWireException
Note: to avoid getting an exception, use the canProgram() method to check it's availability.
changeCondition
- true
if the voltage change was successful,
false
otherwise.OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapter
or the adapter does not support this operationpublic void startBreak() throws OneWireIOException, OneWireException
OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapter
or the adapter does not support this operationpublic void setPowerNormal() throws OneWireIOException, OneWireException
OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapter
or the adapter does not support this operationpublic void setSpeed(int speed) throws OneWireIOException, OneWireException
speed
- OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapter
or the adapter does not support this operationpublic int getSpeed()
int
representing the current 1-Wire speed
public OneWireContainer getDeviceContainer(byte[] address)
OneWireContainer
object with a user supplied 1-Wire network address.address
- device address with which to create a new containerOneWireContainer
objectAddress
public OneWireContainer getDeviceContainer(long address)
OneWireContainer
object with a user supplied 1-Wire network address.address
- device address with which to create a new containerOneWireContainer
objectAddress
public OneWireContainer getDeviceContainer(String address)
OneWireContainer
object with a user supplied 1-Wire network address.address
- device address with which to create a new containerOneWireContainer
objectAddress
public OneWireContainer getDeviceContainer()
OneWireContainer
object using the current 1-Wire network address.
The internal state of the port adapter keeps track of the last
address found and is able to create container objects from this
state.OneWireContainer
objectpublic boolean equals(Object o)
equals
in class Object
o
- the Object to compare this DSPortAdapter topublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |