1-Wire API for .NET Version 4.00
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes

MemoryBankNVCRC Class Reference

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

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

Inherited by MemoryBankNVCRCPW.

List of all members.

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.

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

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:
pagepage number to read packet from
readContinueif '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.
readBufbyte array to place read data into
offsetoffset 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:
pagepage number to read packet from
readContinueif '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.
readBufbyte array to place read data into
offsetoffset into readBuf to place data
extraInfobyte array to put extra info read into
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:
pagepage number to read
readContinueif '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.
readBufbyte array to put data read. Must have at least 'getMaxPacketDataLength()' elements.
offsetoffset into readBuf to place data
extraInfobyte 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 
) 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:
pagepage number to read
readContinueif '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.
readBufbyte array to put data read. Must have at least 'getMaxPacketDataLength()' elements.
offsetoffset into readBuf to place data
Exceptions:
OneWireIOException
OneWireException

Reimplemented from MemoryBankNV.

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:
pagepage number to read
readContinueif '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.
readBufbyte array to put data read. Must have at least 'getMaxPacketDataLength()' elements.
offsetoffset into readBuf to place data
extraInfobyte array to put extra info read into
extraLengthlength of extra information
Exceptions:
OneWireIOException
OneWireException

Reimplemented in MemoryBankNVCRCPW.

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:
pagepage number to read packet from
readContinueif '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.
readBufbyte array to put data read. Must have at least 'getMaxPacketDataLength()' elements.
offsetoffset into readBuf to place data
extraInfobyte array to put extra info read into
Returns:
number of data bytes written to readBuf at the offset.
Exceptions:
OneWireIOException
OneWireException

Reimplemented from MemoryBankNV.


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