BluetoothUuid.java revision d5ac1ae36b4e096eb97984334f86d0c68abea2f7
1/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.bluetooth;
18
19import java.util.UUID;
20
21/**
22* Static helper methods and constants to decode the UUID of remote devices.
23*  @hide
24*/
25public final class BluetoothUuid {
26
27    /* See Bluetooth Assigned Numbers document - SDP section, to get the values of UUIDs
28     * for the various services.
29     *
30     * The following 128 bit values are calculated as:
31     *  uuid * 2^96 + BASE_UUID
32     */
33    public static final UUID AudioSink = UUID.fromString("0000110A-0000-1000-8000-00805F9B34FB");
34    public static final UUID AudioSource = UUID.fromString("0000110B-0000-1000-8000-00805F9B34FB");
35    public static final UUID AdvAudioDist = UUID.fromString("0000110D-0000-1000-8000-00805F9B34FB");
36    public static final UUID HSP       = UUID.fromString("00001108-0000-1000-8000-00805F9B34FB");
37    public static final UUID HeadsetHS = UUID.fromString("00001131-0000-1000-8000-00805F9B34FB");
38    public static final UUID Handsfree  = UUID.fromString("0000111e-0000-1000-8000-00805F9B34FB");
39    public static final UUID HandsfreeAudioGateway
40                                          = UUID.fromString("0000111f-0000-1000-8000-00805F9B34FB");
41
42    public static boolean isAudioSource(UUID uuid) {
43        return uuid.equals(AudioSource);
44    }
45
46    public static boolean isAudioSink(UUID uuid) {
47        return uuid.equals(AudioSink);
48    }
49
50    public static boolean isAdvAudioDist(UUID uuid) {
51        return uuid.equals(AdvAudioDist);
52    }
53
54    public static boolean isHandsfree(UUID uuid) {
55        return uuid.equals(Handsfree) || uuid.equals(HandsfreeAudioGateway);
56    }
57
58    public static boolean isHeadset(UUID uuid) {
59        return uuid.equals(HSP) || uuid.equals(HeadsetHS);
60    }
61}
62
63