com.appliancestudio.jbluez
Class BTAddress

java.lang.Object
  |
  +--com.appliancestudio.jbluez.BTAddress

public class BTAddress
extends java.lang.Object

Java representation of a Bluetooth device address. A Bluetooth device address is comprised of six pairs of hex digits, for example 00:12:34:56:78:9A. This class is based upon the bdaddr_t type, as defined in bluetooth.h of the BlueZ libraries.

Version:
1.0
Author:
Edward Kay, ed.kay@appliancestudio.com

Field Summary
 short[] addr_arr
          The address is stored as six 8-bit numbers.
 
Constructor Summary
BTAddress()
          Default constructor
BTAddress(java.lang.String addr_str)
          Creates a BTAddress object from the address addr_str.
 
Method Summary
 boolean equals(com.appliancestudio.jbluez.BTAddress compare)
          Compares two BTAddress objects to see if they represent the same Bluetooth device address.
 void setValue(java.lang.String addr_str)
          Set the Bluetooth device address.
 java.lang.String toString()
          Returns a String representation of the Bluetooth device address in the form "00:12:34:56:78:9A".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

addr_arr

public short[] addr_arr
The address is stored as six 8-bit numbers.

Constructor Detail

BTAddress

public BTAddress()
Default constructor


BTAddress

public BTAddress(java.lang.String addr_str)
          throws BTAddressFormatException
Creates a BTAddress object from the address addr_str. The address string should be in the form "00:12:34:56:78:9A".

Parameters:
addr_str - String representation of the Bluetooth device address.
Throws:
BTAddressFormatException - If the String is not a parsable Bluetooth address.
Method Detail

setValue

public void setValue(java.lang.String addr_str)
              throws BTAddressFormatException
Set the Bluetooth device address. Valid string format is "00:12:34:56:78:AB", that is 6, colon separated pairs of hex digits.

Parameters:
addr_str - String representation of the Bluetooth device address.
Throws:
BTAddressFormatException - If the String is not a parsable Bluetooth address.

toString

public java.lang.String toString()
Returns a String representation of the Bluetooth device address in the form "00:12:34:56:78:9A".

Overrides:
toString in class java.lang.Object
Returns:
A String representation of the Bluetooth device address.

equals

public boolean equals(com.appliancestudio.jbluez.BTAddress compare)
Compares two BTAddress objects to see if they represent the same Bluetooth device address.

Parameters:
compare - The BTAddress object to compare to this.
Returns:
True if the Bluetooth device addresses are equal, otherwise false.


Copyright © 2002 The Appliance Studio Limited