|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.onewire.container.OneWireContainer | +--com.dalsemi.onewire.container.OneWireContainer1F
iButton container for iButton family type 1F (hex), DS2409
Field Summary | |
static byte |
ALL_LINES_OFF_COMMAND
All lines off command. |
static int |
AUX_OFFSET
Offset of Main channel flag in array returned from read state |
static int |
BITMAP_OFFSET
Offset of BITMAP in array returned from read state |
static int |
CHANNEL_AUX
Aux Channel number |
static int |
CHANNEL_MAIN
Main Channel number |
static byte |
DIRECT_ON_MAIN_COMMAND
Direct on main command. |
static byte |
DISCHARGE_COMMAND
Discharge command. |
static int |
MAIN_OFFSET
Offset of Main channel flag in array returned from read state |
static byte |
READ_WRITE_STATUS_COMMAND
Read Write Status register commmand. |
static byte |
SMART_ON_AUX_COMMAND
Smart on aux command. |
static byte |
SMART_ON_MAIN_COMMAND
Smart on main command. |
static int |
STATUS_OFFSET
Offset of Status in array returned from read state |
static int |
SWITCH_OFF
Channel flag to indicate turn off |
static int |
SWITCH_ON
Channel flag to indicate turn on |
static int |
SWITCH_SMART
Channel flag to indicate smart on |
Constructor Summary | |
OneWireContainer1F()
Default constructor |
|
OneWireContainer1F(DSPortAdapter sourceAdapter,
byte[] newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
|
OneWireContainer1F(DSPortAdapter sourceAdapter,
long newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
|
OneWireContainer1F(DSPortAdapter sourceAdapter,
java.lang.String newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
Method Summary | |
void |
clearActivity()
Clears the activity latches the next time possible. |
void |
dischargeLines(int time)
This method is used to force a power-on reset for parasitically powered 1-Wire devices connected to the main or auziliary output of the DS2409. |
java.lang.String |
getAlternateNames()
Retrieve the alternate Dallas Semiconductor part numbers or names. |
int |
getControlChannelAssociation(byte[] state)
This method checks the channel association of the control pin from the provided state data retrieved from the 'readDevice()' method. |
int |
getControlData(byte[] state)
This method checks the control data value from the provided state data retrieved from the 'readDevice()' method. |
java.lang.String |
getDescription()
Retrieve a short description of the function of the iButton type. |
boolean |
getLatchState(int channel,
byte[] state)
This method checks the latch state of the indicated channel from the provided state data retrieved from the 'readDevice()' method. |
boolean |
getLevel(int channel,
byte[] state)
This method checks the sensed level on the indicated channel from the provided state data retrieved from the 'readDevice()' method. |
java.lang.String |
getName()
Retrieve the Dallas Semiconductor part number of the iButton as a string. |
int |
getNumberChannels(byte[] state)
Query to get the number of channels supported by this switch. |
boolean |
getSensedActivity(int channel,
byte[] state)
This method checks if the indicated channel had activity from the provided state data retrieved from the 'readDevice()' method. |
boolean |
hasActivitySensing()
Query to see if the channels of this switch support activity sensing. |
boolean |
hasLevelSensing()
Query to see if the channels of this switch support level sensing. |
boolean |
hasSmartOn()
Query to see if the channels of this switch support smart on. |
boolean |
isHighSideSwitch()
Query to see if the channels of this switch are 'high side' switches. |
boolean |
isModeAuto(byte[] state)
This method checks if the control mode from the provided state data retrieved from the 'readDevice()' method. |
boolean |
onlySingleChannelOn()
Query to see if the channels of this switch require that only channel is on at any one time. |
byte[] |
readDevice()
This method retrieves the 1-Wire device sensor state. |
void |
setControlChannelAssociation(int channel,
byte[] state)
This method sets the control pin mode to the indicated value in the state data. |
void |
setControlData(boolean data,
byte[] state)
This method sets the control pin data to the indicated value in the state data. |
void |
setLatchState(int channel,
boolean latchState,
boolean doSmart,
byte[] state)
This method sets the latch state of the indicated channel in the state data. |
void |
setModeAuto(boolean makeAuto,
byte[] state)
This method sets the control pin mode to the indicated value in the state data. |
void |
writeDevice(byte[] state)
This method write the 1-Wire device sensor state that have been changed by the 'set' methods. |
Methods inherited from class com.dalsemi.onewire.container.OneWireContainer |
doSpeed, getAdapter, getAddress, getAddressAsLong, getAddressAsString, getMaxSpeed, getMemoryBanks, isAlarming, isPresent, setSpeed, setupContainer, setupContainer, setupContainer |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int BITMAP_OFFSET
public static final int STATUS_OFFSET
public static final int MAIN_OFFSET
public static final int AUX_OFFSET
public static final int CHANNEL_MAIN
public static final int CHANNEL_AUX
public static final int SWITCH_OFF
public static final int SWITCH_ON
public static final int SWITCH_SMART
public static final byte READ_WRITE_STATUS_COMMAND
public static final byte ALL_LINES_OFF_COMMAND
public static final byte DISCHARGE_COMMAND
public static final byte DIRECT_ON_MAIN_COMMAND
public static final byte SMART_ON_MAIN_COMMAND
public static final byte SMART_ON_AUX_COMMAND
Constructor Detail |
public OneWireContainer1F()
public OneWireContainer1F(DSPortAdapter sourceAdapter, byte[] newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire devicepublic OneWireContainer1F(DSPortAdapter sourceAdapter, long newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire devicepublic OneWireContainer1F(DSPortAdapter sourceAdapter, java.lang.String newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire deviceMethod Detail |
public java.lang.String getName()
getName
in class OneWireContainer
public java.lang.String getAlternateNames()
getAlternateNames
in class OneWireContainer
public java.lang.String getDescription()
getDescription
in class OneWireContainer
public byte[] readDevice() throws OneWireIOException, OneWireException
readDevice
in interface OneWireSensor
byte[]<\code> 1-Wire device sensor state *- Throws:
OneWireIOException
- OneWireException
-
public void writeDevice(byte[] state) throws OneWireIOException, OneWireException
writeDevice
in interface OneWireSensor
state
- - byte array of clock register page contentsOneWireIOException
- OneWireException
- public void dischargeLines(int time) throws OneWireIOException, OneWireException
time
- - int
This is the number of milliseconds the lines are
to be discharged for, must be >= 100 ms.OneWireIOException
- OneWireException
- public boolean isHighSideSwitch()
isHighSideSwitch
in interface SwitchContainer
public boolean hasActivitySensing()
hasActivitySensing
in interface SwitchContainer
public boolean hasLevelSensing()
hasLevelSensing
in interface SwitchContainer
public boolean hasSmartOn()
hasSmartOn
in interface SwitchContainer
public boolean onlySingleChannelOn()
onlySingleChannelOn
in interface SwitchContainer
public int getNumberChannels(byte[] state)
getNumberChannels
in interface SwitchContainer
state
- - byte array of device statepublic boolean getLevel(int channel, byte[] state) throws OneWireException
getLevel
in interface SwitchContainer
channel
- state
- - byte array of device stateboolean<\code> true if level sensed is 'high'
and false if level sensed is 'low'.
public boolean getLatchState(int channel, byte[] state)
getLatchState
in interface SwitchContainer
channel
- state
- - byte array of device stateboolean<\code> true if channel latch is 'on'
or conducting and false if channel latch is 'off' and not
conducting. Note that the actual output then the latch is 'on'
is returned from the 'isHighSideSwitch()' method.
public boolean getSensedActivity(int channel, byte[] state) throws OneWireException
getSensedActivity
in interface SwitchContainer
channel
- state
- - byte array of device stateboolean<\code> true if activity was detected
and false if no activity was detected.- Throws:
OneWireException
-
public boolean isModeAuto(byte[] state)
state
- - byte array of device stateboolean<\code> true if control mode is automatic
(see DS2409 data sheet).
public int getControlChannelAssociation(byte[] state)
state
- - byte array of device stateint<\code> the channel number that is associated
with the control pin (see DS2409 data sheet).
public int getControlData(byte[] state)
state
- - byte array of device stateint<\code> the channel number that is associated
with the control pin (see DS2409 data sheet).
public void setLatchState(int channel, boolean latchState, boolean doSmart, byte[] state)
setLatchState
in interface SwitchContainer
channel
- - integer indicated channel to do operation on
in the range [0 to (getNumberChannels() - 1)]latchState
- doSmart
- - if latchState is 'on'/true then doSmart indicates
if a 'smart on' is to be done. To avoid an exception
check the cababilities of the device using the
'hasSmartOn()' method.state
- - byte array of device statepublic void clearActivity() throws OneWireException
clearActivity
in interface SwitchContainer
public void setModeAuto(boolean makeAuto, byte[] state)
makeAuto
- - true to set to auto mode, false for manual modestate
- - byte array of device statepublic void setControlChannelAssociation(int channel, byte[] state) throws OneWireException
channel
- - integer indicated channel to do operation on
in the range [0 to (getNumberChannels() - 1)]state
- - byte array of device stateOneWireException
- public void setControlData(boolean data, byte[] state) throws OneWireException
data
- - boolean indicated the contol data state, true for
on and false for offstate
- - byte array of device stateOneWireException
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |