1-Wire API for .NET Version 4.00
Public Member Functions

OneWireContainer02 Class Reference

Inherits com::dalsemi::onewire::container::OneWireContainer.

List of all members.

Public Member Functions

 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.
String getName ()
 Retrieves the Maxim Integrated Products part number of the 1-Wire device as a String.
String getAlternateNames ()
 Retrieves the alternate Maxim Integrated Products part numbers or names.
String getDescription ()
 Retrieves a short description of the function of the 1-Wire device type.
void writeScratchpad (int addr, byte[] data) throws OneWireIOException, OneWireException, IllegalArgumentException
 Writes the data to the scratchpad from the given address.
byte[] readScratchpad () throws OneWireIOException, OneWireException
 Reads the entire scratchpad.
void copyScratchpad (int key, byte[] passwd, int blockNum) throws OneWireIOException, OneWireException, IllegalArgumentException
 Writes the data from the scratchpad to the specified block or blocks.
byte[] readSubkey (int key, byte[] passwd) throws OneWireIOException, OneWireException, IllegalArgumentException
 Reads the subkey requested with the given key name and password.
void readSubkey (byte[] data, int key, byte[] passwd) throws OneWireIOException, OneWireException, IllegalArgumentException
 Reads the subkey requested with the given key name and password.
void writePassword (int key, byte[] oldName, byte[] newName, byte[] newPasswd) throws OneWireIOException, OneWireException, IllegalArgumentException
 Writes a new identifier and password to the secure subkey iButton.
void writeSubkey (int key, int addr, byte[] passwd, byte[] data) throws OneWireIOException, OneWireException, IllegalArgumentException
 Writes new data to the secure subkey.

Detailed Description

1-Wire® container that encapsulates the functionality of the 1-Wire family type 02 (hex), Maxim Integrated Products part number: DS1991, MultiKey.

This iButton is primarily used as a minimal security read/write portable memory device.

Features

Memory

All memory is accessed through read/write routines, no MemoryBank classes are used.

Alternate Names

DataSheets

http://pdfserv.maxim-ic.com/arpdf/DS1991.pdf
http://pdfserv.maxim-ic.com/arpdf/DS1425.pdf

Version:
0.00, 28 Aug 2000
Author:
DS,GH

Constructor & Destructor Documentation

Create an empty container.

Must call 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.

See also:
OneWireContainer02(DSPortAdapter,byte[])
OneWireContainer02(DSPortAdapter,long)
OneWireContainer02(DSPortAdapter,String)
setupContainer(DSPortAdapter,byte[])
setupContainer(DSPortAdapter,long)
setupContainer(DSPortAdapter,String)
OneWireContainer02 ( DSPortAdapter  sourceAdapter,
byte[]  newAddress 
)

Create a container with a provided adapter object and the address of the iButton or 1-Wire device.

This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.

Parameters:
sourceAdapteradapter object required to communicate with this iButton.
newAddressaddress of this 1-Wire device
See also:
OneWireContainer02()
com.dalsemi.onewire.utils.Address
OneWireContainer02 ( DSPortAdapter  sourceAdapter,
long  newAddress 
)

Create a container with a provided adapter object and the address of the iButton or 1-Wire device.

This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.

Parameters:
sourceAdapteradapter object required to communicate with this iButton.
newAddressaddress of this 1-Wire device
See also:
OneWireContainer02()
com.dalsemi.onewire.utils.Address
OneWireContainer02 ( DSPortAdapter  sourceAdapter,
String  newAddress 
)

Create a container with a provided adapter object and the address of the iButton or 1-Wire device.

This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.

Parameters:
sourceAdapteradapter object required to communicate with this iButton.
newAddressaddress of this 1-Wire device
See also:
OneWireContainer02()
com.dalsemi.onewire.utils.Address

Member Function Documentation

void copyScratchpad ( int  key,
byte[]  passwd,
int  blockNum 
) throws OneWireIOException, OneWireException, IllegalArgumentException

Writes the data from the scratchpad to the specified block or blocks.

Note that the write will erase the data from the scratchpad.

Parameters:
keysubkey being written
passwdpassword for the subkey being written
blockNumnumber of the block to be copied (see page 7 of the DS1991 data sheet) block 0-7, or 8 to copy all 64 bytes.
Exceptions:
IllegalArgumentExceptionIf key is out of range (0 to 2), or password is not 8 characters, or if blockNum is out of range (0 to 8)
OneWireIOExceptionIf device is not found on the 1-Wire network
OneWireExceptionon a communication or setup error with the 1-Wire adapter
String getAlternateNames ( )

Retrieves the alternate Maxim Integrated Products part numbers or names.

