de.enough.polish.android.bluetooth
Class DeviceClass

java.lang.Object
  extended by de.enough.polish.android.bluetooth.DeviceClass

public class DeviceClass
extends Object

The DeviceClass class represents the class of device (CoD) record as defined by the Bluetooth specification. This record is defined in the Bluetooth Assigned Numbers document and contains information on the type of the device and the type of services available on the device. The Bluetooth Assigned Numbers document ( http://www.bluetooth.org/assigned-numbers/baseband.htm) defines the service class, major device class, and minor device class. The table below provides some examples of possible return values and their meaning:

MethodReturn ValueClass of Device
getServiceClasses() 0x22000 Networking and Limited Discoverable Major Service Classes
getServiceClasses() 0x100000 Object Transfer Major Service Class
getMajorDeviceClass() 0x00 Miscellaneous Major Device Class
getMajorDeviceClass() 0x200 Phone Major Device Class
getMinorDeviceClass() 0x0CWith a Computer Major Device Class, Laptop Minor Device Class
getMinorDeviceClass() 0x04With a Phone Major Device Class, Cellular Minor Device Class
1.4

Constructor Summary
DeviceClass(int record)
          Creates a DeviceClass from the class of device record provided.
 
Method Summary
 int getMajorDeviceClass()
          Retrieves the major device class.
 int getMinorDeviceClass()
          Retrieves the minor device class.
 int getServiceClasses()
          Retrieves the major service classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Constructor Detail

DeviceClass

 public DeviceClass(int record)
Creates a DeviceClass from the class of device record provided. record must follow the format of the class of device record in the Bluetooth specification.
java.lang.IllegalArgumentException - if record has any bits between 24 and 31 set
Method Detail

getServiceClasses

 public int getServiceClasses()
Retrieves the major service classes. A device may have multiple major service classes. When this occurs, the major service classes are bitwise OR'ed together.

getMajorDeviceClass

 public int getMajorDeviceClass()
Retrieves the major device class. A device may have only a single major device class.

getMinorDeviceClass

 public int getMinorDeviceClass()
Retrieves the minor device class.
JSR 82

Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 82 specification.


Constructor Summary
DeviceClass(android.bluetooth.BluetoothClass androidBluetoothClass)
           
DeviceClass(int record)
          Creates a DeviceClass from the class of device record provided.
 
Method Summary
 int getMajorDeviceClass()
          Retrieves the major device class.
 int getMinorDeviceClass()
          Retrieves the minor device class.
 int getServiceClasses()
          Retrieves the major service classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceClass

public DeviceClass(int record)
Creates a DeviceClass from the class of device record provided. record must follow the format of the class of device record in the Bluetooth specification.

Parameters:
record - - describes the classes of a device
Throws:
IllegalArgumentException - - if record has any bits between 24 and 31 set

DeviceClass

public DeviceClass(android.bluetooth.BluetoothClass androidBluetoothClass)
Method Detail

getServiceClasses

public int getServiceClasses()
Retrieves the major service classes. A device may have multiple major service classes. When this occurs, the major service classes are bitwise OR'ed together.

Returns:
the major service classes

getMajorDeviceClass

public int getMajorDeviceClass()
Retrieves the major device class. A device may have only a single major device class.

Returns:
the major device class

getMinorDeviceClass

public int getMinorDeviceClass()
Retrieves the minor device class.

Returns:
the minor device class