|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.onewire.container.OneWireContainer | +--com.dalsemi.onewire.container.OneWireContainer18
1-Wire® container for a SHA Transaction iButton, DS1963S. This container encapsulates the functionality of the 1-Wire family type 18 (hex).
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.
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.
MemoryBank
,
PagedMemoryBank
MemoryBank
,
PagedMemoryBank
MemoryBank
,
PagedMemoryBank
MemoryBank
,
PagedMemoryBank
For examples on using the SHA iButton for transactions and authentications, see
the examples in the SHAiButton
usage section.
OneWireContainer
to enumerate the MemoryBanks.
MemoryBank
and
PagedMemoryBank
for bank specific operations.
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.
SHAiButtonUser18
,
DSPortAdapter.beginExclusive(boolean)
,
DSPortAdapter.endExclusive()
,
OneWireContainer.doSpeed()
Field Summary | |
static byte |
AUTH_HOST
|
static byte |
COMPUTE_CHALLENGE
|
static byte |
COMPUTE_FIRST_SECRET
|
static byte |
COMPUTE_NEXT_SECRET
|
static byte |
COMPUTE_SHA
|
static byte |
COPY_SCRATCHPAD
|
static byte |
ERASE_SCRATCHPAD
|
static byte |
MATCH_SCRATCHPAD
|
static byte |
READ_AUTHENTICATED_PAGE
|
static byte |
READ_MEMORY
|
static byte |
READ_SCRATCHPAD
|
static byte |
RESUME
|
static byte |
SIGN_DATA_PAGE
|
static byte |
VALIDATE_DATA_PAGE
|
static byte |
WRITE_SCRATCHPAD
|
Constructor Summary | |
OneWireContainer18()
Creates a new OneWireContainer for communication with a DS1963S SHA iButton. |
|
OneWireContainer18(DSPortAdapter sourceAdapter,
byte[] newAddress)
Creates a new OneWireContainer for communication with a DS1963S SHA iButton. |
|
OneWireContainer18(DSPortAdapter sourceAdapter,
long newAddress)
Creates a new OneWireContainer for communication with a DS1963S SHA iButton. |
|
OneWireContainer18(DSPortAdapter sourceAdapter,
String newAddress)
Creates a new OneWireContainer for communication with a DS1963S SHA iButton. |
Method Summary | |
boolean |
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 |
copyScratchPad()
Copies the contents of the scratchpad to the target destination that was specified in a call to writeScratchPad() or
eraseScratchPad() . |
boolean |
eraseScratchPad(int page)
Erases the scratchpad of the DS1963S. |
String |
getAlternateNames()
Retrieve the alternate Dallas Semiconductor part numbers or names. |
String |
getDescription()
Get a short description of the function of this iButton or 1-Wire Device type. |
int |
getMaxSpeed()
Returns the maximum speed this iButton device can communicate at. |
Enumeration |
getMemoryBanks()
Gets an enumeration of memory bank instances that implement one or more of the following interfaces: MemoryBank ,
PagedMemoryBank ,
and OTPMemoryBank . |
String |
getName()
Get the Dallas Semiconductor part number of the iButton or 1-Wire Device as a java.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 this OneWireContainer18 whether it can use the RESUME command. |
boolean |
waitForSuccessfulFinish()
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 |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte READ_MEMORY
public static final byte WRITE_SCRATCHPAD
public static final byte MATCH_SCRATCHPAD
public static final byte ERASE_SCRATCHPAD
public static final byte READ_SCRATCHPAD
public static final byte READ_AUTHENTICATED_PAGE
public static final byte COPY_SCRATCHPAD
public static final byte COMPUTE_SHA
public static final byte COMPUTE_FIRST_SECRET
public static final byte COMPUTE_NEXT_SECRET
public static final byte VALIDATE_DATA_PAGE
public static final byte SIGN_DATA_PAGE
public static final byte COMPUTE_CHALLENGE
public static final byte AUTH_HOST
public static final byte RESUME
Constructor Detail |
public OneWireContainer18()
OneWireContainer
for communication with a DS1963S SHA iButton.
Note that the method setupContainer(com.dalsemi.onewire.adapter.DSPortAdapter,byte[])
must be called to set the correct DSPortAdapter
device address.setupContainer(DSPortAdapter,byte[])
,
OneWireContainer18(DSPortAdapter,byte[])
,
OneWireContainer18(DSPortAdapter,long)
,
OneWireContainer18(DSPortAdapter,String)
public OneWireContainer18(DSPortAdapter sourceAdapter, byte[] newAddress)
OneWireContainer
for communication with a DS1963S SHA iButton.sourceAdapter
- adapter object required to communicate with
this iButtonnewAddress
- address of this DS1963S SHA iButtonOneWireContainer18()
,
OneWireContainer18(DSPortAdapter,long)
,
OneWireContainer18(DSPortAdapter,String)
public OneWireContainer18(DSPortAdapter sourceAdapter, long newAddress)
OneWireContainer
for communication with a DS1963S SHA iButton.sourceAdapter
- adapter object required to communicate with
this iButtonnewAddress
- address of this DS1963S SHA iButtonOneWireContainer18()
,
OneWireContainer18(DSPortAdapter,byte[])
,
OneWireContainer18(DSPortAdapter,String)
public OneWireContainer18(DSPortAdapter sourceAdapter, String newAddress)
OneWireContainer
for communication with a DS1963S SHA iButton.sourceAdapter
- adapter object required to communicate with
this iButtonnewAddress
- address of this DS1963S SHA iButtonOneWireContainer18()
,
OneWireContainer18(DSPortAdapter,byte[])
,
OneWireContainer18(DSPortAdapter,long)
Method Detail |
public 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. Overrides the OneWireContainer
method for speed, as the OneWireContainer
version has
a byte array allocation. Since there is a call to setupContainer()
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.
setupContainer
in class OneWireContainer
sourceAdapter
- adapter object required to communicate with
this iButtonnewAddress
- address of this 1-Wire deviceAddress
public String getName()
java.lang.String
.
For example "DS1992".getName
in class OneWireContainer
public String getAlternateNames()
getAlternateNames
in class OneWireContainer
public String getDescription()
getDescription
in class OneWireContainer
public int getMaxSpeed()
getMaxSpeed
in class OneWireContainer
DSPortAdapter.setSpeed(int)
public Enumeration getMemoryBanks()
MemoryBank
,
PagedMemoryBank
,
and OTPMemoryBank
.getMemoryBanks
in class OneWireContainer
Enumeration
of memory bankspublic void setSpeedCheck(boolean doSpeedCheck)
doSpeed()
. However, this is an expensive operation.
If a user manages the bus speed in an
application, call this method with doSpeedCheck
as false
. The default behavior is
to call doSpeed()
.doSpeedCheck
- true
for doSpeed()
to be called before every
1-Wire bus access, false
to skip this expensive callOneWireContainer.doSpeed()
public void useResume(boolean set)
Tells this OneWireContainer18
whether it can use the RESUME
command.
The RESUME
command allows the DS1963S to be re-selected for communication
quickly by using a one byte
RESUME
command rather than a
nine byte
selection sequence. If another 1-Wire device is accessed,
useResume(false)
must be called, a normal selection of the part
must be performed, and then useResume(true)
can be called.
set
- true
to use the one byte
RESUME
command
instead of the nine byte
select commandRESUME
public boolean eraseScratchPad(int page) throws OneWireIOException, OneWireException
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 0x0FF bytes
.
The argument page
is usually unimportant, except in cases
where a memory page needs to be erased. Erase a memory page by calling
eraseScratchPad(page_number)
, followed by readScratchPad()
and then copyScratchPad()
.
page
- the target page numberOneWireIOException
- 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
adapterwaitForSuccessfulFinish()
,
readScratchPad(byte[],int)
,
copyScratchPad()
public boolean waitForSuccessfulFinish() throws OneWireIOException, OneWireException
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:
To optimize the code, read more bytes than required:
buffer [0] = COPY_SCRATCHPAD;
buffer [1] = TA1;
buffer [2] = TA2;
buffer [3] = ES;
adapter.dataBlock(buffer,0,4);
return waitForSuccessfulFinish();
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.
true
if the DS1963S completed its operation successfullyOneWireIOException
- 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
adaptercopyScratchPad()
,
eraseScratchPad(int)
,
readAuthenticatedPage(int,byte[],int)
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 by getMemoryBanks()
. However, this method contains
several enhancements for faster reading.
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 dataOneWireIOException
- 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
adapterreadAuthenticatedPage(int,byte[],int)
,
getMemoryBanks()
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.
Note that the CRC will be verified by this method, though it is returned with the data.
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 arraytrue
if successful, false
if the operation
failed while waiting for the DS1963S's output to alternateOneWireIOException
- 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
adapterreadMemoryPage(int,byte[],int)
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 then copyScratchPad()
.
Note that the addresses passed to this method will be the addresses the data is
copied to if the copyScratchPad()
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.
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 writetrue
if successful, false
on a CRC errorOneWireIOException
- 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
adaptercopyScratchPad()
,
eraseScratchPad(int)
,
readScratchPad(byte[],int)
,
writeDataPage(int,byte[])
public boolean matchScratchPad(byte[] mac) throws OneWireIOException, OneWireException
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.
mac
- the signature starting at offset 0true
if the signature matchesOneWireIOException
- 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
adapterVALIDATE_DATA_PAGE
public int readScratchPad(byte[] data, int start) throws OneWireIOException, OneWireException
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.
data
- array to hold the contents of the scratchpadstart
- offset to copy the scratchpad data into the byte
arrayOneWireIOException
- 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
adapterwriteScratchPad(int,int,byte[],int,int)
public boolean copyScratchPad() throws OneWireIOException, OneWireException
writeScratchPad()
or
eraseScratchPad()
. This method will not success unless
a call to readScratchPad()
is made first to verify
the target address registers in the DS1963S.true
if successful, false
if the operation
failed while waiting for the DS1963S's output to alternateOneWireIOException
- 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
adaptereraseScratchPad(int)
,
readScratchPad(byte[],int)
,
writeScratchPad(int,int,byte[],int,int)
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 to secret_number
or secret_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.
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)true
if successfulOneWireIOException
- 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
adapterbindSecretToiButton(int,byte[],byte[],int)
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 the secret_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-length byte
array is combined with the page
number and DS1963S unique address and then placed in the scratchpad.
Coprocessors should use a pre-formatted 15-length byte
array.
User iButtons should let the method format for them (i.e.
use the 7-length byte
array option).
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 totrue
if successfulOneWireIOException
- 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
adapterinstallMasterSecret(int,byte[],int)
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();
page_number
- page number to writepage_data
- page data to write (must be at least 32 bytes long)true
if successful, false
if the operation
failed on a CRC error or while waiting for the DS1963S's output
to alternateOneWireIOException
- 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
adaptereraseScratchPad(int)
,
writeScratchPad(int,int,byte[],int,int)
,
readScratchPad(byte[],int)
,
copyScratchPad()
public boolean SHAFunction(byte function) throws OneWireIOException, OneWireException
Performs one of the DS1963S's cryptographic functions. See the datasheet for more information on these functions.
Valid parameters for thefunction
argument are:
This method uses the last target address used by this
OneWireContainer
. These are read in the
copyScratchPad()
and readScratchPad()
methods.
function
- the SHA function codetrue
if the function successfully completed,
false
if the operation failed on a CRC error
or while waiting for the DS1963S's output to alternateOneWireIOException
- 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
adapterSHAFunction(byte,int)
,
copyScratchPad()
,
readScratchPad(byte[],int)
public boolean SHAFunction(byte function, int T) throws OneWireIOException, OneWireException
Performs one of the DS1963S's cryptographic functions. See the datasheet for more information on these functions.
Valid parameters for thefunction
argument are:
This method uses the last target address used by this
OneWireContainer
. These are read in the
copyScratchPad()
and readScratchPad()
methods.
function
- the SHA function codeT
- the raw target address for the operationtrue
if the function successfully completed,
false
if the operation failed on a CRC error
or while waiting for the DS1963S's output to alternateOneWireIOException
- 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
adapterSHAFunction(byte)
,
copyScratchPad()
,
readScratchPad(byte[],int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |