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

OTPMemoryBank Interface Reference

Inherits com::dalsemi::onewire::container::PagedMemoryBank.

Inherited by MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

List of all members.

Public Member Functions

boolean canRedirectPage ()
 Checks to see if this memory bank has pages that can be redirected to a new page.
boolean canLockPage ()
 Checks to see if this memory bank has pages that can be locked.
boolean canLockRedirectPage ()
 Checks to see if this memory bank has pages that can be locked from being redirected.
void lockPage (int page) throws OneWireIOException, OneWireException
 Locks the specifed page in this memory bank.
boolean isPageLocked (int page) throws OneWireIOException, OneWireException
 Checks to see if the specified page is locked.
void redirectPage (int page, int newPage) throws OneWireIOException, OneWireException
 Redirects the specifed page to a new page.
int isPageRedirected (int page) throws OneWireIOException, OneWireException
 Checks to see if the specified page is redirected.
int getRedirectedPage (int page) throws OneWireIOException, OneWireException
 Gets the page redirection of the specified page.
void lockRedirectPage (int page) throws OneWireIOException, OneWireException
 Locks the redirection of the specifed page.
boolean isRedirectPageLocked (int page) throws OneWireIOException, OneWireException
 Checks to see if the specified page has redirection locked.

Detailed Description

One-Time-Programmable (OTP) Memory bank interface for iButtons (or 1-Wire devices) with OTP features. This interface extents the base functionality of the super-interfaces MemoryBank and PagedMemoryBank by providing One-Time-Programmable services.

The OTPMemoryBank methods can be organized into the following categories:

Usage

Example 1

Read the OTP status of page 0 in the OTPMemoryBank instance 'otp':

 
  if (otp.canRedirectPage())
  {
     int new_page = getRedirectedPage(0);
     if (new_page != 0)
        System.out.println("Page 0 is redirected to " + new_page);
  }
  if (otp.canLockPage())
  {
     if (otp.isPageLocked(0))
        System.out.println("Page 0 is locked");
  }
  if (otp.canLockRedirectPage())
  {
     if (otp.isRedirectPageLocked(0))
        System.out.println("Page 0 redirection is locked");
  }
  

Example 1

Lock all of the pages in the OTPMemoryBank instance 'otp':

 
  if (otp.canLockPage())
  {
     // loop to lock each page  
     for (int pg = 0; pg < otp.getNumberPages(); pg++)
     {
        otp.lockPage(pg);
     }
  }
  else
     System.out.println("OTPMemoryBank does not support page locking");
  
See also:
com.dalsemi.onewire.container.MemoryBank
com.dalsemi.onewire.container.PagedMemoryBank
com.dalsemi.onewire.container.OneWireContainer09
com.dalsemi.onewire.container.OneWireContainer0B
com.dalsemi.onewire.container.OneWireContainer0F
com.dalsemi.onewire.container.OneWireContainer12
com.dalsemi.onewire.container.OneWireContainer13
Version:
0.01, 11 Dec 2000
Author:
DS

Member Function Documentation

boolean canLockPage ( )

Checks to see if this memory bank has pages that can be locked.

A locked page would prevent any changes to it's contents.

Returns:
true if this memory bank has pages that can be locked
See also:
lockPage(int) lockPage
isPageLocked(int) isPageLocked

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

boolean canLockRedirectPage ( )

Checks to see if this memory bank has pages that can be locked from being redirected.

This would prevent a Write-Once memory from being updated.

Returns:
true if this memory bank has pages that can be locked from being redirected to a new page
See also:
lockRedirectPage(int) lockRedirectPage
isRedirectPageLocked(int) isRedirectPageLocked

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

boolean canRedirectPage ( )

Checks to see if this memory bank has pages that can be redirected to a new page.

This is used in Write-Once memory to provide a means to update.

Returns:
true if this memory bank pages can be redirected to a new page
See also:
redirectPage(int,int) redirectPage
getRedirectedPage(int) getRedirectedPage

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

