MemoryBankNVCRC Class Reference

Inherits com::dalsemi::onewire::container::MemoryBankNV.

Inherited by MemoryBankNVCRCPW.

List of all members.


Detailed Description

Memory bank class for the NVRAM with build in CRC section of iButtons and 1-Wire devices.

Version:
0.00, 28 Aug 2000
Author:
DS

Public Member Functions

 MemoryBankNVCRC (OneWireContainer ibutton, ScratchPad scratch)
 Memory bank contstuctor.
void readPage (int page, boolean readContinue, byte[] readBuf, int offset) throws OneWireIOException, OneWireException
 Read page in the current bank with no CRC checking (device or data).
void readPage (int page, boolean readContinue, byte[] readBuf, int offset, byte[] extraInfo) throws OneWireIOException, OneWireException
 Read page with extra information in the current bank with no CRC checking (device or data).
int readPagePacket (int page, boolean readContinue, byte[] readBuf, int offset, byte[] extraInfo) throws OneWireIOException, OneWireException
 Read a Universal Data Packet and extra information.
void readPageCRC (int page, boolean readContinue, byte[] readBuf, int offset) throws OneWireIOException, OneWireException
 Read a complete memory page with CRC verification provided by the device.
void readPageCRC (int page, boolean readContinue, byte[] readBuf, int offset, byte[] extraInfo) throws OneWireIOException, OneWireException
 Read a complete memory page with CRC verification provided by the device with extra information.

Static Public Attributes

static final byte READ_PAGE_WITH_CRC = ( byte ) 0xA5
 Write Scratchpad Command.

Protected Member Functions

void readPageCRC (int page, boolean readContinue, byte[] readBuf, int offset, byte[] extraInfo, int extraLength) throws OneWireIOException, OneWireException
 Read a complete memory page with CRC verification provided by the device with extra information.

Protected Attributes

boolean readContinuePossible
 Flag to indicate if read-continue is possible.
int numVerifyBytes
 Number of extra verify byte in the read CRC page.

Constructor & Destructor Documentation

MemoryBankNVCRC ( OneWireContainer  ibutton,
ScratchPad  scratch 
)

Memory bank contstuctor.

Requires reference to the OneWireContainer this memory bank resides on.


Member Function Documentation

void readPage ( int  page,
boolean  readContinue,
byte[]  readBuf,
int  offset 
) throws OneWireIOException, OneWireException

Read page in the current bank with no CRC checking (device or data).

The resulting data from this API may or may not be what is on the 1-Wire device. It is recommends that the data contain some kind of checking (CRC) like in the readPagePacket() method or have the 1-Wire device provide the CRC as in readPageCRC(). readPageCRC() however is not supported on all memory types, see 'hasPageAutoCRC()'. If neither is an option then this method could be called more then once to at least verify that the same thing is read consistantly.

Parameters:
page page number to read packet from
readContinue if 'true' then device read is continued without re-selecting. This can only be used if the new readPage() continious where the last one led off and it is inside a 'beginExclusive/endExclusive' block.
readBuf byte array to place read data into
offset offset into readBuf to place data
Exceptions:
OneWireIOException 
OneWireException 

Reimplemented from MemoryBankNV.

void readPage ( int  page,
boolean  readContinue,
byte[]  readBuf,
int  offset,
byte[]  extraInfo 
) throws OneWireIOException, OneWireException

Read page with extra information in the current bank with no CRC checking (device or data).

The resulting data from this API may or may not be what is on the 1-Wire device. It is recommends that the data contain some kind of checking (CRC) like in the readPagePacket() method or have the 1-Wire device provide the CRC as in readPageCRC(). readPageCRC() however is not supported on all memory types, see 'hasPageAutoCRC()'. If neither is an option then this method could be called more then once to at least verify that the same thing is read consistantly. See the method 'hasExtraInfo()' for a description of the optional extra information some devices have.

