com.dalsemi.onewire.adapter
Class TINIExternalAdapter

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

public class TINIExternalAdapter
extends com.dalsemi.onewire.adapter.TINIAdapter

Port adapter for the TINI external one wire bus.


Fields inherited from class com.dalsemi.onewire.adapter.TINIAdapter
classVersion, OW_EXTERNAL, OW_INTERNAL, OWDISPATCH_CANCELSTRONGPU, OWDISPATCH_CANPROGRAM, OWDISPATCH_DOPROGRAMPULSE, OWDISPATCH_GETSPEED, OWDISPATCH_GETVERSION, OWDISPATCH_ISPRESENT, OWDISPATCH_SETSPEED, portSelected, portType
 
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
TINIExternalAdapter()
          Constructor TINIExternalAdapter
 
Method Summary
 boolean canDeliverPower()
          Returns whether the adapter can physically support 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.
 String getAdapterName()
          Retrieve the name of the port adapter as a string.
 String getClassVersion()
          Retrieve a version string for this class
 String getPortName()
          Retrieve the name of the selected port as a String.
 Enumeration getPortNames()
          Retrieve a list of the platform appropriate port names for this adapter.
 String getPortTypeDescription()
          Retrieve a description of the port required by this port adapter.
 boolean selectPort(String portName)
          Specify a platform appropriate port name for this adapter.
 void setProgramPulseDuration(int timeFactor)
          Sets the duration for providing a program pulse on the 1-Wire Network.
 boolean startProgramPulse(int changeCondition)
          Sets the 1-Wire Network voltage to eprom programming level.
 
Methods inherited from class com.dalsemi.onewire.adapter.TINIAdapter
adapterDetected, beginExclusive, canProgram, dataBlock, endExclusive, findFirstDevice, findNextDevice, freePort, getAdapterVersion, getAddress, getBit, getBlock, getBlock, getBlock, getByte, getSpeed, isAlarming, isPresent, OWDispatchNative, putBit, putByte, reset, select, setNoResetSearch, setPowerDuration, setPowerNormal, setSearchAllDevices, setSearchOnlyAlarmingDevices, setSpeed, startPowerDelivery
 
Methods inherited from class com.dalsemi.onewire.adapter.DSPortAdapter
canBreak, canDeliverSmartPower, excludeFamily, excludeFamily, getAdapterAddress, getAddressAsLong, getAddressAsString, getAllDeviceContainers, getDeviceContainer, getDeviceContainer, getDeviceContainer, getDeviceContainer, getFirstDeviceContainer, getNextDeviceContainer, isAlarming, isAlarming, isPresent, isPresent, isValidFamily, registerOneWireContainerClass, select, select, startBreak, targetAllFamilies, targetFamily, targetFamily
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TINIExternalAdapter

public TINIExternalAdapter()
Constructor TINIExternalAdapter
Method Detail

getAdapterName

public String getAdapterName()
Retrieve 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()
Retrieve 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()
Retrieve a version string for this class
Overrides:
getClassVersion in class DSPortAdapter
Returns:
version string

getPortNames

public Enumeration getPortNames()
Retrieve 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

selectPort

public boolean selectPort(String portName)
                   throws OneWireIOException,
                          OneWireException
Specify a platform appropriate port name for this adapter. Note that even though the port has been selected, it's ownership may be relinquished if it is not currently held in a 'exclusive' block. This class will then try to re-aquire the port when needed. If the port cannot be re-aquired ehen the exception PortInUseException will be thrown.
Overrides:
selectPort in class DSPortAdapter
Parameters:
portName - name of the target port, retrieved from getPortNames()
Returns:
true if the port was aquired, false if the port is not available.
Throws:
OneWireIOException -  
OneWireException -  

getPortName

public String getPortName()
                   throws OneWireException
Retrieve the name of the selected port as a String.
Overrides:
getPortName in class DSPortAdapter
Returns:
String of selected port
Throws:
OneWireException -  

canOverdrive

public boolean canOverdrive()
                     throws OneWireIOException,
                            OneWireException
Returns whether adapter can physically support overdrive mode.
Overrides:
canOverdrive in class DSPortAdapter
Returns:
true if this port adapter can do OverDrive, false otherwise.
Throws:
OneWireIOException -  
OneWireException -  

canHyperdrive

public boolean canHyperdrive()
                      throws OneWireIOException,
                             OneWireException
Returns whether the adapter can physically support hyperdrive mode.
Overrides:
canHyperdrive in class DSPortAdapter
Returns:
true if this port adapter can do HyperDrive, false otherwise.
Throws:
OneWireIOException -  
OneWireException -  

canFlex

public boolean canFlex()
                throws OneWireIOException,
                       OneWireException
Returns whether the adapter can physically support flex speed mode.
Overrides:
canFlex in class DSPortAdapter
Returns:
true if this port adapter can do flex speed, false otherwise.
Throws:
OneWireIOException -  
OneWireException -  

canDeliverPower

public boolean canDeliverPower()
                        throws OneWireIOException,
                               OneWireException
Returns whether the adapter can physically support strong 5 volt power mode.
Overrides:
canDeliverPower in class DSPortAdapter
Returns:
true if this port adapter can do strong 5 volt mode, false otherwise.
Throws:
OneWireIOException -  
OneWireException -  

setProgramPulseDuration

public void setProgramPulseDuration(int timeFactor)
                             throws OneWireIOException,
                                    OneWireException
Sets the duration for providing a program pulse on the 1-Wire Network. This method takes a time parameter that indicates the program pulse length when the method startProgramPulse().

Note: to avoid getting an exception, use the canDeliverPower() method to check it's availability.

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.
Throws:
OneWireIOException -  
OneWireException -  

startProgramPulse

public boolean startProgramPulse(int changeCondition)
                          throws OneWireIOException,
                                 OneWireException
Sets the 1-Wire Network voltage to eprom programming level. This method takes a time parameter that indicates whether the power delivery should be done immediately, or after certain conditions have been met.

Note: to avoid getting an exception, use the canProgram() method to check it's availability.

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 if the voltage change was successful, false otherwise.
Throws:
OneWireIOException -  
OneWireException -