Dallas Semiconductor 1-Wire API 1.00 Alpha: Class DumbAdapter

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.dalsemi.onewire.adapter
Class DumbAdapter

    java.lang.Object
      |
      +--com.dalsemi.onewire.adapter.DSPortAdapter
            |
            +--com.dalsemi.onewire.adapter.DumbAdapter

public class DumbAdapter
extends DSPortAdapter

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.

Version:
  0.00, 16 Mar 2001
See Also:
  `DSPortAdapter`, `OneWireContainer`

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
`DumbAdapter()`

Method Summary
`boolean` | `adapterDetected()` Detects adapter presence on the selected port.
`void` | `addContainer(OneWireContainer c)` Adds a `OneWireContainer` to the list of containers that this adapter object will find.
`boolean` | `beginExclusive(boolean blocking)` This method does nothing in `DumbAdapter`.
`boolean` | `canBreak()` Applications might check this method and not attempt operation unless this method returns `true`.
`boolean` | `canDeliverPower()` Applications might check this method and not attempt operation unless this method returns `true`.
`boolean` | `canDeliverSmartPower()` Applications might check this method and not attempt operation unless this method returns `true`.
`boolean` | `canFlex()` Applications might check this method and not attempt operation unless this method returns `true`.
`boolean` | `canHyperdrive()` Applications might check this method and not attempt operation unless this method returns `true`.
`boolean` | `canOverdrive()` Applications might check this method and not attempt operation unless this method returns `true`.
`boolean` | `canProgram()` Applications might check this method and not attempt operation unless this method returns `true`.
`void` | `dataBlock(byte[] dataBlock, int off, int len)` This method does nothing in `DumbAdapter`.
`void` | `endExclusive()` This method does nothing in `DumbAdapter`.
`void` | `excludeFamily(byte[] family)` This method does nothing in `DumbAdapter`.
`void` | `excludeFamily(int family)` This method does nothing in `DumbAdapter`.
`boolean` | `findFirstDevice()` Returns `true` if the first iButton or 1-Wire device is found on the 1-Wire Network.
`boolean` | `findNextDevice()` Returns `true` if the next iButton or 1-Wire device is found.
`void` | `freePort()` This method does nothing in `DumbAdapter`.
`String` | `getAdapterName()` 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` | `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.
`boolean` | `getBit()` Gets a bit from the 1-Wire Network.
`void` | `getBlock(byte[] arr, int len)` This method does nothing in `DumbAdapter`.
`void` | `getBlock(byte[] arr, int off, int len)` This method does nothing in `DumbAdapter`.
`byte[]` | `getBlock(int len)` This method does nothing in `DumbAdapter`.
`int` | `getByte()` This method does nothing in `DumbAdapter`.
`String` | `getClassVersion()` Retrieves a version string for this class.
`OneWireContainer` | `getDeviceContainer()` Returns a `OneWireContainer` object using the current 1-Wire network address.
`OneWireContainer` | `getDeviceContainer(byte[] address)` Gets the container from this adapter whose address matches the address of a container in the `DumbAdapter`'s internal `java.util.Vector`.
`OneWireContainer` | `getDeviceContainer(long address)` Gets the container from this adapter whose address matches the address of a container in the `DumbAdapter`'s internal `java.util.Vector`.
`OneWireContainer` | `getDeviceContainer(String address)` Gets the container from this adapter whose address matches the address of a container in the `DumbAdapter`'s internal `java.util.Vector`.
`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.
`String` | `getPortName()` Retrieves the name of the selected port as a `String`.
`Enumeration` | `getPortNames()` Retrieves a list of the platform appropriate port names for this adapter.
`String` | `getPortTypeDescription()` Retrieves a description of the port required by this port adapter.
`int` | `getSpeed()` This method does nothing in `DumbAdapter`.
`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.
`void` | `putBit(boolean bitValue)` Sends a bit to the 1-Wire Network.
`void` | `putByte(int byteValue)` This method does nothing in `DumbAdapter`.
`void` | `registerOneWireContainerClass(int family, Class OneWireContainerClass)` This method does nothing in `DumbAdapter`.
`void` | `removeContainer(OneWireContainer c)` Removes a `OneWireContainer` 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` | `select(String address)` Selects the specified iButton or 1-Wire device by broadcasting its address.
`boolean` | `selectPort(String portName)` This method does nothing in `DumbAdapter`.
`void` | `setNoResetSearch()` This method does nothing in `DumbAdapter`.
`void` | `setPowerDuration(int timeFactor)` This method does nothing in `DumbAdapter`.
`void` | `setPowerNormal()` This method does nothing in `DumbAdapter`.
`void` | `setProgramPulseDuration(int timeFactor)` This method does nothing in `DumbAdapter`.
`void` | `setSearchAllDevices()` This method does nothing in `DumbAdapter`.
`void` | `setSearchOnlyAlarmingDevices()` This method does nothing in `DumbAdapter`.
`void` | `setSpeed(int speed)` This method does nothing in `DumbAdapter`.
`void` | `startBreak()` This method does nothing in `DumbAdapter`.
`boolean` | `startPowerDelivery(int changeCondition)` This method does nothing in `DumbAdapter`.
`boolean` | `startProgramPulse(int changeCondition)` This method does nothing in `DumbAdapter`.
`void` | `targetAllFamilies()` This method does nothing in `DumbAdapter`.
`void` | `targetFamily(byte[] family)` This method does nothing in `DumbAdapter`.
`void` | `targetFamily(int family)` This method does nothing in `DumbAdapter`.

Methods inherited from class com.dalsemi.onewire.adapter.DSPortAdapter
`getAdapterAddress, getAdapterVersion`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DumbAdapter

    public DumbAdapter()

Method Detail

### addContainer

    public void addContainer(OneWireContainer c)

  Adds a `OneWireContainer` 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

    public void removeContainer(OneWireContainer c)

  Removes a `OneWireContainer` 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

    public String 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'.
  Overrides:
    `getAdapterName` in class `DSPortAdapter`
  Returns:
    `String` representation of the port adapter.

### getPortTypeDescription

    public String getPortTypeDescription()

  Retrieves a description of the port required by this port adapter. An example of a 'Port' would 'serial communication port'.
  Overrides:
    `getPortTypeDescription` in class `DSPortAdapter`
  Returns:
    `String` description of the port type required.

### getClassVersion

    public String getClassVersion()

  Retrieves a version string for this class.
  Overrides:
    `getClassVersion` in class `DSPortAdapter`
  Returns:
    version string

### getPortNames

    public Enumeration 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 communcation method before 'selectPort' will result in a `OneWireException` exception.
  Overrides:
    `getPortNames` in class `DSPortAdapter`
  Returns:
    `Enumeration` of type `String` that contains the port names

### registerOneWireContainerClass

    public void registerOneWireContainerClass(int family,
                                              Class OneWireContainerClass)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `registerOneWireContainerClass` in class `DSPortAdapter`
  Following copied from class: `com.dalsemi.onewire.adapter.DSPortAdapter`
  Parameters:
    `family` - the code of the family type to associate with this class.
    `OneWireContainerClass` - User provided class
  Throws:
    `OneWireException` - If `OneWireContainerClass` is not found.
    `ClassCastException` - If user supplied `OneWireContainer` does not extend `com.dalsemi.onewire.container.OneWireContainer`.

### selectPort

    public boolean selectPort(String portName)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `selectPort` in class `DSPortAdapter`
  Parameters:
    `portName` - name of the target port, retrieved from getPortNames()
  Returns:
    always returns `true`

### freePort

    public void freePort()

  This method does nothing in `DumbAdapter`.
  Overrides:
    `freePort` in class `DSPortAdapter`
  Following copied from class: `com.dalsemi.onewire.adapter.DSPortAdapter`
  Throws:
    `OneWireException` - If port does not exist

### getPortName

    public String getPortName()

  Retrieves the name of the selected port as a `String`.
  Overrides:
    `getPortName` in class `DSPortAdapter`
  Returns:
    always returns the `String` "NULL0"

### adapterDetected

    public boolean adapterDetected()

  Detects adapter presence on the selected port. In `DumbAdapter`, the adapter is always detected.
  Overrides:
    `adapterDetected` in class `DSPortAdapter`
  Returns:
    `true`

### canOverdrive

    public boolean canOverdrive()

  Applications might check this method and not attempt operation unless this method returns `true`. To make sure that a wide variety of applications can use this class, this method always returns `true`.
  Overrides:
    `canOverdrive` in class `DSPortAdapter`
  Returns:
    `true`

### canHyperdrive

    public boolean canHyperdrive()

  Applications might check this method and not attempt operation unless this method returns `true`. To make sure that a wide variety of applications can use this class, this method always returns `true`.
  Overrides:
    `canHyperdrive` in class `DSPortAdapter`
  Returns:
    `true`

### canFlex

    public boolean canFlex()

  Applications might check this method and not attempt operation unless this method returns `true`. To make sure that a wide variety of applications can use this class, this method always returns `true`.
  Overrides:
    `canFlex` in class `DSPortAdapter`
  Returns:
    `true`

### canProgram

    public boolean canProgram()

  Applications might check this method and not attempt operation unless this method returns `true`. To make sure that a wide variety of applications can use this class, this method always returns `true`.
  Overrides:
    `canProgram` in class `DSPortAdapter`
  Returns:
    `true`

### canDeliverPower

    public boolean canDeliverPower()

  Applications might check this method and not attempt operation unless this method returns `true`. To make sure that a wide variety of applications can use this class, this method always returns `true`.
  Overrides:
    `canDeliverPower` in class `DSPortAdapter`
  Returns:
    `true`

### canDeliverSmartPower

    public boolean canDeliverSmartPower()

  Applications might check this method and not attempt operation unless this method returns `true`. To make sure that a wide variety of applications can use this class, this method always returns `true`.
  Overrides:
    `canDeliverSmartPower` in class `DSPortAdapter`
  Returns:
    `true`

### canBreak

    public boolean canBreak()

  Applications might check this method and not attempt operation unless this method returns `true`. To make sure that a wide variety of applications can use this class, this method always returns `true`.
  Overrides:
    `canBreak` in class `DSPortAdapter`
  Returns:
    `true`

### getAllDeviceContainers

    public Enumeration getAllDeviceContainers()

  Returns an enumeration of `OneWireContainer` objects corresponding to all of the iButtons or 1-Wire devices found on the 1-Wire Network. In the case of the `DumbAdapter`, this method returns a simple copy of the internal `java.util.Vector` that stores all the 1-Wire devices this class finds in a search.
  Overrides:
    `getAllDeviceContainers` in class `DSPortAdapter`
  Returns:
    `Enumeration` of `OneWireContainer` objects found on the 1-Wire Network.

### getFirstDeviceContainer

    public OneWireContainer getFirstDeviceContainer()

  Returns a `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`.
  Overrides:
    `getFirstDeviceContainer` in class `DSPortAdapter`
  Returns:
    The first `OneWireContainer` object found on the 1-Wire Network, or `null` if no devices found.

### getNextDeviceContainer

    public OneWireContainer getNextDeviceContainer()

  Returns a `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`.
  Overrides:
    `getNextDeviceContainer` in class `DSPortAdapter`
  Returns:
    The next `OneWireContainer` object found on the 1-Wire Network, or `null` if no iButtons found.

### findFirstDevice

    public boolean findFirstDevice()

  Returns `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.
  Overrides:
    `findFirstDevice` in class `DSPortAdapter`
  Returns:
    `true` if an iButton or 1-Wire device is found.

