Class OneWireContainer18
1-Wire® container for a SHA Transaction iButton, DS1963S. This container encapsulates the functionality of the 1-Wire family type 18 (hex).
Features
- 4096 bits of read/write nonvolatile memory organized into 16 pages
- 8 memory pages have 64-bit secrets and 32-bit read-only, non-rolling over write cycle counters
- Secrets are write only and have their own write cycle counters
- On-chip 512-bit SHA-1 engine to compute 160-bit Message Authentication Codes
- 256-bit scratchpad ensures integrity of data transfer
- On-chip 16-bit CRC generator for safeguarding data transfers
- Overdrive mode supports communication up to 142 kbits per second
This container provides the functionality to use the raw power of the
DS1963S. It does not immediately implement transactions and authentication.
The class SHAiButton
does these. The SHAiButton
class exists on top of
this class, making higher level calls to implement transactions.
This container makes use of several optimizations to help it run fast on
TINI. These optimizations do little for the PC, but they do not slow down the
PC. Most methods are synchronized
because they access an
instance byte array. This is less expensive than creating new byte arrays for
every method, because there should not be contention for the resources in
this container between threads. Threads should use the
com.dalsemi.onewire.adapter.DSPortAdapter
methods
beginExclusive(boolean)
and endExclusive()
to
synchronize on the 1-Wire port.
Notice that for maximum performance, programs should call the method
setSpeedCheck(boolean)
with an argument false
before any other methods that access the 1-Wire. A program that calls this
function is assumed to understand and control the speed of communication on
the 1-Wire bus. If the speed check is not disabled, a call to the method
OneWireContainer.doSpeed()
will occur in almost every function.
While this should guarantee that the 1-Wire bus is never at an unknown speed,
it will slow down throughput considerably.
Memory
In the interest of speed, this container has several methods to quickly access the memory of a DS9163S. These methods include:
The memory can also be accessed through the objects that are returned from
the getMemoryBanks
method.
- Scratchpad with CRC and auto-hide
- Implements
MemoryBank
,PagedMemoryBank
- Size 32 starting at physical address 0
- Features Read/Write not-general-purpose volatile
- Pages 1 page of length 32 bytes
- Page Features page-device-CRC
- Extra information for each page Target address, offset, length 3
- Implements
- Main Memory
- Implements
MemoryBank
,PagedMemoryBank
- Size 256 starting at physical address 0
- Features Read/Write general-purpose non-volatile
- Pages 8 pages of length 32 bytes giving 29 bytes Packet data payload
- Page Features page-device-CRC
- Implements
- Memory with write cycle counter
- Implements
MemoryBank
,PagedMemoryBank
- Size 256 starting at physical address 256
- Features Read/Write general-purpose non-volatile
- Pages 8 pages of length 32 bytes giving 29 bytes Packet data payload
- Page Features page-device-CRC
- Extra information for each page Write cycle counter, length 3
- Implements
- Write cycle counters and PRNG counter
- Implements
MemoryBank
,PagedMemoryBank
- Size 96 starting at physical address 608
- Features Read-only not-general-purpose non-volatile
- Pages 3 pages of length 32 bytes
- Implements
Usage
For examples on using the SHA iButton for transactions and authentications,
see the examples in the
SHAiButton
usage
section.
- See the usage example in
OneWireContainer
to enumerate the MemoryBanks. - See the usage examples in
MemoryBank
andPagedMemoryBank
for bank specific operations.
DataSheet
Note that the protocol for transactions using SHA iButtons calls for 2 iButtons. One belongs to the system that grants authentication and is authorized to validate money. This iButton is usually called the Coprocessor. The other iButton is the device that contains digital money that must be authenticated and verified to perform transactions. This iButton is usually called a User iButton, Roaming iButton, or Roving iButton.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
Fields inherited from class com.dalsemi.onewire.container.OneWireContainer
adapter, address, speed, speedFallBackOK
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newOneWireContainer
for communication with a DS1963S SHA iButton.OneWireContainer18
(DSPortAdapter sourceAdapter, byte[] newAddress) Creates a newOneWireContainer
for communication with a DS1963S SHA iButton.OneWireContainer18
(DSPortAdapter sourceAdapter, long newAddress) Creates a newOneWireContainer
for communication with a DS1963S SHA iButton.OneWireContainer18
(DSPortAdapter sourceAdapter, String newAddress) Creates a newOneWireContainer
for communication with a DS1963S SHA iButton. -
Method Summary
Modifier and TypeMethodDescriptionboolean
bindSecretToiButton
(int page, byte[] bind_data, byte[] bind_code, int secret_number) Binds an installed secret to a DS1963S by using well-known binding data and the DS1963S's unique address.boolean
Copies the contents of the scratchpad to the target destination that was specified in a call towriteScratchPad()
oreraseScratchPad()
.boolean
eraseScratchPad
(int page) Erases the scratchpad of the DS1963S.Retrieve the alternate Maxim Integrated Products part numbers or names.Get a short description of the function of this iButton or 1-Wire Device type.int
Returns the maximum speed this iButton device can communicate at.Gets an enumeration of memory bank instances that implement one or more of the following interfaces:MemoryBank
,PagedMemoryBank
, andOTPMemoryBank
.getName()
Get the Maxim Integrated Products part number of the iButton or 1-Wire Device as ajava.lang.String
.boolean
installMasterSecret
(int page, byte[] secret, int secret_number) Installs a secret on a DS1963S.boolean
matchScratchPad
(byte[] mac) Verifies the hidden signature in the scratchpad of the DS1963S.boolean
readAuthenticatedPage
(int pageNum, byte[] data, int start) Reads and authenticates a page.void
readMemoryPage
(int pageNum, byte[] data, int start) Reads a memory page from the DS1963S.int
readScratchPad
(byte[] data, int start) Reads the contents of the DS1963S scratchpad.void
setSpeedCheck
(boolean doSpeedCheck) Directs the container to avoid the calls to doSpeed() in methods that communicate with the SHA iButton.void
setupContainer
(DSPortAdapter sourceAdapter, byte[] newAddress) Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device.boolean
SHAFunction
(byte function) Performs one of the DS1963S's cryptographic functions.boolean
SHAFunction
(byte function, int T) Performs one of the DS1963S's cryptographic functions.void
useResume
(boolean set) Tells thisOneWireContainer18
whether it can use theRESUME
command.boolean
Waits for the DS1963S's output to alternate.boolean
writeDataPage
(int page_number, byte[] page_data) Writes a data page to the DS1963S.boolean
writeScratchPad
(int targetPage, int targetPageOffset, byte[] inputbuffer, int start, int length) Writes data to the scratchpad.Methods inherited from class com.dalsemi.onewire.container.OneWireContainer
doSpeed, equals, getAdapter, getAddress, getAddressAsLong, getAddressAsString, hashCode, isAlarming, isPresent, setSpeed, setupContainer, setupContainer, toString
-
Field Details
-
READ_MEMORY
public static final byte READ_MEMORY- See Also:
-
WRITE_SCRATCHPAD
public static final byte WRITE_SCRATCHPAD- See Also:
-
MATCH_SCRATCHPAD
public static final byte MATCH_SCRATCHPAD- See Also:
-
ERASE_SCRATCHPAD
public static final byte ERASE_SCRATCHPAD- See Also:
-
READ_SCRATCHPAD
public static final byte READ_SCRATCHPAD- See Also:
-
READ_AUTHENTICATED_PAGE
public static final byte READ_AUTHENTICATED_PAGE- See Also:
-
COPY_SCRATCHPAD
public static final byte COPY_SCRATCHPAD- See Also:
-
COMPUTE_SHA
public static final byte COMPUTE_SHA- See Also:
-
COMPUTE_FIRST_SECRET
public static final byte COMPUTE_FIRST_SECRET- See Also:
-
COMPUTE_NEXT_SECRET
public static final byte COMPUTE_NEXT_SECRET- See Also:
-
VALIDATE_DATA_PAGE
public static final byte VALIDATE_DATA_PAGE- See Also:
-
SIGN_DATA_PAGE
public static final byte SIGN_DATA_PAGE- See Also:
-
COMPUTE_CHALLENGE
public static final byte COMPUTE_CHALLENGE- See Also:
-
AUTH_HOST
public static final byte AUTH_HOST- See Also:
-
RESUME
public static final byte RESUME- See Also:
-
-
Constructor Details
-
OneWireContainer18
public OneWireContainer18()Creates a newOneWireContainer
for communication with a DS1963S SHA iButton. Note that the methodsetupContainer(com.dalsemi.onewire.adapter.DSPortAdapter,byte[])
must be called to set the correctDSPortAdapter
device address. -
OneWireContainer18
Creates a newOneWireContainer
for communication with a DS1963S SHA iButton.- Parameters:
sourceAdapter
- adapter object required to communicate with this iButtonnewAddress
- address of this DS1963S SHA iButton- See Also:
-
OneWireContainer18
Creates a newOneWireContainer
for communication with a DS1963S SHA iButton.- Parameters:
sourceAdapter
- adapter object required to communicate with this iButtonnewAddress
- address of this DS1963S SHA iButton- See Also:
-
OneWireContainer18
Creates a newOneWireContainer
for communication with a DS1963S SHA iButton.- Parameters:
sourceAdapter
- adapter object required to communicate with this iButtonnewAddress
- address of this DS1963S SHA iButton- See Also:
-
-
Method Details
-
setupContainer
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device. Overrides the
OneWireContainer
method for speed, as theOneWireContainer
version has a byte array allocation. Since there is a call tosetupContainer()
in the critical path of a transaction (when a roving SHA iButton is introduced to the 1-Wire Bus), this must occur quickly. This improves performance on TINI.- Overrides:
setupContainer
in classOneWireContainer
- Parameters:
sourceAdapter
- adapter object required to communicate with this iButtonnewAddress
- address of this 1-Wire device- See Also:
-
getName
Get the Maxim Integrated Products part number of the iButton or 1-Wire Device as ajava.lang.String
. For example "DS1992".- Overrides:
getName
in classOneWireContainer
- Returns:
- iButton or 1-Wire device name
-
getAlternateNames
Retrieve the alternate Maxim Integrated Products part numbers or names. A 'family' of MicroLAN devices may have more than one part number depending on packaging. There can also be nicknames such as "Crypto iButton".- Overrides:
getAlternateNames
in classOneWireContainer
- Returns:
- the alternate names for this iButton or 1-Wire device
-
getDescription
Get a short description of the function of this iButton or 1-Wire Device type.- Overrides:
getDescription
in classOneWireContainer
- Returns:
- device description
-
getMaxSpeed
public int getMaxSpeed()Returns the maximum speed this iButton device can communicate at.- Overrides:
getMaxSpeed
in classOneWireContainer
- Returns:
- maximum speed
- See Also:
-
getMemoryBanks
Gets an enumeration of memory bank instances that implement one or more of the following interfaces:MemoryBank
,PagedMemoryBank
, andOTPMemoryBank
.- Overrides:
getMemoryBanks
in classOneWireContainer
- Returns:
Enumeration
of memory banks- See Also:
-
setSpeedCheck
public void setSpeedCheck(boolean doSpeedCheck) Directs the container to avoid the calls to doSpeed() in methods that communicate with the SHA iButton. To ensure that all parts can talk to the 1-Wire bus at their desired speed, each method contains a call todoSpeed()
. However, this is an expensive operation. If a user manages the bus speed in an application, call this method withdoSpeedCheck
asfalse
. The default behavior is to calldoSpeed()
.- Parameters:
doSpeedCheck
-true
fordoSpeed()
to be called before every 1-Wire bus access,false
to skip this expensive call- See Also:
-
useResume
public void useResume(boolean set) Tells this
OneWireContainer18
whether it can use theRESUME
command. TheRESUME
command allows the DS1963S to be re-selected for communication quickly by using a onebyte
RESUME
command rather than a ninebyte
selection sequence. If another 1-Wire device is accessed,useResume(false)
must be called, a normal selection of the part must be performed, and thenuseResume(true)
can be called.- Parameters:
set
-true
to use the onebyte
RESUME
command instead of the ninebyte
select command- See Also:
-
eraseScratchPad
Erases the scratchpad of the DS1963S. The cryptographic features of the DS1963S leave the device in 'hidden mode', which makes most memory functions inaccessible. A call to
eraseScratchPad(int)
brings the device out of 'hidden mode', filling the scratchpad with 0x0FFbytes
.The argument
page
is usually unimportant, except in cases where a memory page needs to be erased. Erase a memory page by callingeraseScratchPad(page_number)
, followed byreadScratchPad()
and thencopyScratchPad()
.- Parameters:
page
- the target page number- Returns:
- true if successful, false if the operation failed while waiting for the DS1963S's output to alternate (see the datasheet for a description)
- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
waitForSuccessfulFinish
Waits for the DS1963S's output to alternate. Several operations must wait for the DS1963S to stop sending 0x0ff's and begin alternating its output bits. This method reads until it finds a non-0x0ff
byte
or until it reaches a specified number of tries, indicating failure.This method can often be optimized away. A normal 1-Wire transaction involves writing and reading a known number of bytes. If a few more bytes are read, a program can check to see if the DS1963S has started alternating its output much quicker than calling this method will. For instance, to copy the scratchpad, the source code might look like this:
buffer[0] = COPY_SCRATCHPAD; buffer[1] = TA1; buffer[2] = TA2; buffer[3] = ES; adapter.dataBlock(buffer, 0, 4); return waitForSuccessfulFinish();
To optimize the code, read more bytes than required:buffer[0] = COPY_SCRATCHPAD; buffer[1] = TA1; buffer[2] = TA2; buffer[3] = ES; // copy 0x0FF into the buffer, this effectively reads System.arraycopy(FF, 0, buffer, 4, 5); // read 5 extra bytes adapter.dataBlock(buffer, 0, 9); // if the last byte has not shown alternating output, // still call waitForSuccessfulFinish(), else // we are already done if (buffer[8] == (byte) 0x0ff) return waitForSuccessfulFinish(); else return true;
The second method is faster because it is more expensive to invoke another method that goes down to the native access layer than it is to just read a few more bytes while the program is already at the native access layer.
See the datasheet for which operations function in this manner. Only call this method after another method which has successfully communicated with the DS1963S.
- Returns:
true
if the DS1963S completed its operation successfully- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
readMemoryPage
public void readMemoryPage(int pageNum, byte[] data, int start) throws OneWireIOException, OneWireException Reads a memory page from the DS1963S. Pages 0-15 are normal memory pages. Pages 16 and 17 contain the secrets--the DS1963S will return all 1's (0x0ff bytes). Page 18 is the physical location of the scratchpad, and will only return valid data if the part is not in hidden mode (0x0ff bytes are returned otherwise). Pages 19 and 20 contain the write cycle counters. Page 21 contains the counter for the pseudo random number generator (PRNG). Consult the datasheet for the memory maps of these special pages.
Note that the same data can be returned through the
MemoryBank
s returned bygetMemoryBanks()
. However, this method contains several enhancements for faster reading.- Parameters:
pageNum
- page number to readdata
- array for the return of the data (must be at least 32 bytes long)start
- offset into the byte array to start copying page data- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
readAuthenticatedPage
public boolean readAuthenticatedPage(int pageNum, byte[] data, int start) throws OneWireIOException, OneWireException Reads and authenticates a page. See
readMemoryPage()
for a description of page numbers and their contents. This method will also generate a signature for the selected page, used in the authentication of roving (User) iButtons. Extra data is returned with the page as well--such as the write cycle counter for the page and the write cycle counter of the selected secret page.- 32 bytes of page data
- 4 bytes secret counter for page
- 4 bytes write cycle counter for page
- 2 byte CRC
Note that the CRC will be verified by this method, though it is returned with the data.
- Parameters:
pageNum
- page number to read and authenticatedata
- array for the page data plus extra information (2 write cycle counters of 4 bytes each, one 2 byte CRC, appended after 32 bytes of the data page). This byte array must be at least 42 bytes long.start
- offset to copy into the array- Returns:
true
if successful,false
if the operation failed while waiting for the DS1963S's output to alternate- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
writeScratchPad
public boolean writeScratchPad(int targetPage, int targetPageOffset, byte[] inputbuffer, int start, int length) throws OneWireIOException, OneWireException Writes data to the scratchpad. In order to write to a data page using this method, next call
readScratchPad()
, and thencopyScratchPad()
. Note that the addresses passed to this method will be the addresses the data is copied to if thecopyScratchPad()
method is called afterward.Also note that if too many bytes are written, this method will truncate the data so that only a valid number of bytes will be sent.
- Parameters:
targetPage
- the page number this data will eventually be copied totargetPageOffset
- the offset on the page to copy this data toinputbuffer
- the data that will be copied into the scratchpadstart
- offset into the input buffer for the data to writelength
- number of bytes to write- Returns:
true
if successful,false
on a CRC error- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
matchScratchPad
Verifies the hidden signature in the scratchpad of the DS1963S. After a
VALIDATE_DATA_PAGE
command, the scratchpad contains a signature that cannot be read, but must be verified. This method gives the DS1963S a signature. The iButton then checks to see if it equals the hidden signature in its scratchpad.The signature must be 20 bytes long, and it must start at offset 0 of the input array.
- Parameters:
mac
- the signature starting at offset 0- Returns:
true
if the signature matches- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
readScratchPad
Reads the contents of the DS1963S scratchpad. If the device is in hidden mode, all 1's (0x0ff bytes) will be returned.
This method will return up to 32 bytes. It may return less if the target address stored internally on the DS1963S is not a multiple of 32.
- Parameters:
data
- array to hold the contents of the scratchpadstart
- offset to copy the scratchpad data into thebyte
array- Returns:
- the number of bytes read, or -1 if there was a CRC failure
- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
copyScratchPad
Copies the contents of the scratchpad to the target destination that was specified in a call towriteScratchPad()
oreraseScratchPad()
. This method will not success unless a call toreadScratchPad()
is made first to verify the target address registers in the DS1963S.- Returns:
true
if successful,false
if the operation failed while waiting for the DS1963S's output to alternate- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
installMasterSecret
public boolean installMasterSecret(int page, byte[] secret, int secret_number) throws OneWireIOException, OneWireException Installs a secret on a DS1963S. The secret is written in partial phrases of 47 bytes (32 bytes to a memory page, 15 bytes to the scratchpad) and is cumulative until the entire secret is processed. Secrets are associated with a page number. See the datasheet for more information on this association.
In most cases,
page
should be equal tosecret_number
orsecret_number+8
, based on the association of secrets and page numbers. Secrets are stored across pages 16 and 17 of the DS1963S memory. A secret is 8 bytes, so there are 8 secrets. These 8 secrets are associated with the first 16 pages of memory.On TINI, this method will be slightly faster if the secret's length is divisible by 47. However, since secret key generation is a part of initialization, it is probably not necessary.
- Parameters:
page
- the page number used to write the partial secrets tosecret
- the entire secret, in partial phrases, to be installedsecret_number
- the secret 'page' to use (0 - 7)- Returns:
true
if successful- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
bindSecretToiButton
public boolean bindSecretToiButton(int page, byte[] bind_data, byte[] bind_code, int secret_number) throws OneWireIOException, OneWireException Binds an installed secret to a DS1963S by using well-known binding data and the DS1963S's unique address. This makes the secret unique for this iButton. Coprocessor iButtons use this method to recreate the iButton's secret to verify authentication. Roving iButtons use this method to finalize their secret keys.
Note that unlike in the
installMasterSecret()
method, the page number does not need to be equivalent to thesecret_number
modulo 8. The new secret (installed secret + binding code) is generated from this page but can be copied into another secret. User iButtons should bind to the same page the secret was installed on. Coprocessor iButtons must copy to a new secret to preserve the general system authentication secret.The binding should be either 7 bytes long or 15 bytes long. A 15-length
byte
array is unaltered and placed in the scratchpad for the binding. A 7-lengthbyte
array is combined with the page number and DS1963S unique address and then placed in the scratchpad. Coprocessors should use a pre-formatted 15-lengthbyte
array. User iButtons should let the method format for them (i.e. use the 7-lengthbyte
array option).- Parameters:
page
- the page number that has the master secret already installedbind_data
- 32 bytes of binding data used to bind the iButton to the systembind_code
- the 7-byte or 15-byte binding codesecret_number
- secret number to copy the resulting secret to- Returns:
true
if successful- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
writeDataPage
public boolean writeDataPage(int page_number, byte[] page_data) throws OneWireIOException, OneWireException Writes a data page to the DS1963S. This method is the equivalent of calling:
eraseScratchPad(0);
writeScratchPad(page_number,0,page_data_array,0,32);
readScratchPad(buffer,0);
copyScratchPad();
- Parameters:
page_number
- page number to writepage_data
- page data to write (must be at least 32 bytes long)- Returns:
true
if successful,false
if the operation failed on a CRC error or while waiting for the DS1963S's output to alternate- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
SHAFunction
Performs one of the DS1963S's cryptographic functions. See the datasheet for more information on these functions.
Valid parameters for thefunction
argument are:- COMPUTE_FIRST_SECRET
- COMPUTE_NEXT_SECRET
- VALIDATE_DATA_PAGE
- SIGN_DATA_PAGE
- COMPUTE_CHALLENGE
- AUTH_HOST
This method uses the last target address used by this
OneWireContainer
. These are read in thecopyScratchPad()
andreadScratchPad()
methods.- Parameters:
function
- the SHA function code- Returns:
true
if the function successfully completed,false
if the operation failed on a CRC error or while waiting for the DS1963S's output to alternate- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-
SHAFunction
Performs one of the DS1963S's cryptographic functions. See the datasheet for more information on these functions.
Valid parameters for thefunction
argument are:- COMPUTE_FIRST_SECRET
- COMPUTE_NEXT_SECRET
- VALIDATE_DATA_PAGE
- SIGN_DATA_PAGE
- COMPUTE_CHALLENGE
- AUTH_HOST
This method uses the last target address used by this
OneWireContainer
. These are read in thecopyScratchPad()
andreadScratchPad()
methods.- Parameters:
function
- the SHA function codeT
- the raw target address for the operation- Returns:
true
if the function successfully completed,false
if the operation failed on a CRC error or while waiting for the DS1963S's output to alternate- Throws:
OneWireIOException
- on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'.OneWireException
- on a communication or setup error with the 1-Wire adapter- See Also:
-