LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BtDeviceClass.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2011-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef BTDEVICECLASS_H
23 #define BTDEVICECLASS_H
24 
25 
26 // Bluetooth COD value definifions
27 #define COD_SERVICE_MASK 0xffe000
28 #define COD_MAJOR_MASK 0x001f00
29 #define COD_MINOR_MASK 0x0000fc
30 
31 // Major Service classes
32 #define COD_LIMITED_DISCOVERABLE_MODE 0x00002000
33 #define COD_NETWORKING 0x00020000
34 #define COD_RENDERING 0x00040000
35 #define COD_CAPTURING 0x00080000
36 #define COD_OBJECT_TRANSFER 0x00100000
37 #define COD_AUDIO 0x00200000
38 #define COD_TELEPHONY 0x00400000
39 #define COD_INFORMATION 0x00800000
40 #define COD_SERVICE_ANY 0x00ffE000
41 
42 // Major device classes
43 #define COD_MAJOR_MISC 0x00000000
44 #define COD_MAJOR_COMPUTER 0x00000100
45 #define COD_MAJOR_PHONE 0x00000200
46 #define COD_MAJOR_LAN 0x00000300
47 #define COD_MAJOR_AUDIO 0x00000400
48 #define COD_MAJOR_PERIPHERAL 0x00000500
49 #define COD_MAJOR_IMAGING 0x00000600
50 #define COD_MAJOR_WEARABLE 0x00000700
51 #define COD_MAJOR_TOY 0x00000800
52 #define COD_MAJOR_UNCLASSIFIED 0x00001F00
53 #define COD_MAJOR_ANY 0x00001F00
54 #define COD_MINOR_ANY 0x000000FC
55 
56 // Minor Device Class - Computer Minor class
57 #define COD_MINOR_COMP_UNCLASSIFIED 0x00000000
58 #define COD_MINOR_COMP_DESKTOP 0x00000004
59 #define COD_MINOR_COMP_SERVER 0x00000008
60 #define COD_MINOR_COMP_LAPTOP 0x0000000C
61 #define COD_MINOR_COMP_HANDHELD 0x00000010
62 #define COD_MINOR_COMP_PALM 0x00000014
63 
64 // Minor Device Class - Phone Minor class
65 #define COD_MINOR_PHONE_UNCLASSIFIED 0x00000000
66 #define COD_MINOR_PHONE_CELLULAR 0x00000004
67 #define COD_MINOR_PHONE_CORDLESS 0x00000008
68 #define COD_MINOR_PHONE_SMART 0x0000000C
69 #define COD_MINOR_PHONE_MODEM 0x00000010
70 #define COD_MINOR_PHONE_ISDN 0x00000014
71 
72 // Minor Device Class - Audio Major class
73 #define COD_MINOR_AUDIO_UNCLASSIFIED 0x00000000
74 #define COD_MINOR_AUDIO_HEADSET 0x00000004
75 #define COD_MINOR_AUDIO_HANDFREE 0x00000008
76 #define COD_MINOR_AUDIO_MICROPHONE 0x00000010
77 #define COD_MINOR_AUDIO_LOUDSPEAKER 0x00000014
78 #define COD_MINOR_AUDIO_HEADPHONE 0x00000018
79 #define COD_MINOR_AUDIO_PORTABLE_AUDIO 0x0000001C
80 #define COD_MINOR_AUDIO_CAR_AUDIO 0x00000020
81 #define COD_MINOR_AUDIO_SET_TOP_BOX 0x00000024
82 #define COD_MINOR_AUDIO_HIFI_AUDIO 0x00000028
83 #define COD_MINOR_AUDIO_VCR 0x0000002C
84 #define COD_MINOR_AUDIO_VIDEO_CAMERA 0x00000030
85 #define COD_MINOR_AUDIO_CAMCORDER 0x00000034
86 #define COD_MINOR_AUDIO_VIDEO_MONITOR 0x00000038
87 #define COD_MINOR_AUDIO_VIDEO_DISPLAY 0x0000003C
88 #define COD_MINOR_AUDIO_VIDEO_CONFERENCE 0x00000040
89 #define COD_MINOR_AUDIO_GAME_TOY 0x00000048
90 
91 // Minor Device Class - Peripheral Major class
92 #define COD_MINOR_PERIPHERAL_UNCLASSIFIED 0x00000000
93 #define COD_MINOR_PERIPHERAL_KEYBOARD 0x00000040
94 #define COD_MINOR_PERIPHERAL_MOUSE 0x00000080
95 #define COD_MINOR_PERIPHERAL_COMBO 0x000000B0
96 
97 // Minor sub Device Class - Peripheral Major class
98 #define COD_MINOR_PERIPHERAL_JOYSTICK 0x00000004
99 #define COD_MINOR_PERIPHERAL_GAMEPAD 0x00000008
100 #define COD_MINOR_PERIPHERAL_REMOTE_CONTROL 0x0000000C
101 #define COD_MINOR_PERIPHERAL_SENSING 0x00000010
102 #define COD_MINOR_PERIPHERAL_DIGITIZER 0x00000014
103 #define COD_MINOR_PERIPHERAL_CARD_READER 0x00000018
104 
105 // Group: Minor Device Class - Imaging Major class (Select multiple is possible)
106 #define COD_MINOR_IMAGING_UNCLASSIFIED 0x00000000
107 #define COD_MINOR_IMAGING_DISPLAY 0x00000010
108 #define COD_MINOR_IMAGING_CAMERA 0x00000020
109 #define COD_MINOR_IMAGING_SCANNER 0x00000040
110 #define COD_MINOR_IMAGING_PRINTER 0x00000080
111 
112 //HFG Device Mask
113 #define HFG_MASK (COD_AUDIO + COD_MAJOR_AUDIO + COD_MINOR_AUDIO_HEADSET + COD_MINOR_AUDIO_HANDFREE)
114 
115 //A2DP Device Mask
116 #define A2DP_MASK (COD_RENDERING + COD_MAJOR_AUDIO)
117 
118 namespace BtDeviceClass {
119 
120  bool isCODInMask(unsigned int cod, unsigned int mask);
121 
122  bool isAudioDevice(unsigned int cod);
123 
124  bool isHFGSupported(unsigned int cod);
125 
126  bool isPhone(unsigned int cod);
127 
128  bool isA2DPSupported(unsigned int cod);
129 
130  bool isComputerOrPhone(unsigned int cod);
131 
132 }
133 
134 
135 #endif /* BTDEVICECLASS_H */