com.ibutton.tmex.container
Class iButtonContainer12

java.lang.Object
  |
  +--com.ibutton.tmex.container.iButtonContainerGeneral
        |
        +--com.ibutton.tmex.container.iButtonContainer12

public class iButtonContainer12
extends iButtonContainerGeneral
implements iButtonContainer

iButton container for iButton family type 12 (hex). This family type is a 'dual addressible switch' iButton (DS2407). It contains 2 addressible switches and or sensors.

//\\//\\//\\// Does not yet support memory operations \\//\\//\\//


Fields inherited from class com.ibutton.tmex.container.iButtonContainerGeneral
adapter, ID
 
Constructor Summary
iButtonContainer12()
          Constructs a General purpose iButton container class.
 
Method Summary
 java.lang.String getAlternateNames()
          Retrieve the alternate Dallas Semiconductor part numbers or names.
 boolean getChannelAActivity()
          Read the activity latch of the A channel PIO switch.
 boolean getChannelALevel()
          Read the sensed level on the A channel of this device.
 boolean getChannelAState()
          Read the state of the A channel PIO switch.
 boolean getChannelBActivity()
          Read the activity latch of the B channel PIO switch.
 boolean getChannelBLevel()
          Read the sensed level on the B channel of this device.
 boolean getChannelBState()
          Read the state of the B channel PIO switch.
 java.lang.String getDescription()
          Retrieve a short description of the function of the iButton type.
 java.lang.String getiButtonPartName()
          Retrieve the Dallas Semiconductor part number of the iButton as a string.
 int getNumberOfChannels()
          Read the number of channels on this 1-Wire switch.
 boolean isPowerSupplied()
          Read the devices is getting supplied with power.
 int readSwitchState(boolean clearActivity)
          Set the switch state for a dual switch.
 void setSwitchState(boolean channelAState)
          Set the switch state for a single switch.
 void setSwitchState(boolean channelAState, boolean channelBState)
          Set the switch state for a dual switch.
 
Methods inherited from class com.ibutton.tmex.container.iButtonContainerGeneral
dataBlock, getBit, getBlock, getByte, getID, getIDString, isAlarming, isPresent, putBit, putByte, reset, select, setupContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

iButtonContainer12

public iButtonContainer12()
Constructs a General purpose iButton container class. This constructor does not contain a source adapter. The method setSourceAdapter must be called right after before this container can be used.
Method Detail

getiButtonPartName

public java.lang.String getiButtonPartName()
Retrieve the Dallas Semiconductor part number of the iButton as a string. For example 'DS1992'.
Specified by:
getiButtonPartName in interface iButtonContainer
Returns:
string represetation of the iButton name.
Overrides:
getiButtonPartName in class iButtonContainerGeneral

getAlternateNames

public java.lang.String getAlternateNames()
Retrieve the alternate Dallas Semiconductor part numbers or names. A 'family' of MicroLAN devices may have more than one part number depending on packaging. There can also be nicknames such as 'Crypto iButton'.
Specified by:
getAlternateNames in interface iButtonContainer
Returns:
string represetation of the alternate names.
Overrides:
getAlternateNames in class iButtonContainerGeneral

getDescription

public java.lang.String getDescription()
Retrieve a short description of the function of the iButton type.
Specified by:
getDescription in interface iButtonContainer
Returns:
string represetation of the function description.
Overrides:
getDescription in class iButtonContainerGeneral

setSwitchState

public void setSwitchState(boolean channelAState)
                    throws PortNotSelectedException,
                           PortInUseException,
                           AdapterNotDetectedException,
                           MicroLanIOException,
                           HardwareOptionNotAvailException
Set the switch state for a single switch. A 'TRUE' state is where the PIO pin is conductive to ground and a 'FALSE' state is where the PIO is floating.
Throws:
PortNotSelectedException -  
PortInUseException -  
AdapterNotDetectedException -  
MicroLanIOException -  

setSwitchState

public void setSwitchState(boolean channelAState,
                           boolean channelBState)
                    throws PortNotSelectedException,
                           PortInUseException,
                           AdapterNotDetectedException,
                           MicroLanIOException,
                           HardwareOptionNotAvailException
Set the switch state for a dual switch. A 'TRUE' state is where the PIO pin is conductive to ground and a 'FALSE' state is where the PIO is floating.
Throws:
PortNotSelectedException -  
PortInUseException -  
AdapterNotDetectedException -  
MicroLanIOException -  

readSwitchState

public int readSwitchState(boolean clearActivity)
                    throws PortNotSelectedException,
                           PortInUseException,
                           AdapterNotDetectedException,
                           MicroLanIOException,
                           HardwareOptionNotAvailException
Set the switch state for a dual switch. A 'TRUE' state is where the PIO pin is conductive to ground and a 'FALSE' state is where the PIO is floating.
Throws:
PortNotSelectedException -  
PortInUseException -  
AdapterNotDetectedException -  
MicroLanIOException -  

getNumberOfChannels

public int getNumberOfChannels()
Read the number of channels on this 1-Wire switch. The method readSwitchState MUST be called before this method to get a current reading of this information.
Returns:
number of channels ,1 (Channel A only) or 2 (Channel A and B).

getChannelAState

public boolean getChannelAState()
Read the state of the A channel PIO switch. The method readSwitchState MUST be called before this method to get a current reading of this information.
Returns:
'true' if PIO channel A is tied to ground and 'false' if not.

getChannelBState

public boolean getChannelBState()
Read the state of the B channel PIO switch. The method readSwitchState MUST be called before this method to get a current reading of this information.
Returns:
'true' if PIO channel B is tied to ground and 'false' if not.

getChannelAActivity

public boolean getChannelAActivity()
Read the activity latch of the A channel PIO switch. The method readSwitchState MUST be called before this method to get a current reading of this information.
Returns:
'true' if actvitiy detected on channel A and 'false' if not.

getChannelBActivity

public boolean getChannelBActivity()
Read the activity latch of the B channel PIO switch. The method readSwitchState MUST be called before this method to get a current reading of this information.
Returns:
'true' if actvitiy detected on channel B and 'false' if not.

getChannelALevel

public boolean getChannelALevel()
Read the sensed level on the A channel of this device. The method readSwitchState MUST be called before this method to get a current reading of this information.
Returns:
'true' if the sensed level channel A is 'high' and 'false' if the sensed level is 'low'.

getChannelBLevel

public boolean getChannelBLevel()
Read the sensed level on the B channel of this device. The method readSwitchState MUST be called before this method to get a current reading of this information.
Returns:
'true' if the sensed level channel B is 'high' and 'false' if the sensed level is 'low'.

isPowerSupplied

public boolean isPowerSupplied()
Read the devices is getting supplied with power. The method readSwitchState MUST be called before this method to get a current reading of this information.
Returns:
'true' if the device is getting supplied with power and 'false' if the device is parasite powered.