|
||||||||||
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
1-Wire® container that encapsulates the functionality of the 1-Wire family type 02 (hex), Dallas Semiconductor part number: DS1991, MultiKey.
This iButton is primarily used as a minimal security read/write portable memory device.
All memory is accessed through read/write routines, no MemoryBank
classes are used.
Constructor Summary | |
OneWireContainer02()
Create an empty container. |
|
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,
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. |
String |
getAlternateNames()
Retrieves the alternate Dallas Semiconductor part numbers or names. |
String |
getDescription()
Retrieves a short description of the function of the 1-Wire device type. |
String |
getName()
Retrieves the Dallas Semiconductor part number of the 1-Wire device 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, equals, getAdapter, getAddress, getAddressAsLong, getAddressAsString, getMaxSpeed, getMemoryBanks, hashCode, isAlarming, isPresent, setSpeed, setupContainer, setupContainer, setupContainer, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public OneWireContainer02()
setupContainer
before
using this new container.This is one of the methods to construct a container. The others are through creating a OneWireContainer with parameters.
OneWireContainer02(DSPortAdapter,byte[])
,
OneWireContainer02(DSPortAdapter,long)
,
OneWireContainer02(DSPortAdapter,String)
,
OneWireContainer.setupContainer(DSPortAdapter,byte[])
,
OneWireContainer.setupContainer(DSPortAdapter,long)
,
OneWireContainer.setupContainer(DSPortAdapter,String)
public OneWireContainer02(DSPortAdapter sourceAdapter, byte[] newAddress)
This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire deviceOneWireContainer02()
,
Address
public OneWireContainer02(DSPortAdapter sourceAdapter, long newAddress)
This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire deviceOneWireContainer02()
,
Address
public OneWireContainer02(DSPortAdapter sourceAdapter, String newAddress)
This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire deviceOneWireContainer02()
,
Address
Method Detail |
public String getName()
OneWireContainer
String
. For example 'Crypto iButton' or 'DS1992'.getName
in class OneWireContainer
com.dalsemi.onewire.container.OneWireContainer
public String getAlternateNames()
OneWireContainer
getAlternateNames
in class OneWireContainer
com.dalsemi.onewire.container.OneWireContainer
public String getDescription()
OneWireContainer
getDescription
in class OneWireContainer
com.dalsemi.onewire.container.OneWireContainer
public void writeScratchpad(int addr, byte[] data) throws OneWireIOException, OneWireException, IllegalArgumentException
addr
- address to begin writing. Must be between
0x00 and 0x3F.data
- data to write.IllegalArgumentException
- If address is out of range, or data is to long for scratchpadOneWireIOException
- If device is not found on the 1-Wire networkOneWireException
- on a communication or setup error with the 1-Wire
adapterpublic byte[] readScratchpad() throws OneWireIOException, OneWireException
byte[]
containing the data from the scratchpad;
the array will have a length of 64.OneWireIOException
- If device is not found on the 1-Wire networkOneWireException
- on a communication or setup error with the 1-Wire
adapterpublic void copyScratchpad(int key, byte[] passwd, int blockNum) throws OneWireIOException, OneWireException, 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.IllegalArgumentException
- If key is out of range (0 to 2), or password is not 8 characters, or if
blockNum is out of range (0 to 8)OneWireIOException
- If device is not found on the 1-Wire networkOneWireException
- on a communication or setup error with the 1-Wire
adapterpublic byte[] readSubkey(int key, byte[] passwd) throws OneWireIOException, OneWireException, IllegalArgumentException
key
- number indicating the key to be read: 0, 1, or 2passwd
- password of destination subkeyIllegalArgumentException
- If key is out of range (0 to 2), or password is not 8 characters, or if
data does not have a length of 64OneWireIOException
- If device is not found on the 1-Wire networkOneWireException
- on a communication or setup error with the 1-Wire
adapterpublic void readSubkey(byte[] data, int key, byte[] passwd) throws OneWireIOException, OneWireException, 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 subkeyIllegalArgumentException
- If key is out of range (0 to 2), or password is not 8 characters, or if
data does not have a length of 64OneWireIOException
- If device is not found on the 1-Wire networkOneWireException
- on a communication or setup error with the 1-Wire
adapterpublic void writePassword(int key, byte[] oldName, byte[] newName, byte[] newPasswd) throws OneWireIOException, OneWireException, 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.IllegalArgumentException
- If key value is out of range (0 to 2), or if newPasswd, newName, or oldName
are not 8 charactersOneWireIOException
- If device is not found on the 1-Wire networkOneWireException
- on a communication or setup error with the 1-Wire
adapterpublic void writeSubkey(int key, int addr, byte[] passwd, byte[] data) throws OneWireIOException, OneWireException, 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 writtenIllegalArgumentException
- If key is out of range (0 to 2), or if address is out of range, or if passwd is
not 8 characters, or if data length is out of boundsOneWireIOException
- If device is not found on the 1-Wire networkOneWireException
- on a communication or setup error with the 1-Wire
adapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |