zhuguifei
2025-12-30 61eee1173c00a7ba9d9c748d28fe3acdb33b9441
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package com.blakequ.bluetooth_manager_lib.device.resolvers;
 
import android.bluetooth.BluetoothClass;
 
public class BluetoothClassResolver {
 
    public static String resolveDeviceClass(final int btClass) {
        switch (btClass) {
            case BluetoothClass.Device.AUDIO_VIDEO_CAMCORDER:
                return "A/V, Camcorder";
            case BluetoothClass.Device.AUDIO_VIDEO_CAR_AUDIO:
                return "A/V, Car Audio";
            case BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE:
                return "A/V, Handsfree";
            case BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES:
                return "A/V, Headphones";
            case BluetoothClass.Device.AUDIO_VIDEO_HIFI_AUDIO:
                return "A/V, HiFi Audio";
            case BluetoothClass.Device.AUDIO_VIDEO_LOUDSPEAKER:
                return "A/V, Loudspeaker";
            case BluetoothClass.Device.AUDIO_VIDEO_MICROPHONE:
                return "A/V, Microphone";
            case BluetoothClass.Device.AUDIO_VIDEO_PORTABLE_AUDIO:
                return "A/V, Portable Audio";
            case BluetoothClass.Device.AUDIO_VIDEO_SET_TOP_BOX:
                return "A/V, Set Top Box";
            case BluetoothClass.Device.AUDIO_VIDEO_UNCATEGORIZED:
                return "A/V, Uncategorized";
            case BluetoothClass.Device.AUDIO_VIDEO_VCR:
                return "A/V, VCR";
            case BluetoothClass.Device.AUDIO_VIDEO_VIDEO_CAMERA:
                return "A/V, Video Camera";
            case BluetoothClass.Device.AUDIO_VIDEO_VIDEO_CONFERENCING:
                return "A/V, Video Conferencing";
            case BluetoothClass.Device.AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER:
                return "A/V, Video Display and Loudspeaker";
            case BluetoothClass.Device.AUDIO_VIDEO_VIDEO_GAMING_TOY:
                return "A/V, Video Gaming Toy";
            case BluetoothClass.Device.AUDIO_VIDEO_VIDEO_MONITOR:
                return "A/V, Video Monitor";
            case BluetoothClass.Device.AUDIO_VIDEO_WEARABLE_HEADSET:
                return "A/V, Video Wearable Headset";
            case BluetoothClass.Device.COMPUTER_DESKTOP:
                return "Computer, Desktop";
            case BluetoothClass.Device.COMPUTER_HANDHELD_PC_PDA:
                return "Computer, Handheld PC/PDA";
            case BluetoothClass.Device.COMPUTER_LAPTOP:
                return "Computer, Laptop";
            case BluetoothClass.Device.COMPUTER_PALM_SIZE_PC_PDA:
                return "Computer, Palm Size PC/PDA";
            case BluetoothClass.Device.COMPUTER_SERVER:
                return "Computer, Server";
            case BluetoothClass.Device.COMPUTER_UNCATEGORIZED:
                return "Computer, Uncategorized";
            case BluetoothClass.Device.COMPUTER_WEARABLE:
                return "Computer, Wearable";
            case BluetoothClass.Device.HEALTH_BLOOD_PRESSURE:
                return "Health, Blood Pressure";
            case BluetoothClass.Device.HEALTH_DATA_DISPLAY:
                return "Health, Data Display";
            case BluetoothClass.Device.HEALTH_GLUCOSE:
                return "Health, Glucose";
            case BluetoothClass.Device.HEALTH_PULSE_OXIMETER:
                return "Health, Pulse Oximeter";
            case BluetoothClass.Device.HEALTH_PULSE_RATE:
                return "Health, Pulse Rate";
            case BluetoothClass.Device.HEALTH_THERMOMETER:
                return "Health, Thermometer";
            case BluetoothClass.Device.HEALTH_UNCATEGORIZED:
                return "Health, Uncategorized";
            case BluetoothClass.Device.HEALTH_WEIGHING:
                return "Health, Weighting";
            case BluetoothClass.Device.PHONE_CELLULAR:
                return "Phone, Cellular";
            case BluetoothClass.Device.PHONE_CORDLESS:
                return "Phone, Cordless";
            case BluetoothClass.Device.PHONE_ISDN:
                return "Phone, ISDN";
            case BluetoothClass.Device.PHONE_MODEM_OR_GATEWAY:
                return "Phone, Modem or Gateway";
            case BluetoothClass.Device.PHONE_SMART:
                return "Phone, Smart";
            case BluetoothClass.Device.PHONE_UNCATEGORIZED:
                return "Phone, Uncategorized";
            case BluetoothClass.Device.TOY_CONTROLLER:
                return "Toy, Controller";
            case BluetoothClass.Device.TOY_DOLL_ACTION_FIGURE:
                return "Toy, Doll/Action Figure";
            case BluetoothClass.Device.TOY_GAME:
                return "Toy, Game";
            case BluetoothClass.Device.TOY_ROBOT:
                return "Toy, Robot";
            case BluetoothClass.Device.TOY_UNCATEGORIZED:
                return "Toy, Uncategorized";
            case BluetoothClass.Device.TOY_VEHICLE:
                return "Toy, Vehicle";
            case BluetoothClass.Device.WEARABLE_GLASSES:
                return "Wearable, Glasses";
            case BluetoothClass.Device.WEARABLE_HELMET:
                return "Wearable, Helmet";
            case BluetoothClass.Device.WEARABLE_JACKET:
                return "Wearable, Jacket";
            case BluetoothClass.Device.WEARABLE_PAGER:
                return "Wearable, Pager";
            case BluetoothClass.Device.WEARABLE_UNCATEGORIZED:
                return "Wearable, Uncategorized";
            case BluetoothClass.Device.WEARABLE_WRIST_WATCH:
                return "Wearable, Wrist Watch";
            default:
                return "Unknown, Unknown (class=" + btClass + ")";
        }
    }
 
    public static String resolveMajorDeviceClass(final int majorBtClass) {
        switch (majorBtClass) {
            case BluetoothClass.Device.Major.AUDIO_VIDEO:
                return "Audio/ Video";
            case BluetoothClass.Device.Major.COMPUTER:
                return "Computer";
            case BluetoothClass.Device.Major.HEALTH:
                return "Health";
            case BluetoothClass.Device.Major.IMAGING:
                return "Imaging";
            case BluetoothClass.Device.Major.MISC:
                return "Misc";
            case BluetoothClass.Device.Major.NETWORKING:
                return "Networking";
            case BluetoothClass.Device.Major.PERIPHERAL:
                return "Peripheral";
            case BluetoothClass.Device.Major.PHONE:
                return "Phone";
            case BluetoothClass.Device.Major.TOY:
                return "Toy";
            case BluetoothClass.Device.Major.UNCATEGORIZED:
                return "Uncategorized";
            case BluetoothClass.Device.Major.WEARABLE:
                return "Wearable";
            default:
                return "Unknown (" +majorBtClass+ ")";
        }
    }
}