### findNextDevice

    public boolean findNextDevice()

  Returns `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.
  Overrides:
    `findNextDevice` in class `DSPortAdapter`
  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.
  Overrides:
    `getAddress` in class `DSPortAdapter`
  Parameters:
    `address` - An array to be filled with the current iButton address.
  See Also:
    `Address`

### 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 class `DSPortAdapter`
  Returns:
    `long` representation of the iButton address
  See Also:
    `Address`

### getAddressAsString

    public String 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 class `DSPortAdapter`
  Returns:
    `String` representation of the iButton address
  See Also:
    `Address`

### 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 class `DSPortAdapter`
  Parameters:
    `address` - device address to verify is present
  Returns:
    `true` if device is present, else `false`.
  See Also:
    `Address`

### 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 class `DSPortAdapter`
  Parameters:
    `address` - device address to verify is present
  Returns:
    `true` if device is present, else `false`.
  See Also:
    `Address`

### isPresent

    public boolean isPresent(String 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 class `DSPortAdapter`
  Parameters:
    `address` - device address to verify is present
  Returns:
    `true` if device is present, else `false`.
  See Also:
    `Address`

### 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 in `DumbAdapter`.
  Overrides:
    `isAlarming` in class `DSPortAdapter`
  Parameters:
    `address` - device address to verify is present and alarming
  Returns:
    `false`
  See Also:
    `Address`

### 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 in `DumbAdapter`.
  Overrides:
    `isAlarming` in class `DSPortAdapter`
  Parameters:
    `address` - device address to verify is present and alarming
  Returns:
    `false`
  See Also:
    `Address`

### isAlarming

    public 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. This method is currently not implemented in `DumbAdapter`.
  Overrides:
    `isAlarming` in class `DSPortAdapter`
  Parameters:
    `address` - device address to verify is present and alarming
  Returns:
    `false`
  See Also:
    `Address`

### select

    public boolean select(byte[] address)

  Selects the specified iButton or 1-Wire device by broadcasting its address. With a `DumbAdapter`, 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 class `DSPortAdapter`
  Parameters:
    `address` - address of iButton or 1-Wire device to select
  Returns:
    `true` if device address was sent, `false` otherwise.
  See Also:
    `isPresent(byte[])`, `Address`

### select

    public boolean select(long address)
                   throws OneWireIOException,
                          OneWireException

  Selects the specified iButton or 1-Wire device by broadcasting its address. With a `DumbAdapter`, 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 class `DSPortAdapter`
  Parameters:
    `address` - address of iButton or 1-Wire device to select
  Returns:
    `true` if device address was sent, `false` otherwise.
  See Also:
    `isPresent(byte[])`, `Address`

### select

    public boolean select(String address)
                   throws OneWireIOException,
                          OneWireException

  Selects the specified iButton or 1-Wire device by broadcasting its address. With a `DumbAdapter`, 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 class `DSPortAdapter`
  Parameters:
    `address` - address of iButton or 1-Wire device to select
  Returns:
    `true` if device address was sent, `false` otherwise.
  See Also:
    `isPresent(byte[])`, `Address`

### setSearchOnlyAlarmingDevices

    public void setSearchOnlyAlarmingDevices()

  This method does nothing in `DumbAdapter`.
  Overrides:
    `setSearchOnlyAlarmingDevices` in class `DSPortAdapter`
  See Also:
    `setNoResetSearch()`

### setNoResetSearch

    public void setNoResetSearch()

  This method does nothing in `DumbAdapter`.
  Overrides:
    `setNoResetSearch` in class `DSPortAdapter`

### setSearchAllDevices

    public void setSearchAllDevices()

  This method does nothing in `DumbAdapter`.
  Overrides:
    `setSearchAllDevices` in class `DSPortAdapter`
  See Also:
    `setNoResetSearch()`

### targetAllFamilies

    public void targetAllFamilies()

  This method does nothing in `DumbAdapter`.
  Overrides:
    `targetAllFamilies` in class `DSPortAdapter`
  See Also:
    `targetFamily(int)`, `targetFamily(byte[])`, `excludeFamily(int)`, `excludeFamily(byte[])`

### targetFamily

    public void targetFamily(int family)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `targetFamily` in class `DSPortAdapter`
  Parameters:
    `family` - the code of the family type to target for searches
  See Also:
    `Address`, `targetAllFamilies()`

### targetFamily

    public void targetFamily(byte[] family)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `targetFamily` in class `DSPortAdapter`
  Parameters:
    `family` - array of the family types to target for searches
  See Also:
    `Address`, `targetAllFamilies()`

### excludeFamily

    public void excludeFamily(int family)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `excludeFamily` in class `DSPortAdapter`
  Parameters:
    `family` - the code of the family type NOT to target in searches
  See Also:
    `Address`, `targetAllFamilies()`

### excludeFamily

    public void excludeFamily(byte[] family)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `excludeFamily` in class `DSPortAdapter`
  Parameters:
    `family` - array of family cods NOT to target for searches
  See Also:
    `Address`, `targetAllFamilies()`

### beginExclusive

    public boolean beginExclusive(boolean blocking)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `beginExclusive` in class `DSPortAdapter`
  Parameters:
    `blocking` - `true` if want to block waiting for an excluse access to the adapter
  Returns:
    `true`

### endExclusive

    public void endExclusive()

  This method does nothing in `DumbAdapter`.
  Overrides:
    `endExclusive` in class `DSPortAdapter`

### putBit

    public void putBit(boolean bitValue)

  Sends a bit to the 1-Wire Network. This method does nothing in `DumbAdapter`.
  Overrides:
    `putBit` in class `DSPortAdapter`
  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 in `DumbAdapter`.
  Overrides:
    `getBit` in class `DSPortAdapter`
  Returns:
    `true`

### putByte

    public void putByte(int byteValue)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `putByte` in class `DSPortAdapter`
  Parameters:
    `byteValue` - the byte value to send to the 1-Wire Network.

### getByte

    public int getByte()

  This method does nothing in `DumbAdapter`.
  Overrides:
    `getByte` in class `DSPortAdapter`
  Returns:
    the value 0x0ff

### getBlock

    public byte[] getBlock(int len)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `getBlock` in class `DSPortAdapter`
  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 in `DumbAdapter`.
  Overrides:
    `getBlock` in class `DSPortAdapter`
  Parameters:
    `arr` - array in which to write the received bytes
    `len` - length of data bytes to receive

### getBlock

    public void getBlock(byte[] arr,
                         int off,
                         int len)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `getBlock` in class `DSPortAdapter`
  Parameters:
    `arr` - array in which to write the received bytes
    `off` - offset into the array to start
    `len` - length of data bytes to receive

### dataBlock

    public void dataBlock(byte[] dataBlock,
                          int off,
                          int len)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `dataBlock` in class `DSPortAdapter`
  Parameters:
    `dataBlock` - array of data to transfer to and from the 1-Wire Network.
    `off` - offset into the array of data to start
    `len` - length of data to send / receive starting at 'off'

### reset

    public int reset()

  Sends a Reset to the 1-Wire Network.
  Overrides:
    `reset` in class `DSPortAdapter`
  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.
    Note that in `DumbAdapter`, the only possible results are 0 and 1.

### setPowerDuration

    public void setPowerDuration(int timeFactor)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `setPowerDuration` in class `DSPortAdapter`
  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 in `DumbAdapter`.
  Overrides:
    `startPowerDelivery` in class `DSPortAdapter`
  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 in `DumbAdapter`.
  Overrides:
    `setProgramPulseDuration` in class `DSPortAdapter`
  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 in `DumbAdapter`.
  Overrides:
    `startProgramPulse` in class `DSPortAdapter`
  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 in `DumbAdapter`.
  Overrides:
    `startBreak` in class `DSPortAdapter`
  Following copied from class: `com.dalsemi.onewire.adapter.DSPortAdapter`
  Throws:
    `OneWireIOException` - on a 1-Wire communication error
    `OneWireException` - on a setup error with the 1-Wire adapter or the adapter does not support this operation

### setPowerNormal

    public void setPowerNormal()

  This method does nothing in `DumbAdapter`.
  Overrides:
    `setPowerNormal` in class `DSPortAdapter`
  Following copied from class: `com.dalsemi.onewire.adapter.DSPortAdapter`
  Throws:
    `OneWireIOException` - on a 1-Wire communication error
    `OneWireException` - on a setup error with the 1-Wire adapter or the adapter does not support this operation

### setSpeed

    public void setSpeed(int speed)

  This method does nothing in `DumbAdapter`.
  Overrides:
    `setSpeed` in class `DSPortAdapter`
  Parameters:
    `speed` -
    - 0 (SPEED_REGULAR) set to normal communciation speed
    - 1 (SPEED_FLEX) set to flexible communciation speed used for long lines
    - 2 (SPEED_OVERDRIVE) set to normal communciation speed to overdrive
    - 3 (SPEED_HYPERDRIVE) set to normal communciation speed to hyperdrive
    - >3 future speeds

### getSpeed

    public int getSpeed()

  This method does nothing in `DumbAdapter`.
  Overrides:
    `getSpeed` in class `DSPortAdapter`
  Returns:
    setSpeed(int) method, or 0

### getDeviceContainer

    public OneWireContainer getDeviceContainer(byte[] address)

  Gets the container from this adapter whose address matches the address of a container in the `DumbAdapter`'s internal `java.util.Vector`.
  Overrides:
    `getDeviceContainer` in class `DSPortAdapter`
  Parameters:
    `address` - device address with which to find a container
  Returns:
    The `OneWireContainer` object, or `null` if no match could be found.
  See Also:
    `Address`

### getDeviceContainer

    public OneWireContainer getDeviceContainer(long address)

  Gets the container from this adapter whose address matches the address of a container in the `DumbAdapter`'s internal `java.util.Vector`.
  Overrides:
    `getDeviceContainer` in class `DSPortAdapter`
  Parameters:
    `address` - device address with which to find a container
  Returns:
    The `OneWireContainer` object, or `null` if no match could be found.
  See Also:
    `Address`

### getDeviceContainer

    public OneWireContainer getDeviceContainer(String address)

  Gets the container from this adapter whose address matches the address of a container in the `DumbAdapter`'s internal `java.util.Vector`.
  Overrides:
    `getDeviceContainer` in class `DSPortAdapter`
  Parameters:
    `address` - device address with which to find a container
  Returns:
    The `OneWireContainer` object, or `null` if no match could be found.
  See Also:
    `Address`

### getDeviceContainer

    public OneWireContainer getDeviceContainer()

  Returns a `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.
  Overrides:
    `getDeviceContainer` in class `DSPortAdapter`
  Returns:
    the `OneWireContainer` object

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD