android.bluetooth
Class DeviceClass
java.lang.Object
android.bluetooth.DeviceClass
public class DeviceClass
- extends Object
The Android Bluetooth API is not finalized, and *will* change. Use at your
own risk.
Static helper methods and constants to decode the device class bit vector
returned by the Bluetooth API.
The Android Bluetooth API returns a 32-bit integer to represent the device
class. This is actually a bit vector, the format defined at
http://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm
(login required). This class provides static helper methods and constants to
determine what Service Class(es), Major Class, and Minor Class are encoded
in a 32-bit device class.
Each of the helper methods takes the 32-bit integer device class as an
argument.
|
Method Summary |
static int |
getMajorClass(int deviceClass)
Returns the Major Class of a bluetooth device class. |
static int |
getMinorClass(int deviceClass)
Returns the Minor Class of a bluetooth device class. |
static boolean |
hasServiceClass(int deviceClass,
int serviceClassType)
Returns true if the given device class supports the given Service Class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERVICE_CLASS_BITMASK
public static final int SERVICE_CLASS_BITMASK
- See Also:
- Constant Field Values
SERVICE_CLASS_LIMITED_DISCOVERABILITY
public static final int SERVICE_CLASS_LIMITED_DISCOVERABILITY
- See Also:
- Constant Field Values
SERVICE_CLASS_POSITIONING
public static final int SERVICE_CLASS_POSITIONING
- See Also:
- Constant Field Values
SERVICE_CLASS_NETWORKING
public static final int SERVICE_CLASS_NETWORKING
- See Also:
- Constant Field Values
SERVICE_CLASS_RENDER
public static final int SERVICE_CLASS_RENDER
- See Also:
- Constant Field Values
SERVICE_CLASS_CAPTURE
public static final int SERVICE_CLASS_CAPTURE
- See Also:
- Constant Field Values
SERVICE_CLASS_OBJECT_TRANSFER
public static final int SERVICE_CLASS_OBJECT_TRANSFER
- See Also:
- Constant Field Values
SERVICE_CLASS_AUDIO
public static final int SERVICE_CLASS_AUDIO
- See Also:
- Constant Field Values
SERVICE_CLASS_TELEPHONY
public static final int SERVICE_CLASS_TELEPHONY
- See Also:
- Constant Field Values
SERVICE_CLASS_INFORMATION
public static final int SERVICE_CLASS_INFORMATION
- See Also:
- Constant Field Values
MAJOR_CLASS_BITMASK
public static final int MAJOR_CLASS_BITMASK
- See Also:
- Constant Field Values
MAJOR_CLASS_MISC
public static final int MAJOR_CLASS_MISC
- See Also:
- Constant Field Values
MAJOR_CLASS_COMPUTER
public static final int MAJOR_CLASS_COMPUTER
- See Also:
- Constant Field Values
MAJOR_CLASS_PHONE
public static final int MAJOR_CLASS_PHONE
- See Also:
- Constant Field Values
MAJOR_CLASS_NETWORKING
public static final int MAJOR_CLASS_NETWORKING
- See Also:
- Constant Field Values
MAJOR_CLASS_AUDIO_VIDEO
public static final int MAJOR_CLASS_AUDIO_VIDEO
- See Also:
- Constant Field Values
MAJOR_CLASS_PERIPHERAL
public static final int MAJOR_CLASS_PERIPHERAL
- See Also:
- Constant Field Values
MAJOR_CLASS_IMAGING
public static final int MAJOR_CLASS_IMAGING
- See Also:
- Constant Field Values
MAJOR_CLASS_WEARABLE
public static final int MAJOR_CLASS_WEARABLE
- See Also:
- Constant Field Values
MAJOR_CLASS_TOY
public static final int MAJOR_CLASS_TOY
- See Also:
- Constant Field Values
MAJOR_CLASS_MEDICAL
public static final int MAJOR_CLASS_MEDICAL
- See Also:
- Constant Field Values
MAJOR_CLASS_UNCATEGORIZED
public static final int MAJOR_CLASS_UNCATEGORIZED
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_BITMASK
public static final int MINOR_CLASS_AUDIO_VIDEO_BITMASK
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_UNCATEGORIZED
public static final int MINOR_CLASS_AUDIO_VIDEO_UNCATEGORIZED
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_HEADSET
public static final int MINOR_CLASS_AUDIO_VIDEO_HEADSET
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_HANDSFREE
public static final int MINOR_CLASS_AUDIO_VIDEO_HANDSFREE
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_MICROPHONE
public static final int MINOR_CLASS_AUDIO_VIDEO_MICROPHONE
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_LOUDSPEAKER
public static final int MINOR_CLASS_AUDIO_VIDEO_LOUDSPEAKER
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_HEADPHONES
public static final int MINOR_CLASS_AUDIO_VIDEO_HEADPHONES
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_PORTABLE_AUDIO
public static final int MINOR_CLASS_AUDIO_VIDEO_PORTABLE_AUDIO
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_CAR_AUDIO
public static final int MINOR_CLASS_AUDIO_VIDEO_CAR_AUDIO
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_SET_TOP_BOX
public static final int MINOR_CLASS_AUDIO_VIDEO_SET_TOP_BOX
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_HIFI_AUDIO
public static final int MINOR_CLASS_AUDIO_VIDEO_HIFI_AUDIO
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_VCR
public static final int MINOR_CLASS_AUDIO_VIDEO_VCR
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_VIDEO_CAMERA
public static final int MINOR_CLASS_AUDIO_VIDEO_VIDEO_CAMERA
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_CAMCORDER
public static final int MINOR_CLASS_AUDIO_VIDEO_CAMCORDER
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_VIDEO_MONITOR
public static final int MINOR_CLASS_AUDIO_VIDEO_VIDEO_MONITOR
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER
public static final int MINOR_CLASS_AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_VIDEO_CONFERENCING
public static final int MINOR_CLASS_AUDIO_VIDEO_VIDEO_CONFERENCING
- See Also:
- Constant Field Values
MINOR_CLASS_AUDIO_VIDEO_VIDEO_GAMING_TOY
public static final int MINOR_CLASS_AUDIO_VIDEO_VIDEO_GAMING_TOY
- See Also:
- Constant Field Values
CLASS_UNKNOWN
public static final int CLASS_UNKNOWN
- See Also:
- Constant Field Values
DeviceClass
public DeviceClass()
hasServiceClass
public static boolean hasServiceClass(int deviceClass,
int serviceClassType)
- Returns true if the given device class supports the given Service Class.
A bluetooth device can claim to support zero or more service classes.
- Parameters:
deviceClass - The bluetooth device class.serviceClassType - The service class constant to test for. For
example, DeviceClass.SERVICE_CLASS_AUDIO. This
must be one of the SERVICE_CLASS_xxx constants,
results of this function are undefined
otherwise.
- Returns:
- If the deviceClass claims to support the serviceClassType.
getMajorClass
public static int getMajorClass(int deviceClass)
- Returns the Major Class of a bluetooth device class.
Values returned from this function can be compared with the constants
MAJOR_CLASS_xxx. A bluetooth device can only be associated
with one major class.
getMinorClass
public static int getMinorClass(int deviceClass)
- Returns the Minor Class of a bluetooth device class.
Values returned from this function can be compared with the constants
MINOR_CLASS_xxx_yyy, where xxx is the Major Class. A bluetooth
device can only be associated with one minor class within its major
class.
Please submit a feedback, bug or feature