|
|||||||||
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.OneWireContainer02
iButton container for iButton family type 02 (hex), DS1991/DS1425.
Field Summary | |
static byte |
COPY_SCRATCHPAD_COMMAND
DS1991 Copy Scratchpad Command |
static byte |
READ_SCRATCHPAD_COMMAND
DS1991 Read Scratchpad Command |
static byte |
READ_SUBKEY_COMMAND
DS1991 Read SubKey Command |
static byte |
WRITE_PASSWORD_COMMAND
DS1991 Write Password Command |
static byte |
WRITE_SCRATCHPAD_COMMAND
DS1991 Write Scratchpad Command |
static byte |
WRITE_SUBKEY_COMMAND
DS1991 Write SubKey Command |
Constructor Summary | |
OneWireContainer02()
Constructor OneWireContainer02 |
|
OneWireContainer02(DSPortAdapter sourceAdapter,
byte[] newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
|
OneWireContainer02(DSPortAdapter sourceAdapter,
long newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
|
OneWireContainer02(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 |
copyScratchpad(int key,
byte[] passwd,
int blockNum)
Writes the data from the scratchpad to the specified block or blocks. |
java.lang.String |
getAlternateNames()
Retrieve the alternate Dallas Semiconductor part numbers or names. |
java.lang.String |
getDescription()
Retrieve a short description of the function of the iButton type. |
java.lang.String |
getName()
Retrieve the Dallas Semiconductor part number of the iButton as a string. |
byte[] |
readScratchpad()
Reads the entire scratchpad. |
void |
readSubkey(byte[] data,
int key,
byte[] passwd)
Reads the subkey requested with the given key name and password. |
byte[] |
readSubkey(int key,
byte[] passwd)
Reads the subkey requested with the given key name and password. |
void |
writePassword(int key,
byte[] oldName,
byte[] newName,
byte[] newPasswd)
Writes a new identifier and password to the secure subkey iButton |
void |
writeScratchpad(int addr,
byte[] data)
Writes the data to the scratchpad from the given address. |
void |
writeSubkey(int key,
int addr,
byte[] passwd,
byte[] data)
Writes new data to the secure subkey |
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 byte WRITE_SCRATCHPAD_COMMAND
public static final byte READ_SCRATCHPAD_COMMAND
public static final byte COPY_SCRATCHPAD_COMMAND
public static final byte WRITE_PASSWORD_COMMAND
public static final byte WRITE_SUBKEY_COMMAND
public static final byte READ_SUBKEY_COMMAND
Constructor Detail |
public OneWireContainer02()
public OneWireContainer02(DSPortAdapter sourceAdapter, byte[] newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire devicepublic OneWireContainer02(DSPortAdapter sourceAdapter, long newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire devicepublic OneWireContainer02(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
String
representation of the alternate names.public java.lang.String getDescription()
getDescription
in class OneWireContainer
String
representation of the function description.public void writeScratchpad(int addr, byte[] data) throws OneWireIOException, OneWireException, java.lang.IllegalArgumentException
addr
- address to begin writing. Must be between
0x00 and 0x3F.data
- data to write.java.lang.IllegalArgumentException
- OneWireIOException
- OneWireException
- public byte[] readScratchpad() throws OneWireIOException, OneWireException
byte[]
containing the data from the scratchpad;
the array will have a length of 64.OneWireIOException
- OneWireException
- public void copyScratchpad(int key, byte[] passwd, int blockNum) throws OneWireIOException, OneWireException, java.lang.IllegalArgumentException
key
- subkey being writtenpasswd
- password for the subkey being writtenblockNum
- number of the block to be copied (see page 7 of the
DS1991 data sheet) block 0-7, or 8 to copy all 64 bytes.java.lang.IllegalArgumentException
- OneWireIOException
- OneWireException
- public byte[] readSubkey(int key, byte[] passwd) throws OneWireIOException, OneWireException, java.lang.IllegalArgumentException
key
- number indicating the key to be read: 0, 1, or 2passwd
- password of destination subkeyjava.lang.IllegalArgumentException
- OneWireIOException
- OneWireException
- public void readSubkey(byte[] data, int key, byte[] passwd) throws OneWireIOException, OneWireException, java.lang.IllegalArgumentException
data
- buffer of length 64 into which to write the datakey
- number indicating the key to be read: 0, 1, or 2passwd
- password of destination subkeyjava.lang.IllegalArgumentException
- OneWireIOException
- OneWireException
- public void writePassword(int key, byte[] oldName, byte[] newName, byte[] newPasswd) throws OneWireIOException, OneWireException, java.lang.IllegalArgumentException
key
- number indicating the key to be read: 0, 1, or 2oldName
- identifier of the key used to confirm the correct
key's password to be changed. Must be exactly length 8.newName
- identifier to be used for the key with the new
password. Must be exactly length 8.newPasswd
- new password for destination subkey. Must be
exactly length 8.java.lang.IllegalArgumentException
- OneWireIOException
- OneWireException
- public void writeSubkey(int key, int addr, byte[] passwd, byte[] data) throws OneWireIOException, OneWireException, java.lang.IllegalArgumentException
key
- number indicating the key to be written: 0, 1, or 2addr
- address to start writing at ( 0x00 to 0x3F )passwd
- passwird for the subkeydata
- data to be writtenjava.lang.IllegalArgumentException
- OneWireIOException
- OneWireException
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |