Package com.dalsemi.onewire.adapter
Class DumbAdapter
java.lang.Object
com.dalsemi.onewire.adapter.DSPortAdapter
com.dalsemi.onewire.adapter.DumbAdapter
This DSPortAdapter
class was designed to be used for the
iB-IDE's emulator. The DumbAdapter
allows programmers to add and
remove OneWireContainer
objects that will be found in its
search. The Java iButton emulator works by creating a class that subclasses
all of OneWireContainer16
's relevant methods and redirecting
them to the emulation code. That object is then added to this class's list of
OneWireContainer
s.
Note that methods such as selectPort
and
beginExclusive
by default do nothing. This class is mainly meant
for debugging using an emulated iButton. It will do a poor job of debugging
any multi-threading, port-sharing issues.
- See Also:
-
Field Summary
Fields inherited from class com.dalsemi.onewire.adapter.DSPortAdapter
CONDITION_AFTER_BIT, CONDITION_AFTER_BYTE, CONDITION_NOW, DELIVERY_CURRENT_DETECT, DELIVERY_EPROM, DELIVERY_FOUR_SECONDS, DELIVERY_HALF_SECOND, DELIVERY_INFINITE, DELIVERY_ONE_SECOND, DELIVERY_SMART_DONE, DELIVERY_TWO_SECONDS, LEVEL_BREAK, LEVEL_NORMAL, LEVEL_POWER_DELIVERY, LEVEL_PROGRAM, RESET_ALARM, RESET_NOPRESENCE, RESET_PRESENCE, RESET_SHORT, SPEED_FLEX, SPEED_HYPERDRIVE, SPEED_OVERDRIVE, SPEED_REGULAR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Detects adapter presence on the selected port.void
Adds aOneWireContainer
to the list of containers that this adapter object will find.boolean
beginExclusive
(boolean blocking) This method does nothing inDumbAdapter
.boolean
canBreak()
Applications might check this method and not attempt operation unless this method returnstrue
.boolean
Applications might check this method and not attempt operation unless this method returnstrue
.boolean
Applications might check this method and not attempt operation unless this method returnstrue
.boolean
canFlex()
Applications might check this method and not attempt operation unless this method returnstrue
.boolean
Applications might check this method and not attempt operation unless this method returnstrue
.boolean
Applications might check this method and not attempt operation unless this method returnstrue
.boolean
Applications might check this method and not attempt operation unless this method returnstrue
.void
dataBlock
(byte[] dataBlock, int off, int len) This method does nothing inDumbAdapter
.void
This method does nothing inDumbAdapter
.void
excludeFamily
(byte[] family) This method does nothing inDumbAdapter
.void
excludeFamily
(int family) This method does nothing inDumbAdapter
.boolean
Returnstrue
if the first iButton or 1-Wire device is found on the 1-Wire Network.boolean
Returnstrue
if the next iButton or 1-Wire device is found.void
freePort()
This method does nothing inDumbAdapter
.Retrieves the name of the port adapter as a string.void
getAddress
(byte[] address) Copies the 'current' 1-Wire device address being used by the adapter into the array.long
Gets the 'current' 1-Wire device address being used by the adapter as a long.Gets the 'current' 1-Wire device address being used by the adapter as a String.Returns an enumeration ofOneWireContainer
objects corresponding to all of the iButtons or 1-Wire devices found on the 1-Wire Network.boolean
getBit()
Gets a bit from the 1-Wire Network.void
getBlock
(byte[] arr, int len) This method does nothing inDumbAdapter
.void
getBlock
(byte[] arr, int off, int len) This method does nothing inDumbAdapter
.byte[]
getBlock
(int len) This method does nothing inDumbAdapter
.int
getByte()
This method does nothing inDumbAdapter
.Retrieves a version string for this class.Returns aOneWireContainer
object using the current 1-Wire network address.getDeviceContainer
(byte[] address) Gets the container from this adapter whose address matches the address of a container in theDumbAdapter
's internaljava.util.Vector
.getDeviceContainer
(long address) Gets the container from this adapter whose address matches the address of a container in theDumbAdapter
's internaljava.util.Vector
.getDeviceContainer
(String address) Gets the container from this adapter whose address matches the address of a container in theDumbAdapter
's internaljava.util.Vector
.Returns aOneWireContainer
object corresponding to the first iButton or 1-Wire device found on the 1-Wire Network.Returns aOneWireContainer
object corresponding to the next iButton or 1-Wire device found.Retrieves the name of the selected port as aString
.Retrieves a list of the platform appropriate port names for this adapter.Retrieves a description of the port required by this port adapter.int
getSpeed()
This method does nothing inDumbAdapter
.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
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network.protected boolean
isValidFamily
(byte[] address) Checks to see if the family found is in the desired include group.void
putBit
(boolean bitValue) Sends a bit to the 1-Wire Network.void
putByte
(int byteValue) This method does nothing inDumbAdapter
.void
registerOneWireContainerClass
(int family, Class<?> OneWireContainerClass) This method does nothing inDumbAdapter
.void
Removes aOneWireContainer
from the list of containers that this adapter object will find.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
Selects the specified iButton or 1-Wire device by broadcasting its address.boolean
selectPort
(String portName) This method does nothing inDumbAdapter
.void
This method does nothing inDumbAdapter
.void
setPowerDuration
(int timeFactor) This method does nothing inDumbAdapter
.void
This method does nothing inDumbAdapter
.void
setProgramPulseDuration
(int timeFactor) This method does nothing inDumbAdapter
.void
This method does nothing inDumbAdapter
.void
This method does nothing inDumbAdapter
.void
setSpeed
(int speed) This method does nothing inDumbAdapter
.void
This method does nothing inDumbAdapter
.boolean
startPowerDelivery
(int changeCondition) This method does nothing inDumbAdapter
.boolean
startProgramPulse
(int changeCondition) This method does nothing inDumbAdapter
.void
This method does nothing inDumbAdapter
.void
targetFamily
(byte[] family) This method does nothing inDumbAdapter
.void
targetFamily
(int family) This method does nothing inDumbAdapter
.Methods inherited from class com.dalsemi.onewire.adapter.DSPortAdapter
assertSelect, assertSelect, assertSelect, equals, getAdapterAddress, getAdapterVersion, toString
-
Constructor Details
-
DumbAdapter
public DumbAdapter()
-
-
Method Details
-
addContainer
Adds aOneWireContainer
to the list of containers that this adapter object will find.- Parameters:
c
- represents a 1-Wire device that this adapter will report from a search
-
removeContainer
Removes aOneWireContainer
from the list of containers that this adapter object will find.- Parameters:
c
- represents a 1-Wire device that this adapter should no longer report as found by a search
-
getAdapterName
Retrieves the name of the port adapter as a string. The 'Adapter' is a device that connects to a 'port' that allows one to communicate with an iButton or other 1-Wire device. As example of this is 'DS9097U'.- Specified by:
getAdapterName
in classDSPortAdapter
- Returns:
String
representation of the port adapter.
-
getPortTypeDescription
Retrieves a description of the port required by this port adapter. An example of a 'Port' would 'serial communication port'.- Specified by:
getPortTypeDescription
in classDSPortAdapter
- Returns:
String
description of the port type required.
-
getClassVersion
Retrieves a version string for this class.- Specified by:
getClassVersion
in classDSPortAdapter
- Returns:
- version string
-
getPortNames
Retrieves a list of the platform appropriate port names for this adapter. A port must be selected with the method 'selectPort' before any other communication methods can be used. Using a communication method before 'selectPort' will result in aOneWireException
exception.- Specified by:
getPortNames
in classDSPortAdapter
- Returns:
Enumeration
of typeString
that contains the port names
-
registerOneWireContainerClass
This method does nothing inDumbAdapter
.- Overrides:
registerOneWireContainerClass
in classDSPortAdapter
- Parameters:
family
- the code of the family type to associate with this class.OneWireContainerClass
- User provided class
-
selectPort
This method does nothing inDumbAdapter
.- Specified by:
selectPort
in classDSPortAdapter
- Parameters:
portName
- name of the target port, retrieved from getPortNames()- Returns:
- always returns
true
-
freePort
public void freePort()This method does nothing inDumbAdapter
.- Specified by:
freePort
in classDSPortAdapter
-
getPortName
Retrieves the name of the selected port as aString
.- Specified by:
getPortName
in classDSPortAdapter
- Returns:
- always returns the
String
"NULL0"
-
adapterDetected
public boolean adapterDetected()Detects adapter presence on the selected port. InDumbAdapter
, the adapter is always detected.- Specified by:
adapterDetected
in classDSPortAdapter
- Returns:
true
-
canOverdrive
public boolean canOverdrive()Applications might check this method and not attempt operation unless this method returnstrue
. To make sure that a wide variety of applications can use this class, this method always returnstrue
.- Overrides:
canOverdrive
in classDSPortAdapter
- Returns:
true
-
canHyperdrive
public boolean canHyperdrive()Applications might check this method and not attempt operation unless this method returnstrue
. To make sure that a wide variety of applications can use this class, this method always returnstrue
.- Overrides:
canHyperdrive
in classDSPortAdapter
- Returns:
true
-
canFlex
public boolean canFlex()Applications might check this method and not attempt operation unless this method returnstrue
. To make sure that a wide variety of applications can use this class, this method always returnstrue
.- Overrides:
canFlex
in classDSPortAdapter
- Returns:
true
-
canProgram
public boolean canProgram()Applications might check this method and not attempt operation unless this method returnstrue
. To make sure that a wide variety of applications can use this class, this method always returnstrue
.- Overrides:
canProgram
in classDSPortAdapter
- Returns:
true
-
canDeliverPower
public boolean canDeliverPower()Applications might check this method and not attempt operation unless this method returnstrue
. To make sure that a wide variety of applications can use this class, this method always returnstrue
.- Overrides:
canDeliverPower
in classDSPortAdapter
- Returns:
true
-
canDeliverSmartPower
public boolean canDeliverSmartPower()Applications might check this method and not attempt operation unless this method returnstrue
. To make sure that a wide variety of applications can use this class, this method always returnstrue
.- Overrides:
canDeliverSmartPower
in classDSPortAdapter
- Returns:
true
-
canBreak
public boolean canBreak()Applications might check this method and not attempt operation unless this method returnstrue
. To make sure that a wide variety of applications can use this class, this method always returnstrue
.- Overrides:
canBreak
in classDSPortAdapter
- Returns:
true
-
getAllDeviceContainers
Returns an enumeration ofOneWireContainer
objects corresponding to all of the iButtons or 1-Wire devices found on the 1-Wire Network. In the case of theDumbAdapter
, this method returns a simple copy of the internaljava.util.Vector
that stores all the 1-Wire devices this class finds in a search.- Overrides:
getAllDeviceContainers
in classDSPortAdapter
- Returns:
Enumeration
ofOneWireContainer
objects found on the 1-Wire Network.
-
getFirstDeviceContainer
Returns aOneWireContainer
object corresponding to the first iButton or 1-Wire device found on the 1-Wire Network. If no devices are found, then anull
reference will be returned. In most cases, all further communication with the device is done through theOneWireContainer
.- Overrides:
getFirstDeviceContainer
in classDSPortAdapter
- Returns:
- The first
OneWireContainer
object found on the 1-Wire Network, ornull
if no devices found.
-
getNextDeviceContainer
Returns aOneWireContainer
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 anull
reference will be returned. In most cases, all further communication with the device is done through theOneWireContainer
.- Overrides:
getNextDeviceContainer
in classDSPortAdapter
- Returns:
- The next
OneWireContainer
object found on the 1-Wire Network, ornull
if no iButtons found.
-
findFirstDevice
public boolean findFirstDevice()Returnstrue
if the first iButton or 1-Wire device is found on the 1-Wire Network. If no devices are found, thenfalse
will be returned.- Specified by:
findFirstDevice
in classDSPortAdapter
- Returns:
true
if an iButton or 1-Wire device is found.
-
findNextDevice
public boolean findNextDevice()Returnstrue
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 thenfalse
will be returned.- Specified by:
findNextDevice
in classDSPortAdapter
- Returns:
true
if an iButton or 1-Wire device is found.
-
getAddress
public void getAddress(byte[] address) Copies the 'current' 1-Wire device address being used by the adapter into the array. This address is the last iButton or 1-Wire device found in a search (findNextDevice()...). This method copies into a user generated array to allow the reuse of the buffer. When searching many iButtons on the one wire network, this will reduce the memory burn rate.- Specified by:
getAddress
in classDSPortAdapter
- Parameters:
address
- An array to be filled with the current iButton address.- See Also:
-
getAddressAsLong
public long getAddressAsLong()Gets the 'current' 1-Wire device address being used by the adapter as a long. This address is the last iButton or 1-Wire device found in a search (findNextDevice()...).- Overrides:
getAddressAsLong
in classDSPortAdapter
- Returns:
long
representation of the iButton address- See Also:
-
getAddressAsString
Gets the 'current' 1-Wire device address being used by the adapter as a String. This address is the last iButton or 1-Wire device found in a search (findNextDevice()...).- Overrides:
getAddressAsString
in classDSPortAdapter
- Returns:
String
representation of the iButton address- See Also:
-
isPresent
public boolean isPresent(byte[] address) Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network. This does not affect the 'current' device state information used in searches (findNextDevice...).- Overrides:
isPresent
in classDSPortAdapter
- Parameters:
address
- device address to verify is present- Returns:
true
if device is present, elsefalse
.- See Also:
-
isPresent
public boolean isPresent(long address) Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network. This does not affect the 'current' device state information used in searches (findNextDevice...).- Overrides:
isPresent
in classDSPortAdapter
- Parameters:
address
- device address to verify is present- Returns:
true
if device is present, elsefalse
.- See Also:
-
isPresent
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network. This does not affect the 'current' device state information used in searches (findNextDevice...).- Overrides:
isPresent
in classDSPortAdapter
- Parameters:
address
- device address to verify is present- Returns:
true
if device is present, elsefalse
.- See Also:
-
isAlarming
public 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. This method is currently not implemented inDumbAdapter
.- Overrides:
isAlarming
in classDSPortAdapter
- Parameters:
address
- device address to verify is present and alarming- Returns:
false
- See Also:
-
isAlarming
public 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. This method is currently not implemented inDumbAdapter
.- Overrides:
isAlarming
in classDSPortAdapter
- Parameters:
address
- device address to verify is present and alarming- Returns:
false
- See Also:
-
isAlarming
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network and in an alarm state. This method is currently not implemented inDumbAdapter
.- Overrides:
isAlarming
in classDSPortAdapter
- Parameters:
address
- device address to verify is present and alarming- Returns:
false
- See Also:
-
select
public boolean select(byte[] address) Selects the specified iButton or 1-Wire device by broadcasting its address. With aDumbAdapter
, this method simply returns true. Warning, this does not verify that the device is currently present on the 1-Wire Network (See isPresent).- Overrides:
select
in classDSPortAdapter
- Parameters:
address
- address of iButton or 1-Wire device to select- Returns:
true
if device address was sent,false
otherwise.- See Also:
-
select
Selects the specified iButton or 1-Wire device by broadcasting its address. With aDumbAdapter
, this method simply returns true. Warning, this does not verify that the device is currently present on the 1-Wire Network (See isPresent).- Overrides:
select
in classDSPortAdapter
- Parameters:
address
- address of iButton or 1-Wire device to select- Returns:
true
if device address was sent,false
otherwise.- Throws:
OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapter- See Also:
-
select
Selects the specified iButton or 1-Wire device by broadcasting its address. With aDumbAdapter
, this method simply returns true. Warning, this does not verify that the device is currently present on the 1-Wire Network (See isPresent).- Overrides:
select
in classDSPortAdapter
- Parameters:
address
- address of iButton or 1-Wire device to select- Returns:
true
if device address was sent,false
otherwise.- Throws:
OneWireIOException
- on a 1-Wire communication errorOneWireException
- on a setup error with the 1-Wire adapter- See Also:
-
setSearchOnlyAlarmingDevices
public void setSearchOnlyAlarmingDevices()This method does nothing inDumbAdapter
.- Specified by:
setSearchOnlyAlarmingDevices
in classDSPortAdapter
- See Also:
-
setNoResetSearch
public void setNoResetSearch()This method does nothing inDumbAdapter
.- Specified by:
setNoResetSearch
in classDSPortAdapter
-
setSearchAllDevices
public void setSearchAllDevices()This method does nothing inDumbAdapter
.- Specified by:
setSearchAllDevices
in classDSPortAdapter
- See Also:
-
targetAllFamilies
public void targetAllFamilies()This method does nothing inDumbAdapter
.- Overrides:
targetAllFamilies
in classDSPortAdapter
- See Also:
-
targetFamily
public void targetFamily(int family) This method does nothing inDumbAdapter
.- Overrides:
targetFamily
in classDSPortAdapter
- Parameters:
family
- the code of the family type to target for searches- See Also:
-
targetFamily
public void targetFamily(byte[] family) This method does nothing inDumbAdapter
.- Overrides:
targetFamily
in classDSPortAdapter
- Parameters:
family
- array of the family types to target for searches- See Also:
-
excludeFamily
public void excludeFamily(int family) This method does nothing inDumbAdapter
.- Overrides:
excludeFamily
in classDSPortAdapter
- Parameters:
family
- the code of the family type NOT to target in searches- See Also:
-
excludeFamily
public void excludeFamily(byte[] family) This method does nothing inDumbAdapter
.- Overrides:
excludeFamily
in classDSPortAdapter
- Parameters:
family
- array of family cods NOT to target for searches- See Also:
-
beginExclusive
public boolean beginExclusive(boolean blocking) This method does nothing inDumbAdapter
.- Specified by:
beginExclusive
in classDSPortAdapter
- Parameters:
blocking
-true
if want to block waiting for exclusive access to the adapter- Returns:
true
-
endExclusive
public void endExclusive()This method does nothing inDumbAdapter
.- Specified by:
endExclusive
in classDSPortAdapter
-
putBit
public void putBit(boolean bitValue) Sends a bit to the 1-Wire Network. This method does nothing inDumbAdapter
.- Specified by:
putBit
in classDSPortAdapter
- Parameters:
bitValue
- the bit value to send to the 1-Wire Network.
-
getBit
public boolean getBit()Gets a bit from the 1-Wire Network. This method does nothing inDumbAdapter
.- Specified by:
getBit
in classDSPortAdapter
- Returns:
true
-
putByte
public void putByte(int byteValue) This method does nothing inDumbAdapter
.- Specified by:
putByte
in classDSPortAdapter
- Parameters:
byteValue
- the byte value to send to the 1-Wire Network.
-
getByte
public int getByte()This method does nothing inDumbAdapter
.- Specified by:
getByte
in classDSPortAdapter
- Returns:
- the value 0x0ff
-
getBlock
public byte[] getBlock(int len) This method does nothing inDumbAdapter
.- Specified by:
getBlock
in classDSPortAdapter
- Parameters:
len
- length of data bytes to receive- Returns:
- a new byte array of length
len
-
getBlock
public void getBlock(byte[] arr, int len) This method does nothing inDumbAdapter
.- Specified by:
getBlock
in classDSPortAdapter
- Parameters:
arr
- array in which to write the received byteslen
- length of data bytes to receive
-
getBlock
public void getBlock(byte[] arr, int off, int len) This method does nothing inDumbAdapter
.- Specified by:
getBlock
in classDSPortAdapter
- Parameters:
arr
- array in which to write the received bytesoff
- offset into the array to startlen
- length of data bytes to receive
-
dataBlock
public void dataBlock(byte[] dataBlock, int off, int len) This method does nothing inDumbAdapter
.- Specified by:
dataBlock
in classDSPortAdapter
- Parameters:
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'
-
reset
public int reset()Sends a Reset to the 1-Wire Network.- Specified by:
reset
in classDSPortAdapter
- Returns:
- the result of the reset. Potential results are:
- 0 (RESET_NOPRESENCE) no devices present on the 1-Wire Network.
- 1 (RESET_PRESENCE) normal presence pulse detected on the 1-Wire Network indicating there is a device present.
- 2 (RESET_ALARM) alarming presence pulse detected on the 1-Wire Network indicating there is a device present and it is in the alarm condition. This is only provided by the DS1994/DS2404 devices.
- 3 (RESET_SHORT) inticates 1-Wire appears shorted. This can be transient conditions in a 1-Wire Network. Not all adapter types can detect this condition.
DumbAdapter
, the only possible results are 0 and 1.
-
setPowerDuration
public void setPowerDuration(int timeFactor) This method does nothing inDumbAdapter
.- Overrides:
setPowerDuration
in classDSPortAdapter
- Parameters:
timeFactor
-- 0 (DELIVERY_HALF_SECOND) provide power for 1/2 second.
- 1 (DELIVERY_ONE_SECOND) provide power for 1 second.
- 2 (DELIVERY_TWO_SECONDS) provide power for 2 seconds.
- 3 (DELIVERY_FOUR_SECONDS) provide power for 4 seconds.
- 4 (DELIVERY_SMART_DONE) provide power until the the device is no longer drawing significant power.
- 5 (DELIVERY_INFINITE) provide power until the setPowerNormal() method is called.
-
startPowerDelivery
public boolean startPowerDelivery(int changeCondition) This method does nothing inDumbAdapter
.- Overrides:
startPowerDelivery
in classDSPortAdapter
- Parameters:
changeCondition
-- 0 (CONDITION_NOW) operation should occur immediately.
- 1 (CONDITION_AFTER_BIT) operation should be pending execution immediately after the next bit is sent.
- 2 (CONDITION_AFTER_BYTE) operation should be pending execution immediately after next byte is sent.
- Returns:
true
-
setProgramPulseDuration
public void setProgramPulseDuration(int timeFactor) This method does nothing inDumbAdapter
.- Overrides:
setProgramPulseDuration
in classDSPortAdapter
- Parameters:
timeFactor
-- 7 (DELIVERY_EPROM) provide program pulse for 480 microseconds
- 5 (DELIVERY_INFINITE) provide power until the setPowerNormal() method is called.
-
startProgramPulse
public boolean startProgramPulse(int changeCondition) This method does nothing inDumbAdapter
.- Overrides:
startProgramPulse
in classDSPortAdapter
- Parameters:
changeCondition
-- 0 (CONDITION_NOW) operation should occur immediately.
- 1 (CONDITION_AFTER_BIT) operation should be pending execution immediately after the next bit is sent.
- 2 (CONDITION_AFTER_BYTE) operation should be pending execution immediately after next byte is sent.
- Returns:
true
-
startBreak
public void startBreak()This method does nothing inDumbAdapter
.- Overrides:
startBreak
in classDSPortAdapter
-
setPowerNormal
public void setPowerNormal()This method does nothing inDumbAdapter
.- Overrides:
setPowerNormal
in classDSPortAdapter
-
setSpeed
public void setSpeed(int speed) This method does nothing inDumbAdapter
.- Overrides:
setSpeed
in classDSPortAdapter
- Parameters:
speed
-- 0 (SPEED_REGULAR) set to normal communication speed
- 1 (SPEED_FLEX) set to flexible communication speed used for long lines
- 2 (SPEED_OVERDRIVE) set to normal communication speed to overdrive
- 3 (SPEED_HYPERDRIVE) set to normal communication speed to hyperdrive
- >3 future speeds
-
getSpeed
public int getSpeed()This method does nothing inDumbAdapter
.- Overrides:
getSpeed
in classDSPortAdapter
- Returns:
- <the last value passed to the
setSpeed(int)
method, or 0
-
getDeviceContainer
Gets the container from this adapter whose address matches the address of a container in theDumbAdapter
's internaljava.util.Vector
.- Overrides:
getDeviceContainer
in classDSPortAdapter
- Parameters:
address
- device address with which to find a container- Returns:
- The
OneWireContainer
object, ornull
if no match could be found. - See Also:
-
getDeviceContainer
Gets the container from this adapter whose address matches the address of a container in theDumbAdapter
's internaljava.util.Vector
.- Overrides:
getDeviceContainer
in classDSPortAdapter
- Parameters:
address
- device address with which to find a container- Returns:
- The
OneWireContainer
object, ornull
if no match could be found. - See Also:
-
getDeviceContainer
Gets the container from this adapter whose address matches the address of a container in theDumbAdapter
's internaljava.util.Vector
.- Overrides:
getDeviceContainer
in classDSPortAdapter
- Parameters:
address
- device address with which to find a container- Returns:
- The
OneWireContainer
object, ornull
if no match could be found. - See Also:
-
getDeviceContainer
Returns aOneWireContainer
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.- Overrides:
getDeviceContainer
in classDSPortAdapter
- Returns:
- the
OneWireContainer
object
-
isValidFamily
protected boolean isValidFamily(byte[] address) Checks to see if the family found is in the desired include group.- Overrides:
isValidFamily
in classDSPortAdapter
- Returns:
true
if in include group
-