Public Member Functions | |
MemoryBankScratchSHAEE (OneWireContainer33 ibutton) | |
Memory bank contstuctor. | |
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. | |
void | readScratchpad (byte[] readBuf, int offset, int len, byte[] extraInfo) throws OneWireIOException, OneWireException |
Read the scratchpad page of memory from a NVRAM device This method reads and returns the entire scratchpad after the byte offset regardless of the actual ending offset. | |
void | copyScratchpad (int addr, int len) throws OneWireIOException, OneWireException |
Copy the scratchpad page to memory. | |
void | copyScratchpad (int addr, byte[] scratchpad, int offset) throws OneWireIOException, OneWireException |
Copy the scratchpad page to memory. | |
void | copyScratchpad (int addr, byte[] scratchpad, int scratchpadOffset, byte[] pageData, int pageDataOffset) throws OneWireIOException, OneWireException |
Copy the scratchpad page to memory. | |
void | copyScratchpadWithMAC (int addr, byte[] authMAC, int authOffset) throws OneWireIOException, OneWireException |
Copy all 8 bytes of the Sratch Pad to a certain address in memory using the provided authorization MAC. | |
void | writeScratchpad (int addr, byte[] writeBuf, int offset, int len) throws OneWireIOException, OneWireException |
Write to the scratchpad page of memory a NVRAM device. | |
void | write (int addr, byte[] writeBuf, int offset, int len) throws OneWireIOException, OneWireException |
Write memory in the current bank. | |
void | loadFirstSecret (int addr, byte[] data, int offset) throws OneWireIOException, OneWireException |
Load First Secret for the DS2432. | |
void | loadFirstSecret (int addr) throws OneWireIOException, OneWireException |
Load First Secret for the DS2432. | |
void | computeNextSecret (int addr) throws OneWireIOException, OneWireException |
Computes the next secret. | |
void | computeNextSecret (int addr, byte[] partialsecret, int offset) throws OneWireIOException, OneWireException |
Computes the next secret. | |
void | refreshScratchpad (int addr) throws OneWireIOException, OneWireException |
Refreshes the scratchpad for DS1961S. | |
Static Public Attributes | |
static final byte | LOAD_FIRST_SECRET = ( byte ) 0x5A |
Load First Secret. | |
static final byte | COMPUTE_NEXT_SECRET = ( byte ) 0x33 |
Compute next Secret command. | |
static final byte | REFRESH_SCRATCHPAD = ( byte ) 0xA3 |
Refresh Scratchpad command. | |
Protected Attributes | |
OneWireContainer33 | owc33 = null |
The Password container to acces the 8 byte passwords. | |
Static Protected Attributes | |
static final byte[] | ffBlock = OneWireContainer33.ffBlock |
block of 0xFF's used for faster read pre-fill of 1-Wire blocks Comes from OneWireContainer33 that this MemoryBank references. | |
static final byte[] | zeroBlock = OneWireContainer33.zeroBlock |
block of 0x00's used for faster read pre-fill of 1-Wire blocks Comes from OneWireContainer33 that this MemoryBank references. |
MemoryBankScratchSHAEE | ( | OneWireContainer33 | ibutton | ) |
Memory bank contstuctor.
Requires reference to the OneWireContainer this memory bank resides on.
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()'.
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 |
OneWireIOException | ||
OneWireException |
Reimplemented from MemoryBankScratch.
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.
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 |
OneWireIOException | ||
OneWireException |
Reimplemented from MemoryBankScratch.
void readScratchpad | ( | byte[] | readBuf, | |
int | offset, | |||
int | len, | |||
byte[] | extraInfo | |||
) | throws OneWireIOException, OneWireException |
Read the scratchpad page of memory from a NVRAM device This method reads and returns the entire scratchpad after the byte offset regardless of the actual ending offset.
readBuf | byte array to place read data into length of array is always pageLength. | |
offset | offset into readBuf to pug data | |
len | length in bytes to read | |
extraInfo | byte array to put extra info read into (TA1, TA2, e/s byte) length of array is always extraInfoLength. Can be 'null' if extra info is not needed. |
OneWireIOException | ||
OneWireException |
Reimplemented from MemoryBankScratch.
void copyScratchpad | ( | int | addr, | |
int | len | |||
) | throws OneWireIOException, OneWireException |
Copy the scratchpad page to memory.
addr | the address to copy the data to | |
len | length byte is ignored, must always be 8. |
OneWireIOException | ||
OneWireException |
Reimplemented from MemoryBankScratchEx.
void copyScratchpad | ( | int | addr, | |
byte[] | scratchpad, | |||
int | offset | |||
) | throws OneWireIOException, OneWireException |
Copy the scratchpad page to memory.
addr | the address to copy to | |
scratchpad | the scratchpad contents that will be copied | |
offset | the offset into scratchpad byte[] where scratchpad data begins |
OneWireIOException | ||
OneWireException |
void copyScratchpad | ( | int | addr, | |
byte[] | scratchpad, | |||
int | scratchpadOffset, | |||
byte[] | pageData, | |||
int | pageDataOffset | |||
) | throws OneWireIOException, OneWireException |
Copy the scratchpad page to memory.
addr | the address to copy to | |
scratchpad | the scratchpad contents that will be copied | |
scratchpadOffset | the offset into scratchpad byte[] where scratchpad data begins | |
pageData | the data on the page of memory to be written to | |
pageDataOffset | the offset into pageData byte[] where pageData begins |
OneWireIOException | ||
OneWireException |
void copyScratchpadWithMAC | ( | int | addr, | |
byte[] | authMAC, | |||
int | authOffset | |||
) | throws OneWireIOException, OneWireException |
Copy all 8 bytes of the Sratch Pad to a certain address in memory using the provided authorization MAC.
addr | the address to copy the data to | |
authMAC | byte[] containing write authorization MAC | |
authOffset | offset into authMAC where authorization MAC begins |
OneWireIOException | ||
OneWireException |
void writeScratchpad | ( | int | addr, | |
byte[] | writeBuf, | |||
int | offset, | |||
int | len | |||
) | throws OneWireIOException, OneWireException |
Write to the scratchpad page of memory a NVRAM device.
addr | physical address to copy data to | |
writeBuf | byte array containing data to write | |
offset | offset into readBuf to place data | |
len | length in bytes to write |
OneWireIOException | ||
OneWireException |
Reimplemented from MemoryBankScratchEx.
void write | ( | int | addr, | |
byte[] | writeBuf, | |||
int | offset, | |||
int | len | |||
) | throws OneWireIOException, OneWireException |
Write memory in the current bank.
It is recommended that when writing data that some structure in the data is created to provide error free reading back with read(). Or the method 'writePagePacket()' could be used which automatically wraps the data in a length and CRC.
When using on Write-Once devices care must be taken to write into into empty space. If write() is used to write over an unlocked page on a Write-Once device it will fail. If write verification is turned off with the method 'setWriteVerification(false)' then the result will be an 'AND' of the existing data and the new data.
addr | the address to write to | |
writeBuf | byte array containing data to write | |
offset | offset into writeBuf to get data | |
len | length in bytes to write |
OneWireIOException | ||
OneWireException |
Reimplemented from MemoryBankScratch.
void loadFirstSecret | ( | int | addr, | |
byte[] | data, | |||
int | offset | |||
) | throws OneWireIOException, OneWireException |
Load First Secret for the DS2432.
Loads the specified data to the specified location. If the address is data memory (instead of secret memory), this command must have been preceded by a Refresh Scratchpad command for it to be successful.
addr | the address to write the data to | |
data | the data to 'load' with the Load First Secret command | |
offset | the offset to use for reading the data byte[] |
OneWireIOException | ||
OneWireException |
void loadFirstSecret | ( | int | addr | ) | throws OneWireIOException, OneWireException |
Load First Secret for the DS2432.
Loads current contents of the scratchpad to the specified location. If the address is data memory (instead of secret memory), this command must have been preceded by a Refresh Scratchpad command for it to be successful.
addr | the address to write the data to |
OneWireIOException | ||
OneWireException |
void computeNextSecret | ( | int | addr | ) | throws OneWireIOException, OneWireException |
Computes the next secret.
addr | the physical address of the page to use for secret computation | |
partialsecret | byte array containing next partial secret for writing to the scratchpad |
OneWireIOException | ||
OneWireException |
void computeNextSecret | ( | int | addr, | |
byte[] | partialsecret, | |||
int | offset | |||
) | throws OneWireIOException, OneWireException |
Computes the next secret.
addr | the physical address of the page to use for secret computation | |
partialsecret | byte array containing next partial secret for writing to the scratchpad | |
offset | into partialsecret byte array to start reading |
OneWireIOException | ||
OneWireException |
void refreshScratchpad | ( | int | addr | ) | throws OneWireIOException, OneWireException |
Refreshes the scratchpad for DS1961S.
Command has no effect on DS2432 devices. After this command is executed, the data at the address specified will be loaded into the scratchpad. The Load First Secret command can then be used to re-write the data back to the page, correcting any weakly-programmed EEPROM bits.
addr | the address to load the data from into the scratchpad |
OneWireIOException | ||
OneWireException |