A 'family' of 1-Wire Network devices may have more than one part number depending on packaging. There can also be nicknames such as 'Crypto iButton'.

Returns:
1-Wire device alternate names

Reimplemented from OneWireContainer.

String getDescription ( )

Retrieves a short description of the function of the 1-Wire device type.

Returns:
device functional description

Reimplemented from OneWireContainer.

String getName ( )

Retrieves the Maxim Integrated Products part number of the 1-Wire device as a String.

For example 'Crypto iButton' or 'DS1992'.

Returns:
1-Wire device name

Reimplemented from OneWireContainer.

byte [] readScratchpad ( ) throws OneWireIOException, OneWireException

Reads the entire scratchpad.

Returns:
byte[] containing the data from the scratchpad; the array will have a length of 64.
Exceptions:
OneWireIOExceptionIf device is not found on the 1-Wire network
OneWireExceptionon a communication or setup error with the 1-Wire adapter
byte [] readSubkey ( int  key,
byte[]  passwd 
) throws OneWireIOException, OneWireException, IllegalArgumentException

Reads the subkey requested with the given key name and password.

Note that this method allows for reading from the subkey data only which starts at address 0x10 within a key. It does not allow reading from any earlier address within a key because the device cannot be force to allow reading the password. This is why the subkey number is or-ed with 0x10 in creating the address in bytes 1 and 2 of the sendBlock.

Parameters:
keynumber indicating the key to be read: 0, 1, or 2
passwdpassword of destination subkey
Returns:
byte[] containing the data from the subkey; the array will have a length of 64, since it includes the key identifier, sent password, and 48 bytes of data.
Exceptions:
IllegalArgumentExceptionIf key is out of range (0 to 2), or password is not 8 characters, or if data does not have a length of 64
OneWireIOExceptionIf device is not found on the 1-Wire network
OneWireExceptionon a communication or setup error with the 1-Wire adapter
void readSubkey ( byte[]  data,
int  key,
byte[]  passwd 
) throws OneWireIOException, OneWireException, IllegalArgumentException

Reads the subkey requested with the given key name and password.

Note that this method allows for reading from the subkey data only which starts at address 0x10 within a key. It does not allow reading from any earlier address within a key because the device cannot be force to allow reading the password. This is why the subkey number is or-ed with 0x10 in creating the address in bytes 1 and 2 of the sendBlock.

Parameters:
databuffer of length 64 into which to write the data
keynumber indicating the key to be read: 0, 1, or 2
passwdpassword of destination subkey
Exceptions:
IllegalArgumentExceptionIf key is out of range (0 to 2), or password is not 8 characters, or if data does not have a length of 64
OneWireIOExceptionIf device is not found on the 1-Wire network
OneWireExceptionon a communication or setup error with the 1-Wire adapter
void writePassword ( int  key,
byte[]  oldName,
byte[]  newName,
byte[]  newPasswd 
) throws OneWireIOException, OneWireException, IllegalArgumentException

Writes a new identifier and password to the secure subkey iButton.

Parameters:
keynumber indicating the key to be read: 0, 1, or 2
oldNameidentifier of the key used to confirm the correct key's password to be changed. Must be exactly length 8.
newNameidentifier to be used for the key with the new password. Must be exactly length 8.
newPasswdnew password for destination subkey. Must be exactly length 8.
Exceptions:
IllegalArgumentExceptionIf key value is out of range (0 to 2), or if newPasswd, newName, or oldName are not 8 characters
OneWireIOExceptionIf device is not found on the 1-Wire network
OneWireExceptionon a communication or setup error with the 1-Wire adapter
void writeScratchpad ( int  addr,
byte[]  data 
) throws OneWireIOException, OneWireException, IllegalArgumentException

Writes the data to the scratchpad from the given address.

Parameters:
addraddress to begin writing. Must be between 0x00 and 0x3F.
datadata to write.
Exceptions:
IllegalArgumentExceptionIf address is out of range, or data is to long for scratchpad
OneWireIOExceptionIf device is not found on the 1-Wire network
OneWireExceptionon a communication or setup error with the 1-Wire adapter
void writeSubkey ( int  key,
int  addr,
byte[]  passwd,
byte[]  data 
) throws OneWireIOException, OneWireException, IllegalArgumentException

Writes new data to the secure subkey.

Parameters:
keynumber indicating the key to be written: 0, 1, or 2
addraddress to start writing at ( 0x00 to 0x3F )
passwdpasswird for the subkey
datadata to be written
Exceptions:
IllegalArgumentExceptionIf 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 bounds
OneWireIOExceptionIf device is not found on the 1-Wire network
OneWireExceptionon a communication or setup error with the 1-Wire adapter

The documentation for this class was generated from the following file: