• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright 2018 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
17syntax = "proto2";
18package android.bluetooth.hci;
19
20option java_outer_classname = "BluetoothHciProtoEnums";
21option java_multiple_files = true;
22
23// HCI command opcodes (OCF+OGF) from Bluetooth 5.0 specification Vol 2, Part E, Section 7
24// Original definition: system/bt/stack/include/hcidefs.h
25enum CommandEnum {
26    // Opcode is at most 2 bytes (0xFFFF), thus 0xFFFFF must not be a valid value
27    CMD_UNKNOWN = 0xFFFFF;
28    // Link control commands 0x0400
29    CMD_INQUIRY = 0x0401;
30    CMD_INQUIRY_CANCEL = 0x0402;
31    CMD_PERIODIC_INQUIRY_MODE = 0x0403;
32    CMD_EXIT_PERIODIC_INQUIRY_MODE = 0x0404;
33    CMD_CREATE_CONNECTION = 0x0405;
34    CMD_DISCONNECT = 0x0406;
35    CMD_ADD_SCO_CONNECTION = 0x0407; // Deprecated since Bluetooth 1.2
36    CMD_CREATE_CONNECTION_CANCEL = 0x0408;
37    CMD_ACCEPT_CONNECTION_REQUEST = 0x0409;
38    CMD_REJECT_CONNECTION_REQUEST = 0x040A;
39    CMD_LINK_KEY_REQUEST_REPLY = 0x040B;
40    CMD_LINK_KEY_REQUEST_NEG_REPLY = 0x040C;
41    CMD_PIN_CODE_REQUEST_REPLY = 0x040D;
42    CMD_PIN_CODE_REQUEST_NEG_REPLY = 0x040E;
43    CMD_CHANGE_CONN_PACKET_TYPE = 0x040F;
44    CMD_AUTHENTICATION_REQUESTED = 0x0411;
45    CMD_SET_CONN_ENCRYPTION = 0x0413;
46    CMD_CHANGE_CONN_LINK_KEY = 0x0415;
47    CMD_MASTER_LINK_KEY = 0x0417;
48    CMD_RMT_NAME_REQUEST = 0x0419;
49    CMD_RMT_NAME_REQUEST_CANCEL = 0x041A;
50    CMD_READ_RMT_FEATURES = 0x041B;
51    CMD_READ_RMT_EXT_FEATURES = 0x041C;
52    CMD_READ_RMT_VERSION_INFO = 0x041D;
53    CMD_READ_RMT_CLOCK_OFFSET = 0x041F;
54    CMD_READ_LMP_HANDLE = 0x0420;
55    CMD_SETUP_ESCO_CONNECTION = 0x0428;
56    CMD_ACCEPT_ESCO_CONNECTION = 0x0429;
57    CMD_REJECT_ESCO_CONNECTION = 0x042A;
58    CMD_IO_CAPABILITY_REQUEST_REPLY = 0x042B;
59    CMD_USER_CONF_REQUEST_REPLY = 0x042C;
60    CMD_USER_CONF_VALUE_NEG_REPLY = 0x042D;
61    CMD_USER_PASSKEY_REQ_REPLY = 0x042E;
62    CMD_USER_PASSKEY_REQ_NEG_REPLY = 0x042F;
63    CMD_REM_OOB_DATA_REQ_REPLY = 0x0430;
64    CMD_REM_OOB_DATA_REQ_NEG_REPLY = 0x0433;
65    CMD_IO_CAP_REQ_NEG_REPLY = 0x0434;
66    // BEGIN: AMP commands (not used in system/bt)
67    CMD_CREATE_PHYSICAL_LINK = 0x0435;
68    CMD_ACCEPT_PHYSICAL_LINK = 0x0436;
69    CMD_DISCONNECT_PHYSICAL_LINK = 0x0437;
70    CMD_CREATE_LOGICAL_LINK = 0x0438;
71    CMD_ACCEPT_LOGICAL_LINK = 0x0439;
72    CMD_DISCONNECT_LOGICAL_LINK = 0x043A;
73    CMD_LOGICAL_LINK_CANCEL = 0x043B;
74    CMD_FLOW_SPEC_MODIFY = 0x043C;
75    // END: AMP commands
76    CMD_ENH_SETUP_ESCO_CONNECTION = 0x043D;
77    CMD_ENH_ACCEPT_ESCO_CONNECTION = 0x043E;
78    CMD_TRUNCATED_PAGE = 0x043F;
79    CMD_TRUNCATED_PAGE_CANCEL = 0x0440;
80    CMD_SET_CLB = 0x0441;
81    CMD_RECEIVE_CLB = 0x0442;
82    CMD_START_SYNC_TRAIN = 0x0443;
83    CMD_RECEIVE_SYNC_TRAIN = 0x0444;
84    CMD_REM_OOB_EXTENDED_DATA_REQ_REPLY = 0x0445; // Not currently used in system/bt
85    // Link policy commands 0x0800
86    CMD_HOLD_MODE = 0x0801;
87    CMD_SNIFF_MODE = 0x0803;
88    CMD_EXIT_SNIFF_MODE = 0x0804;
89    CMD_PARK_MODE = 0x0805;
90    CMD_EXIT_PARK_MODE = 0x0806;
91    CMD_QOS_SETUP = 0x0807;
92    CMD_ROLE_DISCOVERY = 0x0809;
93    CMD_SWITCH_ROLE = 0x080B;
94    CMD_READ_POLICY_SETTINGS = 0x080C;
95    CMD_WRITE_POLICY_SETTINGS = 0x080D;
96    CMD_READ_DEF_POLICY_SETTINGS = 0x080E;
97    CMD_WRITE_DEF_POLICY_SETTINGS = 0x080F;
98    CMD_FLOW_SPECIFICATION = 0x0810;
99    CMD_SNIFF_SUB_RATE = 0x0811;
100    // Host controller baseband commands 0x0C00
101    CMD_SET_EVENT_MASK = 0x0C01;
102    CMD_RESET = 0x0C03;
103    CMD_SET_EVENT_FILTER = 0x0C05;
104    CMD_FLUSH = 0x0C08;
105    CMD_READ_PIN_TYPE = 0x0C09;
106    CMD_WRITE_PIN_TYPE = 0x0C0A;
107    CMD_CREATE_NEW_UNIT_KEY = 0x0C0B;
108    CMD_GET_MWS_TRANS_LAYER_CFG = 0x0C0C; // Deprecated (not used in spec)
109    CMD_READ_STORED_LINK_KEY = 0x0C0D;
110    CMD_WRITE_STORED_LINK_KEY = 0x0C11;
111    CMD_DELETE_STORED_LINK_KEY = 0x0C12;
112    CMD_CHANGE_LOCAL_NAME = 0x0C13;
113    CMD_READ_LOCAL_NAME = 0x0C14;
114    CMD_READ_CONN_ACCEPT_TOUT = 0x0C15;
115    CMD_WRITE_CONN_ACCEPT_TOUT = 0x0C16;
116    CMD_READ_PAGE_TOUT = 0x0C17;
117    CMD_WRITE_PAGE_TOUT = 0x0C18;
118    CMD_READ_SCAN_ENABLE = 0x0C19;
119    CMD_WRITE_SCAN_ENABLE = 0x0C1A;
120    CMD_READ_PAGESCAN_CFG = 0x0C1B;
121    CMD_WRITE_PAGESCAN_CFG = 0x0C1C;
122    CMD_READ_INQUIRYSCAN_CFG = 0x0C1D;
123    CMD_WRITE_INQUIRYSCAN_CFG = 0x0C1E;
124    CMD_READ_AUTHENTICATION_ENABLE = 0x0C1F;
125    CMD_WRITE_AUTHENTICATION_ENABLE = 0x0C20;
126    CMD_READ_ENCRYPTION_MODE = 0x0C21; // Deprecated
127    CMD_WRITE_ENCRYPTION_MODE = 0x0C22; // Deprecated
128    CMD_READ_CLASS_OF_DEVICE = 0x0C23;
129    CMD_WRITE_CLASS_OF_DEVICE = 0x0C24;
130    CMD_READ_VOICE_SETTINGS = 0x0C25;
131    CMD_WRITE_VOICE_SETTINGS = 0x0C26;
132    CMD_READ_AUTOMATIC_FLUSH_TIMEOUT = 0x0C27;
133    CMD_WRITE_AUTOMATIC_FLUSH_TIMEOUT = 0x0C28;
134    CMD_READ_NUM_BCAST_REXMITS = 0x0C29;
135    CMD_WRITE_NUM_BCAST_REXMITS = 0x0C2A;
136    CMD_READ_HOLD_MODE_ACTIVITY = 0x0C2B;
137    CMD_WRITE_HOLD_MODE_ACTIVITY = 0x0C2C;
138    CMD_READ_TRANSMIT_POWER_LEVEL = 0x0C2D;
139    CMD_READ_SCO_FLOW_CTRL_ENABLE = 0x0C2E;
140    CMD_WRITE_SCO_FLOW_CTRL_ENABLE = 0x0C2F;
141    CMD_SET_HC_TO_HOST_FLOW_CTRL = 0x0C31;
142    CMD_HOST_BUFFER_SIZE = 0x0C33;
143    CMD_HOST_NUM_PACKETS_DONE = 0x0C35;
144    CMD_READ_LINK_SUPER_TOUT = 0x0C36;
145    CMD_WRITE_LINK_SUPER_TOUT = 0x0C37;
146    CMD_READ_NUM_SUPPORTED_IAC = 0x0C38;
147    CMD_READ_CURRENT_IAC_LAP = 0x0C39;
148    CMD_WRITE_CURRENT_IAC_LAP = 0x0C3A;
149    CMD_READ_PAGESCAN_PERIOD_MODE = 0x0C3B; // Deprecated
150    CMD_WRITE_PAGESCAN_PERIOD_MODE = 0x0C3C; // Deprecated
151    CMD_READ_PAGESCAN_MODE = 0x0C3D; // Deprecated
152    CMD_WRITE_PAGESCAN_MODE = 0x0C3E; // Deprecated
153    CMD_SET_AFH_CHANNELS = 0x0C3F;
154    CMD_READ_INQSCAN_TYPE = 0x0C42;
155    CMD_WRITE_INQSCAN_TYPE = 0x0C43;
156    CMD_READ_INQUIRY_MODE = 0x0C44;
157    CMD_WRITE_INQUIRY_MODE = 0x0C45;
158    CMD_READ_PAGESCAN_TYPE = 0x0C46;
159    CMD_WRITE_PAGESCAN_TYPE = 0x0C47;
160    CMD_READ_AFH_ASSESSMENT_MODE = 0x0C48;
161    CMD_WRITE_AFH_ASSESSMENT_MODE = 0x0C49;
162    CMD_READ_EXT_INQ_RESPONSE = 0x0C51;
163    CMD_WRITE_EXT_INQ_RESPONSE = 0x0C52;
164    CMD_REFRESH_ENCRYPTION_KEY = 0x0C53;
165    CMD_READ_SIMPLE_PAIRING_MODE = 0x0C55;
166    CMD_WRITE_SIMPLE_PAIRING_MODE = 0x0C56;
167    CMD_READ_LOCAL_OOB_DATA = 0x0C57;
168    CMD_READ_INQ_TX_POWER_LEVEL = 0x0C58;
169    CMD_WRITE_INQ_TX_POWER_LEVEL = 0x0C59;
170    CMD_READ_ERRONEOUS_DATA_RPT = 0x0C5A;
171    CMD_WRITE_ERRONEOUS_DATA_RPT = 0x0C5B;
172    CMD_ENHANCED_FLUSH = 0x0C5F;
173    CMD_SEND_KEYPRESS_NOTIF = 0x0C60;
174    CMD_READ_LOGICAL_LINK_ACCEPT_TIMEOUT = 0x0C61;
175    CMD_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT = 0x0C62;
176    CMD_SET_EVENT_MASK_PAGE_2 = 0x0C63;
177    CMD_READ_LOCATION_DATA = 0x0C64;
178    CMD_WRITE_LOCATION_DATA = 0x0C65;
179    CMD_READ_FLOW_CONTROL_MODE = 0x0C66;
180    CMD_WRITE_FLOW_CONTROL_MODE = 0x0C67;
181    CMD_READ_ENHANCED_TX_PWR_LEVEL = 0x0C68; // Not currently used in system/bt
182    CMD_READ_BE_FLUSH_TOUT = 0x0C69;
183    CMD_WRITE_BE_FLUSH_TOUT = 0x0C6A;
184    CMD_SHORT_RANGE_MODE = 0x0C6B;
185    CMD_READ_BLE_HOST_SUPPORT = 0x0C6C;
186    CMD_WRITE_BLE_HOST_SUPPORT = 0x0C6D;
187    CMD_SET_MWS_CHANNEL_PARAMETERS = 0x0C6E;
188    CMD_SET_EXTERNAL_FRAME_CONFIGURATION = 0x0C6F;
189    CMD_SET_MWS_SIGNALING = 0x0C70;
190    CMD_SET_MWS_TRANSPORT_LAYER = 0x0C71;
191    CMD_SET_MWS_SCAN_FREQUENCY_TABLE = 0x0C72;
192    CMD_SET_MWS_PATTERN_CONFIGURATION = 0x0C73;
193    CMD_SET_RESERVED_LT_ADDR = 0x0C74;
194    CMD_DELETE_RESERVED_LT_ADDR = 0x0C75;
195    CMD_WRITE_CLB_DATA = 0x0C76;
196    CMD_READ_SYNC_TRAIN_PARAM = 0x0C77;
197    CMD_WRITE_SYNC_TRAIN_PARAM = 0x0C78;
198    CMD_READ_SECURE_CONNS_SUPPORT = 0x0C79;
199    CMD_WRITE_SECURE_CONNS_SUPPORT = 0x0C7A;
200    CMD_READ_AUTHED_PAYLOAD_TIMEOUT = 0x0C7B; // Not currently used in system/bt
201    CMD_WRITE_AUTHED_PAYLOAD_TIMEOUT = 0x0C7C; // Not currently used in system/bt
202    CMD_READ_LOCAL_OOB_EXTENDED_DATA = 0x0C7D; // Not currently used in system/bt
203    CMD_READ_EXTENDED_PAGE_TIMEOUT = 0x0C7E; // Not currently used in system/bt
204    CMD_WRITE_EXTENDED_PAGE_TIMEOUT = 0x0C7F; // Not currently used in system/bt
205    CMD_READ_EXTENDED_INQUIRY_LENGTH = 0x0C80; // Not currently used in system/bt
206    CMD_WRITE_EXTENDED_INQUIRY_LENGTH = 0x0C81; // Not currently used in system/bt
207    // Informational parameter commands 0x1000
208    CMD_READ_LOCAL_VERSION_INFO = 0x1001;
209    CMD_READ_LOCAL_SUPPORTED_CMDS = 0x1002;
210    CMD_READ_LOCAL_FEATURES = 0x1003;
211    CMD_READ_LOCAL_EXT_FEATURES = 0x1004;
212    CMD_READ_BUFFER_SIZE = 0x1005;
213    CMD_READ_COUNTRY_CODE = 0x1007; // Deprecated
214    CMD_READ_BD_ADDR = 0x1009;
215    CMD_READ_DATA_BLOCK_SIZE = 0x100A;
216    CMD_READ_LOCAL_SUPPORTED_CODECS = 0x100B;
217    // Status parameter commands 0x1400
218    CMD_READ_FAILED_CONTACT_COUNTER = 0x1401;
219    CMD_RESET_FAILED_CONTACT_COUNTER = 0x1402;
220    CMD_GET_LINK_QUALITY = 0x1403;
221    CMD_READ_RSSI = 0x1405;
222    CMD_READ_AFH_CH_MAP = 0x1406;
223    CMD_READ_CLOCK = 0x1407;
224    CMD_READ_ENCR_KEY_SIZE = 0x1408;
225    CMD_READ_LOCAL_AMP_INFO = 0x1409;
226    CMD_READ_LOCAL_AMP_ASSOC = 0x140A;
227    CMD_WRITE_REMOTE_AMP_ASSOC = 0x140B;
228    CMD_GET_MWS_TRANSPORT_CFG = 0x140C; // Not currently used in system/bt
229    CMD_SET_TRIGGERED_CLK_CAPTURE = 0x140D; // Not currently used in system/bt
230    // Testing commands 0x1800
231    CMD_READ_LOOPBACK_MODE = 0x1801;
232    CMD_WRITE_LOOPBACK_MODE = 0x1802;
233    CMD_ENABLE_DEV_UNDER_TEST_MODE = 0x1803;
234    CMD_WRITE_SIMP_PAIR_DEBUG_MODE = 0x1804;
235    CMD_ENABLE_AMP_RCVR_REPORTS = 0x1807;
236    CMD_AMP_TEST_END = 0x1808;
237    CMD_AMP_TEST = 0x1809;
238    CMD_WRITE_SECURE_CONN_TEST_MODE = 0x180A; // Not currently used in system/bt
239    // BLE commands 0x2000
240    CMD_BLE_SET_EVENT_MASK = 0x2001;
241    CMD_BLE_READ_BUFFER_SIZE = 0x2002;
242    CMD_BLE_READ_LOCAL_SPT_FEAT = 0x2003;
243    CMD_BLE_WRITE_LOCAL_SPT_FEAT = 0x2004;
244    CMD_BLE_WRITE_RANDOM_ADDR = 0x2005;
245    CMD_BLE_WRITE_ADV_PARAMS = 0x2006;
246    CMD_BLE_READ_ADV_CHNL_TX_POWER = 0x2007;
247    CMD_BLE_WRITE_ADV_DATA = 0x2008;
248    CMD_BLE_WRITE_SCAN_RSP_DATA = 0x2009;
249    CMD_BLE_WRITE_ADV_ENABLE = 0x200A;
250    CMD_BLE_WRITE_SCAN_PARAMS = 0x200B;
251    CMD_BLE_WRITE_SCAN_ENABLE = 0x200C;
252    CMD_BLE_CREATE_LL_CONN = 0x200D;
253    CMD_BLE_CREATE_CONN_CANCEL = 0x200E;
254    CMD_BLE_READ_WHITE_LIST_SIZE = 0x200F;
255    CMD_BLE_CLEAR_WHITE_LIST = 0x2010;
256    CMD_BLE_ADD_WHITE_LIST = 0x2011;
257    CMD_BLE_REMOVE_WHITE_LIST = 0x2012;
258    CMD_BLE_UPD_LL_CONN_PARAMS = 0x2013;
259    CMD_BLE_SET_HOST_CHNL_CLASS = 0x2014;
260    CMD_BLE_READ_CHNL_MAP = 0x2015;
261    CMD_BLE_READ_REMOTE_FEAT = 0x2016;
262    CMD_BLE_ENCRYPT = 0x2017;
263    CMD_BLE_RAND = 0x2018;
264    CMD_BLE_START_ENC = 0x2019;
265    CMD_BLE_LTK_REQ_REPLY = 0x201A;
266    CMD_BLE_LTK_REQ_NEG_REPLY = 0x201B;
267    CMD_BLE_READ_SUPPORTED_STATES = 0x201C;
268    CMD_BLE_RECEIVER_TEST = 0x201D;
269    CMD_BLE_TRANSMITTER_TEST = 0x201E;
270    CMD_BLE_TEST_END = 0x201F;
271    CMD_BLE_RC_PARAM_REQ_REPLY = 0x2020;
272    CMD_BLE_RC_PARAM_REQ_NEG_REPLY = 0x2021;
273    CMD_BLE_SET_DATA_LENGTH = 0x2022;
274    CMD_BLE_READ_DEFAULT_DATA_LENGTH = 0x2023;
275    CMD_BLE_WRITE_DEFAULT_DATA_LENGTH = 0x2024;
276    CMD_BLE_GENERATE_DHKEY = 0x2026; // Not currently used in system/bt
277    CMD_BLE_ADD_DEV_RESOLVING_LIST = 0x2027;
278    CMD_BLE_RM_DEV_RESOLVING_LIST = 0x2028;
279    CMD_BLE_CLEAR_RESOLVING_LIST = 0x2029;
280    CMD_BLE_READ_RESOLVING_LIST_SIZE = 0x202A;
281    CMD_BLE_READ_RESOLVABLE_ADDR_PEER = 0x202B;
282    CMD_BLE_READ_RESOLVABLE_ADDR_LOCAL = 0x202C;
283    CMD_BLE_SET_ADDR_RESOLUTION_ENABLE = 0x202D;
284    CMD_BLE_SET_RAND_PRIV_ADDR_TIMOUT = 0x202E;
285    CMD_BLE_READ_MAXIMUM_DATA_LENGTH = 0x202F;
286    CMD_BLE_READ_PHY = 0x2030;
287    CMD_BLE_SET_DEFAULT_PHY = 0x2031;
288    CMD_BLE_SET_PHY = 0x2032;
289    CMD_BLE_ENH_RECEIVER_TEST = 0x2033;
290    CMD_BLE_ENH_TRANSMITTER_TEST = 0x2034;
291    CMD_BLE_SET_EXT_ADVERTISING_RANDOM_ADDRESS = 0x2035;
292    CMD_BLE_SET_EXT_ADVERTISING_PARAM = 0x2036;
293    CMD_BLE_SET_EXT_ADVERTISING_DATA = 0x2037;
294    CMD_BLE_SET_EXT_ADVERTISING_SCAN_RESP = 0x2038;
295    CMD_BLE_SET_EXT_ADVERTISING_ENABLE = 0x2039;
296    CMD_BLE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH = 0x203A;
297    CMD_BLE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS = 0x203B;
298    CMD_BLE_REMOVE_ADVERTISING_SET = 0x203C;
299    CMD_BLE_CLEAR_ADVERTISING_SETS = 0x203D;
300    CMD_BLE_SET_PERIODIC_ADVERTISING_PARAM = 0x203E;
301    CMD_BLE_SET_PERIODIC_ADVERTISING_DATA = 0x203F;
302    CMD_BLE_SET_PERIODIC_ADVERTISING_ENABLE = 0x2040;
303    CMD_BLE_SET_EXTENDED_SCAN_PARAMETERS = 0x2041;
304    CMD_BLE_SET_EXTENDED_SCAN_ENABLE = 0x2042;
305    CMD_BLE_EXTENDED_CREATE_CONNECTION = 0x2043;
306    CMD_BLE_PERIODIC_ADVERTISING_CREATE_SYNC = 0x2044;
307    CMD_BLE_PERIODIC_ADVERTISING_CREATE_SYNC_CANCEL = 0x2045;
308    CMD_BLE_PERIODIC_ADVERTISING_TERMINATE_SYNC = 0x2046;
309    CMD_BLE_ADD_DEVICE_TO_PERIODIC_ADVERTISING_LIST = 0x2047;
310    CMD_BLE_RM_DEVICE_FROM_PERIODIC_ADVERTISING_LIST = 0x2048;
311    CMD_BLE_CLEAR_PERIODIC_ADVERTISING_LIST = 0x2049;
312    CMD_BLE_READ_PERIODIC_ADVERTISING_LIST_SIZE = 0x204A;
313    CMD_BLE_READ_TRANSMIT_POWER = 0x204B;
314    CMD_BLE_READ_RF_COMPENS_POWER = 0x204C;
315    CMD_BLE_WRITE_RF_COMPENS_POWER = 0x204D;
316    CMD_BLE_SET_PRIVACY_MODE = 0x204E;
317    // Vendor specific commands 0xFC00 and above
318    // Android vendor specific commands defined in
319    // https://source.android.com/devices/bluetooth/hci_requirements#vendor-specific-capabilities
320    CMD_BLE_VENDOR_CAP = 0xFD53;
321    CMD_BLE_MULTI_ADV = 0xFD54;
322    CMD_BLE_BATCH_SCAN = 0xFD56;
323    CMD_BLE_ADV_FILTER = 0xFD57;
324    CMD_BLE_TRACK_ADV = 0xFD58;
325    CMD_BLE_ENERGY_INFO = 0xFD59;
326    CMD_BLE_EXTENDED_SCAN_PARAMS = 0xFD5A;
327    CMD_CONTROLLER_DEBUG_INFO = 0xFD5B;
328    CMD_CONTROLLER_A2DP_OPCODE = 0xFD5D;
329    CMD_BRCM_SET_ACL_PRIORITY = 0xFC57;
330    // Other vendor specific commands below here
331}
332
333// HCI event codes from the Bluetooth 5.0 specification Vol 2, Part 7, Section 7
334// Original definition: system/bt/stack/include/hcidefs.h
335enum EventEnum {
336    // Event is at most 1 byte (0xFF), thus 0xFFF must not be a valid value
337    EVT_UNKNOWN = 0xFFF;
338    EVT_INQUIRY_COMP = 0x01;
339    EVT_INQUIRY_RESULT = 0x02;
340    EVT_CONNECTION_COMP = 0x03;
341    EVT_CONNECTION_REQUEST = 0x04;
342    EVT_DISCONNECTION_COMP = 0x05;
343    EVT_AUTHENTICATION_COMP = 0x06;
344    EVT_RMT_NAME_REQUEST_COMP = 0x07;
345    EVT_ENCRYPTION_CHANGE = 0x08;
346    EVT_CHANGE_CONN_LINK_KEY = 0x09;
347    EVT_MASTER_LINK_KEY_COMP = 0x0A;
348    EVT_READ_RMT_FEATURES_COMP = 0x0B;
349    EVT_READ_RMT_VERSION_COMP = 0x0C;
350    EVT_QOS_SETUP_COMP = 0x0D;
351    EVT_COMMAND_COMPLETE = 0x0E;
352    EVT_COMMAND_STATUS = 0x0F;
353    EVT_HARDWARE_ERROR = 0x10;
354    EVT_FLUSH_OCCURRED = 0x11;
355    EVT_ROLE_CHANGE = 0x12;
356    EVT_NUM_COMPL_DATA_PKTS = 0x13;
357    EVT_MODE_CHANGE = 0x14;
358    EVT_RETURN_LINK_KEYS = 0x15;
359    EVT_PIN_CODE_REQUEST = 0x16;
360    EVT_LINK_KEY_REQUEST = 0x17;
361    EVT_LINK_KEY_NOTIFICATION = 0x18;
362    EVT_LOOPBACK_COMMAND = 0x19;
363    EVT_DATA_BUF_OVERFLOW = 0x1A;
364    EVT_MAX_SLOTS_CHANGED = 0x1B;
365    EVT_READ_CLOCK_OFF_COMP = 0x1C;
366    EVT_CONN_PKT_TYPE_CHANGE = 0x1D;
367    EVT_QOS_VIOLATION = 0x1E;
368    EVT_PAGE_SCAN_MODE_CHANGE = 0x1F; // Deprecated
369    EVT_PAGE_SCAN_REP_MODE_CHNG = 0x20;
370    EVT_FLOW_SPECIFICATION_COMP = 0x21;
371    EVT_INQUIRY_RSSI_RESULT = 0x22;
372    EVT_READ_RMT_EXT_FEATURES_COMP = 0x23;
373    EVT_ESCO_CONNECTION_COMP = 0x2C;
374    EVT_ESCO_CONNECTION_CHANGED = 0x2D;
375    EVT_SNIFF_SUB_RATE = 0x2E;
376    EVT_EXTENDED_INQUIRY_RESULT = 0x2F;
377    EVT_ENCRYPTION_KEY_REFRESH_COMP = 0x30;
378    EVT_IO_CAPABILITY_REQUEST = 0x31;
379    EVT_IO_CAPABILITY_RESPONSE = 0x32;
380    EVT_USER_CONFIRMATION_REQUEST = 0x33;
381    EVT_USER_PASSKEY_REQUEST = 0x34;
382    EVT_REMOTE_OOB_DATA_REQUEST = 0x35;
383    EVT_SIMPLE_PAIRING_COMPLETE = 0x36;
384    EVT_LINK_SUPER_TOUT_CHANGED = 0x38;
385    EVT_ENHANCED_FLUSH_COMPLETE = 0x39;
386    EVT_USER_PASSKEY_NOTIFY = 0x3B;
387    EVT_KEYPRESS_NOTIFY = 0x3C;
388    EVT_RMT_HOST_SUP_FEAT_NOTIFY = 0x3D;
389    EVT_BLE_META = 0x3E;
390    EVT_PHYSICAL_LINK_COMP = 0x40;
391    EVT_CHANNEL_SELECTED = 0x41;
392    EVT_DISC_PHYSICAL_LINK_COMP = 0x42;
393    EVT_PHY_LINK_LOSS_EARLY_WARNING = 0x43;
394    EVT_PHY_LINK_RECOVERY = 0x44;
395    EVT_LOGICAL_LINK_COMP = 0x45;
396    EVT_DISC_LOGICAL_LINK_COMP = 0x46;
397    EVT_FLOW_SPEC_MODIFY_COMP = 0x47;
398    EVT_NUM_COMPL_DATA_BLOCKS = 0x48;
399    EVT_AMP_TEST_START = 0x49; // Not currently used in system/bt
400    EVT_AMP_TEST_END = 0x4A; // Not currently used in system/bt
401    EVT_AMP_RECEIVER_RPT = 0x4B; // Not currently used in system/bt
402    EVT_SHORT_RANGE_MODE_COMPLETE = 0x4C;
403    EVT_AMP_STATUS_CHANGE = 0x4D;
404    EVT_SET_TRIGGERED_CLOCK_CAPTURE = 0x4E;
405    EVT_SYNC_TRAIN_CMPL = 0x4F; // Not currently used in system/bt
406    EVT_SYNC_TRAIN_RCVD = 0x50; // Not currently used in system/bt
407    EVT_CONNLESS_SLAVE_BROADCAST_RCVD = 0x51; // Not currently used in system/bt
408    EVT_CONNLESS_SLAVE_BROADCAST_TIMEOUT = 0x52; // Not currently used in system/bt
409    EVT_TRUNCATED_PAGE_CMPL = 0x53; // Not currently used in system/bt
410    EVT_SLAVE_PAGE_RES_TIMEOUT = 0x54; // Not currently used in system/bt
411    EVT_CONNLESS_SLAVE_BROADCAST_CHNL_MAP_CHANGE = 0x55; // Not currently used in system/bt
412    EVT_INQUIRY_RES_NOTIFICATION = 0x56; // Not currently used in system/bt
413    EVT_AUTHED_PAYLOAD_TIMEOUT = 0x57; // Not currently used in system/bt
414    EVT_SAM_STATUS_CHANGE = 0x58; // Not currently used in system/bt
415}
416
417// Bluetooth low energy related meta event codes
418// from the Bluetooth 5.0 specification Vol 2, Part E, Section 7.7.65
419// Original definition: system/bt/stack/include/hcidefs.h
420enum BleMetaEventEnum {
421    // BLE meta event code is at most 1 byte (0xFF), thus 0xFFF must not be a valid value
422    BLE_EVT_UNKNOWN = 0xFFF;
423    BLE_EVT_CONN_COMPLETE_EVT = 0x01;
424    BLE_EVT_ADV_PKT_RPT_EVT = 0x02;
425    BLE_EVT_LL_CONN_PARAM_UPD_EVT = 0x03;
426    BLE_EVT_READ_REMOTE_FEAT_CMPL_EVT = 0x04;
427    BLE_EVT_LTK_REQ_EVT = 0x05;
428    BLE_EVT_RC_PARAM_REQ_EVT = 0x06;
429    BLE_EVT_DATA_LENGTH_CHANGE_EVT = 0x07;
430    BLE_EVT_READ_LOCAL_P256_PUB_KEY = 0x08; // Not currently used in system/bt
431    BLE_EVT_GEN_DHKEY_CMPL = 0x09; // Not currently used in system/bt
432    BLE_EVT_ENHANCED_CONN_COMPLETE_EVT = 0x0a;
433    BLE_EVT_DIRECT_ADV_EVT = 0x0b;
434    BLE_EVT_PHY_UPDATE_COMPLETE_EVT = 0x0c;
435    BLE_EVT_EXTENDED_ADVERTISING_REPORT_EVT = 0x0D;
436    BLE_EVT_PERIODIC_ADV_SYNC_EST_EVT = 0x0E;
437    BLE_EVT_PERIODIC_ADV_REPORT_EVT = 0x0F;
438    BLE_EVT_PERIODIC_ADV_SYNC_LOST_EVT = 0x10;
439    BLE_EVT_SCAN_TIMEOUT_EVT = 0x11;
440    BLE_EVT_ADVERTISING_SET_TERMINATED_EVT = 0x12;
441    BLE_EVT_SCAN_REQ_RX_EVT = 0x13;
442    BLE_EVT_CHNL_SELECTION_ALGORITHM = 0x14; // Not currently used in system/bt
443}
444
445// HCI status code from the Bluetooth 5.0 specification Vol 2, Part D.
446// Original definition: system/bt/stack/include/hcidefs.h
447enum StatusEnum {
448    // Status is at most 1 byte (0xFF), thus 0xFFF must not be a valid value
449    STATUS_UNKNOWN = 0xFFF;
450    STATUS_SUCCESS = 0x00;
451    STATUS_ILLEGAL_COMMAND = 0x01;
452    STATUS_NO_CONNECTION = 0x02;
453    STATUS_HW_FAILURE = 0x03;
454    STATUS_PAGE_TIMEOUT = 0x04;
455    STATUS_AUTH_FAILURE = 0x05;
456    STATUS_KEY_MISSING = 0x06;
457    STATUS_MEMORY_FULL = 0x07;
458    STATUS_CONNECTION_TOUT = 0x08;
459    STATUS_MAX_NUM_OF_CONNECTIONS = 0x09;
460    STATUS_MAX_NUM_OF_SCOS = 0x0A;
461    STATUS_CONNECTION_EXISTS = 0x0B;
462    STATUS_COMMAND_DISALLOWED = 0x0C;
463    STATUS_HOST_REJECT_RESOURCES = 0x0D;
464    STATUS_HOST_REJECT_SECURITY = 0x0E;
465    STATUS_HOST_REJECT_DEVICE = 0x0F;
466    STATUS_HOST_TIMEOUT = 0x10;
467    STATUS_UNSUPPORTED_VALUE = 0x11;
468    STATUS_ILLEGAL_PARAMETER_FMT = 0x12;
469    STATUS_PEER_USER = 0x13;
470    STATUS_PEER_LOW_RESOURCES = 0x14;
471    STATUS_PEER_POWER_OFF = 0x15;
472    STATUS_CONN_CAUSE_LOCAL_HOST = 0x16;
473    STATUS_REPEATED_ATTEMPTS = 0x17;
474    STATUS_PAIRING_NOT_ALLOWED = 0x18;
475    STATUS_UNKNOWN_LMP_PDU = 0x19;
476    STATUS_UNSUPPORTED_REM_FEATURE = 0x1A;
477    STATUS_SCO_OFFSET_REJECTED = 0x1B;
478    STATUS_SCO_INTERVAL_REJECTED = 0x1C;
479    STATUS_SCO_AIR_MODE = 0x1D;
480    STATUS_INVALID_LMP_PARAM = 0x1E;
481    STATUS_UNSPECIFIED = 0x1F;
482    STATUS_UNSUPPORTED_LMP_FEATURE = 0x20;
483    STATUS_ROLE_CHANGE_NOT_ALLOWED = 0x21;
484    STATUS_LMP_RESPONSE_TIMEOUT = 0x22;
485    STATUS_LMP_STATUS_TRANS_COLLISION = 0x23;
486    STATUS_LMP_PDU_NOT_ALLOWED = 0x24;
487    STATUS_ENCRY_MODE_NOT_ACCEPTABLE = 0x25;
488    STATUS_UNIT_KEY_USED = 0x26;
489    STATUS_QOS_NOT_SUPPORTED = 0x27;
490    STATUS_INSTANT_PASSED = 0x28;
491    STATUS_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = 0x29;
492    STATUS_DIFF_TRANSACTION_COLLISION = 0x2A;
493    STATUS_UNDEFINED_0x2B = 0x2B; // Not used
494    STATUS_QOS_UNACCEPTABLE_PARAM = 0x2C;
495    STATUS_QOS_REJECTED = 0x2D;
496    STATUS_CHAN_CLASSIF_NOT_SUPPORTED = 0x2E;
497    STATUS_INSUFFCIENT_SECURITY = 0x2F;
498    STATUS_PARAM_OUT_OF_RANGE = 0x30;
499    STATUS_UNDEFINED_0x31 = 0x31; // Not used
500    STATUS_ROLE_SWITCH_PENDING = 0x32;
501    STATUS_UNDEFINED_0x33 = 0x33;
502    STATUS_RESERVED_SLOT_VIOLATION = 0x34;
503    STATUS_ROLE_SWITCH_FAILED = 0x35;
504    STATUS_INQ_RSP_DATA_TOO_LARGE = 0x36;
505    STATUS_SIMPLE_PAIRING_NOT_SUPPORTED = 0x37;
506    STATUS_HOST_BUSY_PAIRING = 0x38;
507    STATUS_REJ_NO_SUITABLE_CHANNEL = 0x39;
508    STATUS_CONTROLLER_BUSY = 0x3A;
509    STATUS_UNACCEPT_CONN_INTERVAL = 0x3B;
510    STATUS_ADVERTISING_TIMEOUT = 0x3C;
511    STATUS_CONN_TOUT_DUE_TO_MIC_FAILURE = 0x3D;
512    STATUS_CONN_FAILED_ESTABLISHMENT = 0x3E;
513    STATUS_MAC_CONNECTION_FAILED = 0x3F;
514    STATUS_LT_ADDR_ALREADY_IN_USE = 0x40;
515    STATUS_LT_ADDR_NOT_ALLOCATED = 0x41;
516    STATUS_CLB_NOT_ENABLED = 0x42;
517    STATUS_CLB_DATA_TOO_BIG = 0x43;
518    STATUS_OPERATION_CANCELED_BY_HOST = 0x44; // Not currently used in system/bt
519}
520
521enum BqrIdEnum {
522    BQR_ID_UNKNOWN = 0x00;
523    BQR_ID_MONITOR_MODE = 0x01;
524    BQR_ID_APPROACH_LSTO = 0x02;
525    BQR_ID_A2DP_AUDIO_CHOPPY = 0x03;
526    BQR_ID_SCO_VOICE_CHOPPY = 0x04;
527}
528
529enum BqrPacketTypeEnum {
530    BQR_PACKET_TYPE_UNKNOWN = 0x00;
531    BQR_PACKET_TYPE_ID = 0x01;
532    BQR_PACKET_TYPE_NULL = 0x02;
533    BQR_PACKET_TYPE_POLL = 0x03;
534    BQR_PACKET_TYPE_FHS = 0x04;
535    BQR_PACKET_TYPE_HV1 = 0x05;
536    BQR_PACKET_TYPE_HV2 = 0x06;
537    BQR_PACKET_TYPE_HV3 = 0x07;
538    BQR_PACKET_TYPE_DV = 0x08;
539    BQR_PACKET_TYPE_EV3 = 0x09;
540    BQR_PACKET_TYPE_EV4 = 0x0A;
541    BQR_PACKET_TYPE_EV5 = 0x0B;
542    BQR_PACKET_TYPE_2EV3 = 0x0C;
543    BQR_PACKET_TYPE_2EV5 = 0x0D;
544    BQR_PACKET_TYPE_3EV3 = 0x0E;
545    BQR_PACKET_TYPE_3EV5 = 0x0F;
546    BQR_PACKET_TYPE_DM1 = 0x10;
547    BQR_PACKET_TYPE_DH1 = 0x11;
548    BQR_PACKET_TYPE_DM3 = 0x12;
549    BQR_PACKET_TYPE_DH3 = 0x13;
550    BQR_PACKET_TYPE_DM5 = 0x14;
551    BQR_PACKET_TYPE_DH5 = 0x15;
552    BQR_PACKET_TYPE_AUX1 = 0x16;
553    BQR_PACKET_TYPE_2DH1 = 0x17;
554    BQR_PACKET_TYPE_2DH3 = 0x18;
555    BQR_PACKET_TYPE_2DH5 = 0x19;
556    BQR_PACKET_TYPE_3DH1 = 0x1A;
557    BQR_PACKET_TYPE_3DH3 = 0x1B;
558    BQR_PACKET_TYPE_3DH5 = 0x1C;
559}
560