Interface PasswordContainer
- All Known Implementing Classes:
OneWireContainer37
,OneWireContainer41
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getContainerReadOnlyPassword
(byte[] password, int offset) Gets the Read-Only password used by the API when reading from the device's memory.void
getContainerReadWritePassword
(byte[] password, int offset) Gets the Read/Write password used by the API when reading from or writing to the device's memory.void
getContainerWriteOnlyPassword
(byte[] password, int offset) Gets the Write-Only password used by the API when writing to the device's memory.boolean
Returns true if the device's Read-Only password has been enabled.boolean
Returns true if the device's Read/Write password has been enabled.boolean
Returns true if the device's Write-Only password has been enabled.int
Returns the absolute address of the memory location where the Read-Only password is written.int
Returns the length in bytes of the Read-Only password.int
Returns the absolute address of the memory location where the Read/Write password is written.int
Returns the length in bytes of the Read/Write password.int
Returns the absolute address of the memory location where the Write-Only password is written.int
Returns the length in bytes of the Write-Only password.boolean
Returns true if this device has a Read-Only password.boolean
Returns true if this device has a Read/Write password.boolean
Returns true if this device has the capability to enable one type of password while leaving another type disabled.boolean
Returns true if this device has a Write-Only password.boolean
Returns true if the password used by the API for reading from the device's memory has been set.boolean
Returns true if the password used by the API for reading from or writing to the device's memory has been set.boolean
Returns true if the password used by the API for writing to the device's memory has been set.void
setContainerReadOnlyPassword
(byte[] password, int offset) Sets the Read-Only password used by the API when reading from the device's memory.void
setContainerReadWritePassword
(byte[] password, int offset) Sets the Read/Write password used by the API when reading from or writing to the device's memory.void
setContainerWriteOnlyPassword
(byte[] password, int offset) Sets the Write-Only password used by the API when writing to the device's memory.void
setDevicePasswordEnable
(boolean enableReadOnly, boolean enableReadWrite, boolean enableWriteOnly) Enables/Disables passwords for this Device.void
setDevicePasswordEnableAll
(boolean enableAll) Enables/Disables passwords for this device.void
setDeviceReadOnlyPassword
(byte[] password, int offset) Writes the given password to the device's Read-Only password register.void
setDeviceReadWritePassword
(byte[] password, int offset) Writes the given password to the device's Read/Write password register.void
setDeviceWriteOnlyPassword
(byte[] password, int offset) Writes the given password to the device's Write-Only password register.
-
Method Details
-
getReadOnlyPasswordLength
Returns the length in bytes of the Read-Only password.- Returns:
- the length in bytes of the Read-Only password.
- Throws:
OneWireException
-
getReadWritePasswordLength
Returns the length in bytes of the Read/Write password.- Returns:
- the length in bytes of the Read/Write password.
- Throws:
OneWireException
-
getWriteOnlyPasswordLength
Returns the length in bytes of the Write-Only password.- Returns:
- the length in bytes of the Write-Only password.
- Throws:
OneWireException
-
getReadOnlyPasswordAddress
Returns the absolute address of the memory location where the Read-Only password is written.- Returns:
- the absolute address of the memory location where the Read-Only password is written.
- Throws:
OneWireException
-
getReadWritePasswordAddress
Returns the absolute address of the memory location where the Read/Write password is written.- Returns:
- the absolute address of the memory location where the Read/Write password is written.
- Throws:
OneWireException
-
getWriteOnlyPasswordAddress
Returns the absolute address of the memory location where the Write-Only password is written.- Returns:
- the absolute address of the memory location where the Write-Only password is written.
- Throws:
OneWireException
-
hasReadOnlyPassword
boolean hasReadOnlyPassword()Returns true if this device has a Read-Only password. If false, all other functions dealing with the Read-Only password will throw an exception if called.- Returns:
true
if this device has a Read-Only password.
-
hasReadWritePassword
boolean hasReadWritePassword()Returns true if this device has a Read/Write password. If false, all other functions dealing with the Read/Write password will throw an exception if called.- Returns:
true
if this device has a Read/Write password.
-
hasWriteOnlyPassword
boolean hasWriteOnlyPassword()Returns true if this device has a Write-Only password. If false, all other functions dealing with the Write-Only password will throw an exception if called.- Returns:
true
if this device has a Write-Only password.
-
getDeviceReadOnlyPasswordEnable
Returns true if the device's Read-Only password has been enabled.- Returns:
true
if the device's Read-Only password has been enabled.- Throws:
OneWireException
-
getDeviceReadWritePasswordEnable
Returns true if the device's Read/Write password has been enabled.- Returns:
true
if the device's Read/Write password has been enabled.- Throws:
OneWireException
-
getDeviceWriteOnlyPasswordEnable
Returns true if the device's Write-Only password has been enabled.- Returns:
true
if the device's Write-Only password has been enabled.- Throws:
OneWireException
-
hasSinglePasswordEnable
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.- Returns:
true
if the device has the capability to enable one type of password while leaving another type disabled.
-
setDevicePasswordEnable
void setDevicePasswordEnable(boolean enableReadOnly, boolean enableReadWrite, boolean enableWriteOnly) throws OneWireException, OneWireIOException Enables/Disables passwords for this Device. This method allows you to individually enable the different types of passwords for a particular device. If
hasSinglePasswordEnable()
returns true, you can selectively enable particular types of passwords. Otherwise, this method will throw an exception if all supported types are not enabled.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.
- Parameters:
enableReadOnly
- iftrue
Read-Only passwords will be enabled.enableReadWrite
- iftrue
Read/Write passwords will be enabled.enableWriteOnly
- iftrue
Write-Only passwords will be enabled.- Throws:
OneWireException
OneWireIOException
-
setDevicePasswordEnableAll
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:
owc41.setDevicePasswordEnable( owc41.hasReadOnlyPassword(), owc41.hasReadWritePassword(), owc41.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.
- Parameters:
enableAll
- iftrue
, all passwords are enabled. Otherwise, all passwords are disabled.- Throws:
OneWireException
OneWireIOException
-
setDeviceReadOnlyPassword
void setDeviceReadOnlyPassword(byte[] password, int offset) throws OneWireException, OneWireIOException Writes the given password to the device's Read-Only password register. Note that this function does not enable the password, just writes the value to the appropriate memory location.
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.
- Parameters:
password
- the new password to be written to the device's Read-Only password register. Length must be(offset + getReadOnlyPasswordLength)
offset
- the starting point for copying from the given password array- Throws:
OneWireException
OneWireIOException
-
setDeviceReadWritePassword
void setDeviceReadWritePassword(byte[] password, int offset) throws OneWireException, OneWireIOException Writes the given password to the device's Read/Write password register. Note that this function does not enable the password, just writes the value to the appropriate memory location.
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.
- Parameters:
password
- the new password to be written to the device's Read-Write password register. Length must be(offset + getReadWritePasswordLength)
offset
- the starting point for copying from the given password array- Throws:
OneWireException
OneWireIOException
-
setDeviceWriteOnlyPassword
void setDeviceWriteOnlyPassword(byte[] password, int offset) throws OneWireException, OneWireIOException Writes the given password to the device's Write-Only password register. Note that this function does not enable the password, just writes the value to the appropriate memory location.
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.
- Parameters:
password
- the new password to be written to the device's Write-Only password register. Length must be(offset + getWriteOnlyPasswordLength)
offset
- the starting point for copying from the given password array- Throws:
OneWireException
OneWireIOException
-
setContainerReadOnlyPassword
Sets the Read-Only password used by the API when reading from the device's memory. This password is not written to the device's Read-Only password register. It is the password used by the software for interacting with the device only.- Parameters:
password
- the new password to be used by the API when reading from the device's memory. Length must be(offset + getReadOnlyPasswordLength)
offset
- the starting point for copying from the given password array- Throws:
OneWireException
-
setContainerReadWritePassword
Sets the Read/Write password used by the API when reading from or writing to the device's memory. This password is not written to the device's Read/Write password register. It is the password used by the software for interacting with the device only.- Parameters:
password
- the new password to be used by the API when reading from or writing to the device's memory. Length must be(offset + getReadWritePasswordLength)
offset
- the starting point for copying from the given password array- Throws:
OneWireException
-
setContainerWriteOnlyPassword
Sets the Write-Only password used by the API when writing to the device's memory. This password is not written to the device's Write-Only password register. It is the password used by the software for interacting with the device only.- Parameters:
password
- the new password to be used by the API when writing to the device's memory. Length must be(offset + getWriteOnlyPasswordLength)
offset
- the starting point for copying from the given password array- Throws:
OneWireException
-
isContainerReadOnlyPasswordSet
Returns true if the password used by the API for reading from the device's memory 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.- Returns:
true
if the password used by the API for reading from the device's memory has been set.- Throws:
OneWireException
-
isContainerReadWritePasswordSet
Returns true if the password used by the API for reading from or writing to the device's memory 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.- Returns:
true
if the password used by the API for reading from or writing to the device's memory has been set.- Throws:
OneWireException
-
isContainerWriteOnlyPasswordSet
Returns true if the password used by the API for writing to the device's memory has been set. The return value is not affected by whether or not the write password of the container actually matches the value in the device's password register.- Returns:
true
if the password used by the API for writing to the device's memory has been set.- Throws:
OneWireException
-
getContainerReadOnlyPassword
Gets the Read-Only password used by the API when reading from the device's memory. This password is not read from the device's Read-Only password register. It is the password used by the software for interacting with the device only and must have been set using thesetContainerReadOnlyPassword
method.- Parameters:
password
- array for holding the password that is used by the API when reading from the device's memory. Length must be(offset + getWriteOnlyPasswordLength)
offset
- the starting point for copying into the given password array- Throws:
OneWireException
-
getContainerReadWritePassword
Gets the Read/Write password used by the API when reading from or writing to the device's memory. This password is not read from the device's Read/Write password register. It is the password used by the software for interacting with the device only and must have been set using thesetContainerReadWritePassword
method.- Parameters:
password
- array for holding the password that is used by the API when reading from or writing to the device's memory. Length must be(offset + getReadWritePasswordLength)
offset
- the starting point for copying into the given password array- Throws:
OneWireException
-
getContainerWriteOnlyPassword
Gets the Write-Only password used by the API when writing to the device's memory. This password is not read from the device's Write-Only password register. It is the password used by the software for interacting with the device only and must have been set using thesetContainerWriteOnlyPassword
method.- Parameters:
password
- array for holding the password that is used by the API when writing to the device's memory. Length must be(offset + getWriteOnlyPasswordLength)
offset
- the starting point for copying into the given password array- Throws:
OneWireException
-