1-Wire API for .NET Version 4.00
|
Inherits com::dalsemi::onewire::container::OneWireContainer, and com::dalsemi::onewire::container::PasswordContainer.
Public Member Functions | |
OneWireContainer37 () | |
Creates a new OneWireContainer for communication with a DS1977. | |
OneWireContainer37 (DSPortAdapter sourceAdapter, byte[] newAddress) | |
Creates a new OneWireContainer for communication with a DS1977. | |
OneWireContainer37 (DSPortAdapter sourceAdapter, long newAddress) | |
Creates a new OneWireContainer for communication with a DS1977. | |
OneWireContainer37 (DSPortAdapter sourceAdapter, String newAddress) | |
Creates a new OneWireContainer for communication with a DS1977. | |
void | setupContainer (DSPortAdapter sourceAdapter, byte[] newAddress) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device. | |
void | setupContainer (DSPortAdapter sourceAdapter, long newAddress) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device. | |
void | setupContainer (DSPortAdapter sourceAdapter, String newAddress) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device. | |
Enumeration | getMemoryBanks () |
Gets an enumeration of memory bank instances that implement one or more of the following interfaces: MemoryBank, PagedMemoryBank, and OTPMemoryBank. | |
int | getMaxSpeed () |
Returns the maximum speed this iButton device can communicate at. | |
String | getName () |
Gets the Maxim Integrated Products part number of the iButton or 1-Wire Device as a java.lang.String . | |
String | getAlternateNames () |
Retrieves the alternate Maxim Integrated Products part numbers or names. | |
String | getDescription () |
Gets a short description of the function of this iButton or 1-Wire Device type. | |
synchronized void | setSpeedCheck (boolean doSpeedCheck) |
Directs the container to avoid the calls to doSpeed() in methods that communicate with the Thermocron. | |
int | getReadOnlyPasswordLength () throws OneWireException |
Retrieves the password length for the read-only password. | |
int | getReadWritePasswordLength () throws OneWireException |
Retrieves the password length for the read/write password. | |
int | getWriteOnlyPasswordLength () throws OneWireException |
Retrieves the password length for the write-only password. | |
int | getReadOnlyPasswordAddress () throws OneWireException |
Retrieves the address the read only password starts. | |
int | getReadWritePasswordAddress () throws OneWireException |
Retrieves the address the read/write password starts. | |
int | getWriteOnlyPasswordAddress () throws OneWireException |
Retrieves the address the write only password starts. | |
boolean | hasReadOnlyPassword () |
Tells whether the device has a read only password. | |
boolean | hasReadWritePassword () |
Tells whether the device has a read/write password. | |
boolean | hasWriteOnlyPassword () |
Tells whether the device has a write only password. | |
boolean | getDeviceReadOnlyPasswordEnable () throws OneWireException |
Tells whether the read only password has been enabled. | |
boolean | getDeviceReadWritePasswordEnable () throws OneWireException |
Tells whether the read/write password has been enabled. | |
boolean | getDeviceWriteOnlyPasswordEnable () throws OneWireException |
Tells whether the write only password has been enabled. | |
boolean | hasSinglePasswordEnable () |
Returns true if this device has the capability to enable one type of password while leaving another type disabled. | |
void | setDevicePasswordEnableAll (boolean enableAll) throws OneWireException, OneWireIOException |
void | setDeviceReadOnlyPassword (byte[] password, int offset) throws OneWireException, OneWireIOException |
Attempts to change the value of the read password in the device's register. | |
void | setDeviceReadWritePassword (byte[] password, int offset) throws OneWireException, OneWireIOException |
Attempts to change the value of the read/write password in the device's register. | |
void | setDeviceWriteOnlyPassword (byte[] password, int offset) throws OneWireException, OneWireIOException |
Attempts to change the value of the write only password in the device's register. | |
void | setDevicePasswordEnable (boolean enableReadOnly, boolean enableReadWrite, boolean enableWriteOnly) throws OneWireException, OneWireIOException |
void | setContainerReadOnlyPassword (byte[] password, int offset) throws OneWireException |
Sets the value of the read password for the container. | |
void | getContainerReadOnlyPassword (byte[] password, int offset) throws OneWireException |
Returns the read password used by this container to read the memory of the device. | |
boolean | isContainerReadOnlyPasswordSet () throws OneWireException |
Returns true if the container's read password has been set. | |
void | setContainerReadWritePassword (byte[] password, int offset) throws OneWireException |
Sets the value of the read/write password for the container. | |
void | getContainerReadWritePassword (byte[] password, int offset) throws OneWireException |
Returns the read/write password used by this container to read from and write to the memory of the device. | |
boolean | isContainerReadWritePasswordSet () throws OneWireException |
Returns true if the container's read/write password has been set. | |
void | setContainerWriteOnlyPassword (byte[] password, int offset) throws OneWireException |
Sets the value of the read/write password for the container. | |
void | getContainerWriteOnlyPassword (byte[] password, int offset) throws OneWireException |
Returns the read/write password used by this container to read from and write to the memory of the device. | |
boolean | isContainerWriteOnlyPasswordSet () throws OneWireException |
Returns true if the container's read/write password has been set. | |
Static Public Attributes | |
static final byte | WRITE_SCRATCHPAD_COMMAND = (byte)0x0F |
1-Wire command for Write Scratchpad | |
static final byte | READ_SCRATCHPAD_COMMAND = (byte)0xAA |
1-Wire command for Read Scratchpad | |
static final byte | COPY_SCRATCHPAD_PW_COMMAND = (byte)0x99 |
1-Wire command for Copy Scratchpad With Password | |
static final byte | READ_MEMORY_PW_COMMAND = (byte)0x69 |
1-Wire command for Read Memory With Password | |
static final byte | VERIFY_PSW_COMMAND = (byte)0xC3 |
1-Wire command for Verifing the Password | |
static final byte | READ_VERSION = (byte)0xCC |
1-Wire command for getting Read Version | |
static final int | PASSWORD_CONTROL_REGISTER = 0x7FD0 |
Address of the Password Control Register. | |
static final int | READ_ACCESS_PASSWORD = 0x7FC0 |
Address of Read Access Password. | |
static final int | READ_WRITE_ACCESS_PASSWORD = 0x7FC8 |
Address of the Read Write Access Password. | |
Protected Attributes | |
final byte[] | readPassword = new byte[8] |
The current password for readingfrom this device. | |
final byte[] | readWritePassword = new byte[8] |
The current password for reading/writing from/to this device. |
1-Wire® container for a 32K bytes of read-only and read/write password protected memory, DS1977. This container encapsulates the functionality of the 1-Wire family type 37 (hex).
The memory can be accessed through the objects that are returned from the getMemoryBanks method.
The following is a list of the MemoryBank instances that are returned:
For examples regarding memory operations,
Creates a new OneWireContainer
for communication with a DS1977.
Note that the method setupContainer(DSPortAdapter,byte[])
must be called to set the correct DSPortAdapter
device address.
OneWireContainer37 | ( | DSPortAdapter | sourceAdapter, |
byte[] | newAddress | ||
) |
Creates a new OneWireContainer
for communication with a DS1977.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this DS1977 |
OneWireContainer37 | ( | DSPortAdapter | sourceAdapter, |
long | newAddress | ||
) |
Creates a new OneWireContainer
for communication with a DS1977.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this DS1977 |
OneWireContainer37 | ( | DSPortAdapter | sourceAdapter, |
String | newAddress | ||
) |
Creates a new OneWireContainer
for communication with a DS1977.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this DS1977 |
String getAlternateNames | ( | ) |
Retrieves the alternate Maxim Integrated Products 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".
Reimplemented from OneWireContainer.
void getContainerReadOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Returns the read password used by this container to read the memory of the device.
password | Holds the 8-byte value of container's read password. |
offset | Index to start copying the password into the array. |
Implements PasswordContainer.
void getContainerReadWritePassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Returns the read/write password used by this container to read from and write to the memory of the device.
password | Holds the 8-byte value of container's read/write password. |
offset | Index to start copying the password into the array. |
Implements PasswordContainer.
void getContainerWriteOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Returns the read/write password used by this container to read from and write to the memory of the device.
password | Holds the 8-byte value of container's read/write password. |
offset | Index to start copying the password into the array. |
Implements PasswordContainer.
String getDescription | ( | ) |
Gets a short description of the function of this iButton or 1-Wire Device type.
Reimplemented from OneWireContainer.
boolean getDeviceReadOnlyPasswordEnable | ( | ) | throws OneWireException |
Tells whether the read only password has been enabled.
OneWireException |
Implements PasswordContainer.
boolean getDeviceReadWritePasswordEnable | ( | ) | throws OneWireException |
Tells whether the read/write password has been enabled.
OneWireException |
Implements PasswordContainer.
boolean getDeviceWriteOnlyPasswordEnable | ( | ) | throws OneWireException |
Tells whether the write only password has been enabled.
OneWireException |
Implements PasswordContainer.
int getMaxSpeed | ( | ) |
Returns the maximum speed this iButton device can communicate at.
Reimplemented from OneWireContainer.
Enumeration getMemoryBanks | ( | ) |
Gets an enumeration of memory bank instances that implement one or more of the following interfaces: MemoryBank, PagedMemoryBank, and OTPMemoryBank.
Enumeration
of memory banks Reimplemented from OneWireContainer.
String getName | ( | ) |
Gets the Maxim Integrated Products part number of the iButton or 1-Wire Device as a java.lang.String
.
For example "DS1977".
Reimplemented from OneWireContainer.
int getReadOnlyPasswordAddress | ( | ) | throws OneWireException |
Retrieves the address the read only password starts.
Implements PasswordContainer.
int getReadOnlyPasswordLength | ( | ) | throws OneWireException |
Retrieves the password length for the read-only password.
OneWireException |
Implements PasswordContainer.
int getReadWritePasswordAddress | ( | ) | throws OneWireException |
Retrieves the address the read/write password starts.
Implements PasswordContainer.
int getReadWritePasswordLength | ( | ) | throws OneWireException |
Retrieves the password length for the read/write password.
OneWireException |
Implements PasswordContainer.
int getWriteOnlyPasswordAddress | ( | ) | throws OneWireException |
Retrieves the address the write only password starts.
Implements PasswordContainer.
int getWriteOnlyPasswordLength | ( | ) | throws OneWireException |
Retrieves the password length for the write-only password.
OneWireException |
Implements PasswordContainer.
boolean hasReadOnlyPassword | ( | ) |
Tells whether the device has a read only password.
Implements PasswordContainer.
boolean hasReadWritePassword | ( | ) |
Tells whether the device has a read/write password.
Implements PasswordContainer.
boolean hasSinglePasswordEnable | ( | ) |
Returns true if this device has the capability to enable one type of password while leaving another type disabled.
i.e. if the device has Read-Only password protection and Write-Only password protection, this method indicates whether or not you can enable Read-Only protection while leaving the Write-Only protection disabled.
true
if the device has the capability to enable one type of password while leaving another type disabled. Implements PasswordContainer.
boolean hasWriteOnlyPassword | ( | ) |
Tells whether the device has a write only password.
Implements PasswordContainer.
boolean isContainerReadOnlyPasswordSet | ( | ) | throws OneWireException |
Returns true if the container's read password has been set.
The return value is not affected by whether or not the read password of the container actually matches the value in the device's password register.
true
if the container's read password has been set Implements PasswordContainer.
boolean isContainerReadWritePasswordSet | ( | ) | throws OneWireException |
Returns true if the container's read/write password has been set.
The return value is not affected by whether or not the read/write password of the container actually matches the value in the device's password register.
true
if the container's read/write password has been set. Implements PasswordContainer.
boolean isContainerWriteOnlyPasswordSet | ( | ) | throws OneWireException |
Returns true if the container's read/write password has been set.
The return value is not affected by whether or not the read/write password of the container actually matches the value in the device's password register.
true
if the container's read/write password has been set. Implements PasswordContainer.
void setContainerReadOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Sets the value of the read password for the container.
This is the value used by this container to read the memory of the device. If this password does not match the value of the read password in the device's password register, all subsequent read operations will fail.
password | New 8-byte value of container's read password. |
offset | Index to start copying the password from the array. |
Implements PasswordContainer.
void setContainerReadWritePassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Sets the value of the read/write password for the container.
This is the value used by this container to read and write to the memory of the device. If this password does not match the value of the read/write password in the device's password register, all subsequent read and write operations will fail.
password | New 8-byte value of container's read/write password. |
offset | Index to start copying the password from the array. |
Implements PasswordContainer.
void setContainerWriteOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Sets the value of the read/write password for the container.
This is the value used by this container to read and write to the memory of the device. If this password does not match the value of the read/write password in the device's password register, all subsequent read and write operations will fail.
password | New 8-byte value of container's read/write password. |
offset | Index to start copying the password from the array. |
Implements PasswordContainer.
void setDevicePasswordEnable | ( | boolean | enableReadOnly, |
boolean | enableReadWrite, | ||
boolean | enableWriteOnly | ||
) | throws OneWireException, OneWireIOException |
Enables/disables passwords by writing to the devices password control register. For this to be successful, either passwords must be disabled, or the read/write password for this container must be set and must match the current value of the read/write password in the device's register.
WARNING: Enabling passwords requires that both the read password and the read/write password be re-written to the part. Before calling this method, you should set the container read password and read/write password values. This will ensure that the correct value is written into the part.
enable | if true , device passwords will be enabled. All subsequent read and write operations will require that the passwords for the container are set. |
Implements PasswordContainer.
void setDevicePasswordEnableAll | ( | boolean | enableAll | ) | throws OneWireException, OneWireIOException |
Enables/Disables passwords for this device. If the part has more than one type of password (Read-Only, Write-Only, or Read/Write), all passwords will be enabled. This function is equivalent to the following: owc37.setDevicePasswordEnable( owc37.hasReadOnlyPassword(), owc37.hasReadWritePassword(), owc37.hasWriteOnlyPassword() );
For this to be successful, either write-protect passwords must be disabled, or the write-protect password(s) for this container must be set and must match the value of the write-protect password(s) in the device's register.
WARNING: Enabling passwords requires that both the read password and the read/write password be re-written to the part. Before calling this method, you should set the container read password and read/write password values. This will ensure that the correct value is written into the part.
enableAll | if true , all passwords are enabled. Otherwise, all passwords are disabled. |
Implements PasswordContainer.
void setDeviceReadOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException, OneWireIOException |
Attempts to change the value of the read password in the device's register.
For this to be successful, either passwords must be disabled, or the read/write password for this container must be set and must match the value of the read/write password in the device's register.
WARNING: Setting the read password requires that both the read password and the read/write password be written to the part. Before calling this method, you should set the container read/write password value. This will ensure that the correct value is written into the part.
password | the new value of 8-byte device read password, to be copied into the devices register. |
offset | the offset to start copying the 8 bytes from the array |
Implements PasswordContainer.
void setDeviceReadWritePassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException, OneWireIOException |
Attempts to change the value of the read/write password in the device's register.
For this to be successful, either passwords must be disabled, or the read/write password for this container must be set and must match the current value of the read/write password in the device's register.
password | the new value of 8-byte device read/write password, to be copied into the devices register. |
offset | the offset to start copying the 8 bytes from the array |
Implements PasswordContainer.
void setDeviceWriteOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException, OneWireIOException |
Attempts to change the value of the write only password in the device's register.
For this to be successful, either passwords must be disabled, or the read/write password for this container must be set and must match the current value of the read/write password in the device's register.
password | the new value of 8-byte device read/write password, to be copied into the devices register. |
offset | the offset to start copying the 8 bytes from the array |
Implements PasswordContainer.
synchronized void setSpeedCheck | ( | boolean | doSpeedCheck | ) |
Directs the container to avoid the calls to doSpeed() in methods that communicate with the Thermocron.
To ensure that all parts can talk to the 1-Wire bus at their desired speed, each method contains a call to doSpeed()
. However, this is an expensive operation. If a user manages the bus speed in an application, call this method with doSpeedCheck
as false
. The default behavior is to call doSpeed()
.
doSpeedCheck | true for doSpeed() to be called before every 1-Wire bus access, false to skip this expensive call |
void setupContainer | ( | DSPortAdapter | sourceAdapter, |
long | newAddress | ||
) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this 1-Wire device |
Reimplemented from OneWireContainer.
void setupContainer | ( | DSPortAdapter | sourceAdapter, |
String | newAddress | ||
) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this 1-Wire device |
Reimplemented from OneWireContainer.
void setupContainer | ( | DSPortAdapter | sourceAdapter, |
byte[] | newAddress | ||
) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this 1-Wire device |
Reimplemented from OneWireContainer.
final int PASSWORD_CONTROL_REGISTER = 0x7FD0 [static] |
Address of the Password Control Register.
final int READ_ACCESS_PASSWORD = 0x7FC0 [static] |
Address of Read Access Password.
final int READ_WRITE_ACCESS_PASSWORD = 0x7FC8 [static] |
Address of the Read Write Access Password.