Parameters:
page page number to read packet from
readContinue if 'true' then device read is continued without re-selecting. This can only be used if the new readPage() continious where the last one led off and it is inside a 'beginExclusive/endExclusive' block.
readBuf byte array to place read data into
offset offset into readBuf to place data
extraInfo byte array to put extra info read into
Exceptions:
OneWireIOException 
OneWireException 

Reimplemented from MemoryBankNV.

int readPagePacket ( int  page,
boolean  readContinue,
byte[]  readBuf,
int  offset,
byte[]  extraInfo 
) throws OneWireIOException, OneWireException

Read a Universal Data Packet and extra information.

See the method 'readPagePacket()' for a description of the packet structure. See the method 'hasExtraInfo()' for a description of the optional extra information some devices have.

Parameters:
page page number to read packet from
readContinue if 'true' then device read is continued without re-selecting. This can only be used if the new readPagePacket() continious where the last one stopped and it is inside a 'beginExclusive/endExclusive' block.
readBuf byte array to put data read. Must have at least 'getMaxPacketDataLength()' elements.
offset offset into readBuf to place data
extraInfo byte array to put extra info read into
Returns:
number of data bytes written to readBuf at the offset.
Exceptions:
OneWireIOException 
OneWireException 

Reimplemented from MemoryBankNV.

void readPageCRC ( int  page,
boolean  readContinue,
byte[]  readBuf,
int  offset 
) throws OneWireIOException, OneWireException

Read a complete memory page with CRC verification provided by the device.

Not supported by all devices. See the method 'hasPageAutoCRC()'.

Parameters:
page page number to read
readContinue if 'true' then device read is continued without re-selecting. This can only be used if the new readPagePacket() continious where the last one stopped and it is inside a 'beginExclusive/endExclusive' block.
readBuf byte array to put data read. Must have at least 'getMaxPacketDataLength()' elements.
offset offset into readBuf to place data
Exceptions:
OneWireIOException 
OneWireException 

Reimplemented from MemoryBankNV.

void readPageCRC ( int  page,
boolean  readContinue,
byte[]  readBuf,
int  offset,
byte[]  extraInfo 
) throws OneWireIOException, OneWireException

Read a complete memory page with CRC verification provided by the device with extra information.

Not supported by all devices. See the method 'hasPageAutoCRC()'. See the method 'hasExtraInfo()' for a description of the optional extra information.

Parameters:
page page number to read
readContinue if 'true' then device read is continued without re-selecting. This can only be used if the new readPagePacket() continious where the last one stopped and it is inside a 'beginExclusive/endExclusive' block.
readBuf byte array to put data read. Must have at least 'getMaxPacketDataLength()' elements.
offset offset into readBuf to place data
extraInfo byte array to put extra info read into
Exceptions:
OneWireIOException 
OneWireException 

Reimplemented from MemoryBankNV.

Reimplemented in MemoryBankNVCRCPW.

void readPageCRC ( int  page,
boolean  readContinue,
byte[]  readBuf,
int  offset,
byte[]  extraInfo,
int  extraLength 
) throws OneWireIOException, OneWireException [protected]

Read a complete memory page with CRC verification provided by the device with extra information.

Not supported by all devices. If not extra information available then just call with extraLength=0.

Parameters:
page page number to read
readContinue if 'true' then device read is continued without re-selecting. This can only be used if the new readPagePacket() continious where the last one stopped and it is inside a 'beginExclusive/endExclusive' block.
readBuf byte array to put data read. Must have at least 'getMaxPacketDataLength()' elements.
offset offset into readBuf to place data
extraInfo byte array to put extra info read into
extraLength length of extra information
Exceptions:
OneWireIOException 
OneWireException 

Reimplemented in MemoryBankNVCRCPW.


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

Generated on Thu Aug 28 15:42:33 2008 for 1-Wire API for .NET by  doxygen 1.5.6