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

Address Class Reference

Utilities to translate and verify the 1-Wire Network address. More...

List of all members.

Static Public Member Functions

static boolean isValid (byte[] address)
 Checks the CRC8 calculation of this 1-Wire Network address.
static boolean isValid (String address)
 Checks the CRC8 calculation of this 1-Wire Network address.
static boolean isValid (long address)
 Checks the CRC8 calculation of this 1-Wire Network address.
static String toString (byte[] address)
 Converts a 1-Wire Network address byte array (little endian) to a hex string representation (big endian).
static String toString (long address)
 Converts a 1-Wire Network address long (little endian) to a hex string representation (big endian).
static byte[] toByteArray (String address)
 Converts a 1-Wire Network Address string (big endian) to a byte array (little endian).
static byte[] toByteArray (long address)
 Convert an iButton or 1-Wire device address as a long (little endian) into an array of bytes.
static long toLong (byte[] address)
 Converts a 1-Wire Network Address to a long (little endian).
static long toLong (String address)
 Converts a 1-Wire Network Address to a long (little endian).

Detailed Description

Utilities to translate and verify the 1-Wire Network address.

Q: What is a 1-Wire Network Address?

A: A 1-Wire address is 64 bits consisting of an eight bit family code, forty eight bits of serialized data and an eight bit CRC8 of the first 56 bits.

For example given the following address in hexadecimal:

10 28 E9 14 00 00 00 F3

The above is a family code 10 device with a serialized data of 28 E9 14 00 00 00, and a CRC8 of F3.

The address can be stored in several ways:

Version:
0.00, 21 August 2000
Author:
DS

Member Function Documentation

static boolean isValid ( byte[]  address) [static]

Checks the CRC8 calculation of this 1-Wire Network address.

The address is valid if the CRC8 of the first seven bytes of the address gives a result equal to the eighth byte.

Parameters:
addressiButton or 1-Wire Network address to verify
Returns:
true if the family code is non-zero and the CRC8 calculation is correct.
See also:
com.dalsemi.onewire.utils.CRC8
static boolean isValid ( String  address) [static]

Checks the CRC8 calculation of this 1-Wire Network address.

The address is valid if the CRC8 of the first seven bytes of the address gives a result equal to the eighth byte.

Parameters:
addressiButton or 1-Wire Network address to verify
Returns:
true if the family code is non-zero and the CRC8 calculation is correct.
See also:
com.dalsemi.onewire.utils.CRC8
static boolean isValid ( long  address) [static]

Checks the CRC8 calculation of this 1-Wire Network address.

The address is valid if the CRC8 of the first seven bytes of the address gives a result equal to the eighth byte.

Parameters:
addressiButton or 1-Wire Network address to verify
Returns:
true if the family code is non-zero and the CRC8 calculation is correct.
See also:
com.dalsemi.onewire.utils.CRC8
static byte [] toByteArray ( String  address) [static]

Converts a 1-Wire Network Address string (big endian) to a byte array (little endian).

Parameters:
addressfamily code last.
Returns:
address represented in a byte array, family code (LS byte) first.
static long toLong ( String  address) [static]

Converts a 1-Wire Network Address to a long (little endian).

Returns:
address represented as a String.
static long toLong ( byte[]  address) [static]

Converts a 1-Wire Network Address to a long (little endian).

Returns:
address represented as a long.
static String toString ( byte[]  address) [static]

Converts a 1-Wire Network address byte array (little endian) to a hex string representation (big endian).

Parameters:
addressfamily code first.
Returns:
address represented in a String, family code last.
static String toString ( long  address) [static]

Converts a 1-Wire Network address long (little endian) to a hex string representation (big endian).

Parameters:
addressfamily code first.
Returns:
address represented in a long, little endian.

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