1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup Bluetooth
18  * @{
19  *
20  * @brief Defines device some major class.
21  *
22  * @since 1.0
23  * @version 1.0
24  */
25 
26 /**
27  * @file bluetooth_device.h
28  *
29  * @brief Bluetooth device major class.
30  *
31  * @since 1.0
32  * @version 1.0
33  */
34 
35 #ifndef BLUETOOTH_DEVICE_H_
36 #define BLUETOOTH_DEVICE_H_
37 
38 namespace OHOS {
39 namespace Bluetooth {
40 /**
41  * @brief Represents device major class.
42  *
43  * @since 1.0
44  * @version 1.0
45  */
46 class BluetoothDevice {
47 public:
48     // Major Service Classes
49     static const int SERVICE_LIMITED_DISCOVERABILITY = 0x002000;
50     static const int SERVICE_POSITIONING = 0x010000;
51     static const int SERVICE_NETWORKING = 0x020000;
52     static const int SERVICE_RENDER = 0x040000;
53     static const int SERVICE_CAPTURE = 0x080000;
54     static const int SERVICE_OBJECT_TRANSFER = 0x100000;
55     static const int SERVICE_AUDIO = 0x200000;
56     static const int SERVICE_TELEPHONY = 0x400000;
57     static const int SERVICE_INFORMATION = 0x800000;
58 
59     // Major Device Classes
60     static const int MAJOR_MISC = 0x0000;
61     static const int MAJOR_COMPUTER = 0x0100;
62     static const int MAJOR_PHONE = 0x0200;
63     static const int MAJOR_NETWORKING = 0x0300;
64     static const int MAJOR_AUDIO_VIDEO = 0x0400;
65     static const int MAJOR_PERIPHERAL = 0x0500;
66     static const int MAJOR_IMAGING = 0x0600;
67     static const int MAJOR_WEARABLE = 0x0700;
68     static const int MAJOR_TOY = 0x0800;
69     static const int MAJOR_HEALTH = 0x0900;
70     static const int MAJOR_UNCATEGORIZED = 0x1F00;
71 
72     // The Minor Device Class field
73     // Computer Major Class
74     static const int COMPUTER_UNCATEGORIZED = 0x0100;
75     static const int COMPUTER_DESKTOP = 0x0104;
76     static const int COMPUTER_SERVER = 0x0108;
77     static const int COMPUTER_LAPTOP = 0x010C;
78     static const int COMPUTER_HANDHELD_PC_PDA = 0x0110;
79     static const int COMPUTER_PALM_SIZE_PC_PDA = 0x0114;
80     static const int COMPUTER_WEARABLE = 0x0118;
81     static const int COMPUTER_TABLET = 0x011C;
82 
83     // Phone Major Class
84     static const int PHONE_UNCATEGORIZED = 0x0200;
85     static const int PHONE_CELLULAR = 0x0204;
86     static const int PHONE_CORDLESS = 0x0208;
87     static const int PHONE_SMART = 0x020C;
88     static const int PHONE_MODEM_OR_GATEWAY = 0x0210;
89     static const int PHONE_ISDN = 0x0214;
90 
91     // LAN/Network Access Point Major Class
92     static const int NETWORK_FULLY_AVAILABLE = 0x0300;
93     static const int NETWORK_1_TO_17_UTILIZED = 0x0320;
94     static const int NETWORK_17_TO_33_UTILIZED = 0x0340;
95     static const int NETWORK_33_TO_50_UTILIZED = 0x0360;
96     static const int NETWORK_60_TO_67_UTILIZED = 0x0380;
97     static const int NETWORK_67_TO_83_UTILIZED = 0x03A0;
98     static const int NETWORK_83_TO_99_UTILIZED = 0x03C0;
99     static const int NETWORK_NO_SERVICE = 0x03E0;
100 
101     // Audio/Video Major Class
102     static const int AUDIO_VIDEO_UNCATEGORIZED = 0x0400;
103     static const int AUDIO_VIDEO_WEARABLE_HEADSET = 0x0404;
104     static const int AUDIO_VIDEO_HANDSFREE = 0x0408;
105     // static const int AUDIO_VIDEO_RESERVED  = 0x040C;
106     static const int AUDIO_VIDEO_MICROPHONE = 0x0410;
107     static const int AUDIO_VIDEO_LOUDSPEAKER = 0x0414;
108     static const int AUDIO_VIDEO_HEADPHONES = 0x0418;
109     static const int AUDIO_VIDEO_PORTABLE_AUDIO = 0x041C;
110     static const int AUDIO_VIDEO_CAR_AUDIO = 0x0420;
111     static const int AUDIO_VIDEO_SET_TOP_BOX = 0x0424;
112     static const int AUDIO_VIDEO_HIFI_AUDIO = 0x0428;
113     static const int AUDIO_VIDEO_VCR = 0x042C;
114     static const int AUDIO_VIDEO_VIDEO_CAMERA = 0x0430;
115     static const int AUDIO_VIDEO_CAMCORDER = 0x0434;
116     static const int AUDIO_VIDEO_VIDEO_MONITOR = 0x0438;
117     static const int AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER = 0x043C;
118     static const int AUDIO_VIDEO_VIDEO_CONFERENCING = 0x0440;
119     // static const int AUDIO_VIDEO_RESERVED  = 0x0444;
120     static const int AUDIO_VIDEO_VIDEO_GAMING_TOY = 0x0448;
121 
122     // Peripheral Major Class
123     static const int PERIPHERAL_NON_KEYBOARD_NON_POINTING = 0x0500;
124     static const int PERIPHERAL_KEYBOARD = 0x0540;
125     static const int PERIPHERAL_POINTING_DEVICE = 0x0580;
126     static const int PERIPHERAL_KEYBOARD_POINTING = 0x05C0;
127     static const int PERIPHERAL_UNCATEGORIZED = 0x0500;
128     static const int PERIPHERAL_JOYSTICK = 0x0504;
129     static const int PERIPHERAL_GAMEPAD = 0x0508;
130     static const int PERIPHERAL_REMOTE_CONTROL = 0x05C0;
131     static const int PERIPHERAL_SENSING_DEVICE = 0x0510;
132     static const int PERIPHERAL_DIGITIZER_TABLET = 0x0514;
133     static const int PERIPHERAL_CARD_READER = 0x0518;
134     static const int PERIPHERAL_DIGITAL_PEN = 0x051C;
135     static const int PERIPHERAL_SCANNER_RFID = 0x0520;
136     static const int PERIPHERAL_GESTURAL_INPUT = 0x0522;
137 
138     // Imaging Major Class
139     static const int IMAGING_UNCATEGORIZED = 0x0600;
140     static const int IMAGING_DISPLAY = 0x0610;
141     static const int IMAGING_CAMERA = 0x0620;
142     static const int IMAGING_SCANNER = 0x0640;
143     static const int IMAGING_PRINTER = 0x0680;
144 
145     // Wearable Major Class
146     static const int WEARABLE_UNCATEGORIZED = 0x0700;
147     static const int WEARABLE_WRIST_WATCH = 0x0704;
148     static const int WEARABLE_PAGER = 0x0708;
149     static const int WEARABLE_JACKET = 0x070C;
150     static const int WEARABLE_HELMET = 0x0710;
151     static const int WEARABLE_GLASSES = 0x0714;
152 
153     // Minor Device Class field - Toy Major Class
154     static const int TOY_UNCATEGORIZED = 0x0800;
155     static const int TOY_ROBOT = 0x0804;
156     static const int TOY_VEHICLE = 0x0808;
157     static const int TOY_DOLL_ACTION_FIGURE = 0x080C;
158     static const int TOY_CONTROLLER = 0x0810;
159     static const int TOY_GAME = 0x0814;
160 
161     // Minor Device Class field - Health
162     static const int HEALTH_UNCATEGORIZED = 0x0900;
163     static const int HEALTH_BLOOD_PRESSURE = 0x0904;
164     static const int HEALTH_THERMOMETER = 0x0908;
165     static const int HEALTH_WEIGHING = 0x090C;
166     static const int HEALTH_GLUCOSE = 0x0910;
167     static const int HEALTH_PULSE_OXIMETER = 0x0914;
168     static const int HEALTH_PULSE_RATE = 0x0918;
169     static const int HEALTH_DATA_DISPLAY = 0x091C;
170     static const int HEALTH_STEP_COUNTER = 0x0920;
171     static const int HEALTH_BODY_COMPOSITION_ANALYZER = 0x0924;
172     static const int HEALTH_PEAK_FLOW_MOITOR = 0x0928; // HEALTH_PEAK_FLOW_MOITOR is compatible with api8.
173     static const int HEALTH_PEAK_FLOW_MONITOR = 0x0928;
174     static const int HEALTH_MEDICATION_MONITOR = 0x092C;
175     static const int HEALTH_KNEE_PROSTHESIS = 0x0930;
176     static const int HEALTH_ANKLE_PROSTHESIS = 0x0934;
177     static const int HEALTH_GENERIC_HEALTH_MANAGER = 0x0938;
178     static const int HEALTH_PERSONAL_MOBILITY_DEVICE = 0x093C;
179 
180     // Error
181     static const int DEVICE_ERROR = 0xFF000000;
182 
183     static const int SERVICE_BITMASK = 0xFFE000;
184     static const int MAJOR_BITMASK = 0x1F00;
185     static const int DEVICE_BITMASK = 0x1FFC;
186 
187     static const int PROFILE_HEADSET = 0;
188     static const int PROFILE_A2DP = 1;
189     static const int PROFILE_OPP = 2;
190     static const int PROFILE_HID = 3;
191     static const int PROFILE_PANU = 4;
192     static const int PROFILE_NAP = 5;
193     static const int PROFILE_A2DP_SINK = 6;
194 };
195 } // namespace Bluetooth
196 } // namespace OHOS
197 
198 #endif  // BLUETOOTH_DEVICE_H_
199