int getRedirectedPage ( int  page) throws OneWireIOException, OneWireException

Gets the page redirection of the specified page.

Not supported by all devices.

Parameters:
pagepage to check for redirection
Returns:
the new page number or 0 if not redirected
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as no device present or a CRC read from the device is incorrect. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireExceptionon a communication or setup error with the 1-Wire adapter.
See also:
canRedirectPage() canRedirectPage
redirectPage(int,int) redirectPage
Since:
1-Wire API 0.01

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

boolean isPageLocked ( int  page) throws OneWireIOException, OneWireException

Checks to see if the specified page is locked.

Parameters:
pagepage to check
Returns:
true if page is locked
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as no device present or a CRC read from the device is incorrect. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireExceptionon a communication or setup error with the 1-Wire adapter.
See also:
lockPage(int) lockPage
canLockPage() canLockPage

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

int isPageRedirected ( int  page) throws OneWireIOException, OneWireException

Checks to see if the specified page is redirected.

Not supported by all devices.

Parameters:
pagepage to check for redirection
Returns:
the new page number or 0 if not redirected
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as no device present or a CRC read from the device is incorrect. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireExceptionon a communication or setup error with the 1-Wire adapter.
See also:
canRedirectPage() canRedirectPage
redirectPage(int,int) redirectPage
Deprecated:
As of 1-Wire API 0.01, replaced by getRedirectedPage(int)

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

boolean isRedirectPageLocked ( int  page) throws OneWireIOException, OneWireException

Checks to see if the specified page has redirection locked.

Not supported by all devices.

Parameters:
pagepage to check for locked redirection
Returns:
true if redirection is locked for this page
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as no device present or a CRC read from the device is incorrect. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireExceptionon a communication or setup error with the 1-Wire adapter.
See also:
canLockRedirectPage() canLockRedirectPage
lockRedirectPage(int) lockRedirectPage

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

void lockPage ( int  page) throws OneWireIOException, OneWireException

Locks the specifed page in this memory bank.

Not supported by all devices.

Parameters:
pagenumber of page to lock
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as no device present or a read back verification fails. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireExceptionon a communication or setup error with the 1-Wire adapter. It will also be thrown if the device needs 'program' voltage and the adapter used by this device does not support it.
See also:
isPageLocked(int) isPageLocked
canLockPage() canLockPage
com.dalsemi.onewire.adapter.DSPortAdapter.canProgram() DSPortAdapter.canProgram()

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

void lockRedirectPage ( int  page) throws OneWireIOException, OneWireException

Locks the redirection of the specifed page.

Not supported by all devices.

Parameters:
pagepage to redirect
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as no device present or a CRC read from the device is incorrect. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireExceptionon a communication or setup error with the 1-Wire adapter. It will also be thrown if the device needs 'program' voltage and the adapter used by this device does not support it.
See also:
canLockRedirectPage() canLockRedirectPage
isRedirectPageLocked(int) isRedirectPageLocked
com.dalsemi.onewire.adapter.DSPortAdapter.canProgram() DSPortAdapter.canProgram()

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.

void redirectPage ( int  page,
int  newPage 
) throws OneWireIOException, OneWireException

Redirects the specifed page to a new page.

Not supported by all devices.

Parameters:
pagenumber of page to redirect
newPagenew page number to redirect to
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as no device present or a CRC read from the device is incorrect. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireExceptionon a communication or setup error with the 1-Wire adapter. It will also be thrown if the device needs 'program' voltage and the adapter used by this device does not support it.
See also:
canRedirectPage() canRedirectPage
getRedirectedPage(int) getRedirectedPage
com.dalsemi.onewire.adapter.DSPortAdapter.canProgram() DSPortAdapter.canProgram()

Implemented in MemoryBankAppReg, MemoryBankEEPROM, MemoryBankEEPROMblock, and MemoryBankEPROM.


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