2 BlueZ - Bluetooth protocol stack for Linux
4 Copyright (C) 2010 Nokia Corporation
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation;
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
13 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
14 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
20 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
21 SOFTWARE IS DISCLAIMED.
24 #define MGMT_INDEX_NONE 0xFFFF
26 #define MGMT_STATUS_SUCCESS 0x00
27 #define MGMT_STATUS_UNKNOWN_COMMAND 0x01
28 #define MGMT_STATUS_NOT_CONNECTED 0x02
29 #define MGMT_STATUS_FAILED 0x03
30 #define MGMT_STATUS_CONNECT_FAILED 0x04
31 #define MGMT_STATUS_AUTH_FAILED 0x05
32 #define MGMT_STATUS_NOT_PAIRED 0x06
33 #define MGMT_STATUS_NO_RESOURCES 0x07
34 #define MGMT_STATUS_TIMEOUT 0x08
35 #define MGMT_STATUS_ALREADY_CONNECTED 0x09
36 #define MGMT_STATUS_BUSY 0x0a
37 #define MGMT_STATUS_REJECTED 0x0b
38 #define MGMT_STATUS_NOT_SUPPORTED 0x0c
39 #define MGMT_STATUS_INVALID_PARAMS 0x0d
40 #define MGMT_STATUS_DISCONNECTED 0x0e
41 #define MGMT_STATUS_NOT_POWERED 0x0f
49 #define MGMT_OP_READ_VERSION 0x0001
50 struct mgmt_rp_read_version {
55 #define MGMT_OP_READ_INDEX_LIST 0x0003
56 struct mgmt_rp_read_index_list {
57 __le16 num_controllers;
61 /* Reserve one extra byte for names in management messages so that they
62 * are always guaranteed to be nul-terminated */
63 #define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1)
65 #define MGMT_OP_READ_INFO 0x0004
66 struct mgmt_rp_read_info {
79 __u8 name[MGMT_MAX_NAME_LENGTH];
86 #define MGMT_OP_SET_POWERED 0x0005
88 #define MGMT_OP_SET_DISCOVERABLE 0x0006
89 struct mgmt_cp_set_discoverable {
94 #define MGMT_OP_SET_CONNECTABLE 0x0007
96 #define MGMT_OP_SET_PAIRABLE 0x0008
98 #define MGMT_OP_ADD_UUID 0x0009
99 struct mgmt_cp_add_uuid {
104 #define MGMT_OP_REMOVE_UUID 0x000A
105 struct mgmt_cp_remove_uuid {
109 #define MGMT_OP_SET_DEV_CLASS 0x000B
110 struct mgmt_cp_set_dev_class {
115 #define MGMT_OP_SET_SERVICE_CACHE 0x000C
116 struct mgmt_cp_set_service_cache {
120 struct mgmt_link_key_info {
127 #define MGMT_OP_LOAD_LINK_KEYS 0x000D
128 struct mgmt_cp_load_link_keys {
131 struct mgmt_link_key_info keys[0];
134 #define MGMT_OP_REMOVE_KEYS 0x000E
135 struct mgmt_cp_remove_keys {
139 struct mgmt_rp_remove_keys {
144 #define MGMT_OP_DISCONNECT 0x000F
145 struct mgmt_cp_disconnect {
148 struct mgmt_rp_disconnect {
153 #define MGMT_ADDR_BREDR 0x00
154 #define MGMT_ADDR_LE_PUBLIC 0x01
155 #define MGMT_ADDR_LE_RANDOM 0x02
156 #define MGMT_ADDR_INVALID 0xff
158 struct mgmt_addr_info {
163 #define MGMT_OP_GET_CONNECTIONS 0x0010
164 struct mgmt_rp_get_connections {
166 struct mgmt_addr_info addr[0];
169 #define MGMT_OP_PIN_CODE_REPLY 0x0011
170 struct mgmt_cp_pin_code_reply {
175 struct mgmt_rp_pin_code_reply {
180 #define MGMT_OP_PIN_CODE_NEG_REPLY 0x0012
181 struct mgmt_cp_pin_code_neg_reply {
185 #define MGMT_OP_SET_IO_CAPABILITY 0x0013
186 struct mgmt_cp_set_io_capability {
190 #define MGMT_OP_PAIR_DEVICE 0x0014
191 struct mgmt_cp_pair_device {
192 struct mgmt_addr_info addr;
195 struct mgmt_rp_pair_device {
196 struct mgmt_addr_info addr;
200 #define MGMT_OP_USER_CONFIRM_REPLY 0x0015
201 struct mgmt_cp_user_confirm_reply {
204 struct mgmt_rp_user_confirm_reply {
209 #define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x0016
211 #define MGMT_OP_SET_LOCAL_NAME 0x0017
212 struct mgmt_cp_set_local_name {
213 __u8 name[MGMT_MAX_NAME_LENGTH];
216 #define MGMT_OP_READ_LOCAL_OOB_DATA 0x0018
217 struct mgmt_rp_read_local_oob_data {
222 #define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0019
223 struct mgmt_cp_add_remote_oob_data {
229 #define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x001A
230 struct mgmt_cp_remove_remote_oob_data {
234 #define MGMT_OP_START_DISCOVERY 0x001B
235 struct mgmt_cp_start_discovery {
239 #define MGMT_OP_STOP_DISCOVERY 0x001C
241 #define MGMT_OP_BLOCK_DEVICE 0x001D
242 struct mgmt_cp_block_device {
246 #define MGMT_OP_UNBLOCK_DEVICE 0x001E
247 struct mgmt_cp_unblock_device {
251 #define MGMT_OP_SET_FAST_CONNECTABLE 0x001F
252 struct mgmt_cp_set_fast_connectable {
256 #define MGMT_OP_USER_PASSKEY_REPLY 0x0020
257 struct mgmt_cp_user_passkey_reply {
262 #define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x0021
263 struct mgmt_cp_user_passkey_neg_reply {
267 #define MGMT_EV_CMD_COMPLETE 0x0001
268 struct mgmt_ev_cmd_complete {
273 #define MGMT_EV_CMD_STATUS 0x0002
274 struct mgmt_ev_cmd_status {
279 #define MGMT_EV_CONTROLLER_ERROR 0x0003
280 struct mgmt_ev_controller_error {
284 #define MGMT_EV_INDEX_ADDED 0x0004
286 #define MGMT_EV_INDEX_REMOVED 0x0005
288 #define MGMT_EV_POWERED 0x0006
290 #define MGMT_EV_DISCOVERABLE 0x0007
292 #define MGMT_EV_CONNECTABLE 0x0008
294 #define MGMT_EV_PAIRABLE 0x0009
296 #define MGMT_EV_NEW_LINK_KEY 0x000A
297 struct mgmt_ev_new_link_key {
299 struct mgmt_link_key_info key;
302 #define MGMT_EV_CONNECTED 0x000B
304 #define MGMT_EV_DISCONNECTED 0x000C
306 #define MGMT_EV_CONNECT_FAILED 0x000D
307 struct mgmt_ev_connect_failed {
308 struct mgmt_addr_info addr;
312 #define MGMT_EV_PIN_CODE_REQUEST 0x000E
313 struct mgmt_ev_pin_code_request {
318 #define MGMT_EV_USER_CONFIRM_REQUEST 0x000F
319 struct mgmt_ev_user_confirm_request {
325 #define MGMT_EV_AUTH_FAILED 0x0010
326 struct mgmt_ev_auth_failed {
331 #define MGMT_EV_LOCAL_NAME_CHANGED 0x0011
332 struct mgmt_ev_local_name_changed {
333 __u8 name[MGMT_MAX_NAME_LENGTH];
336 #define MGMT_EV_DEVICE_FOUND 0x0012
337 struct mgmt_ev_device_found {
338 struct mgmt_addr_info addr;
341 __u8 eir[HCI_MAX_EIR_LENGTH];
344 #define MGMT_EV_REMOTE_NAME 0x0013
345 struct mgmt_ev_remote_name {
347 __u8 name[MGMT_MAX_NAME_LENGTH];
350 #define MGMT_EV_DISCOVERING 0x0014
352 #define MGMT_EV_DEVICE_BLOCKED 0x0015
353 struct mgmt_ev_device_blocked {
357 #define MGMT_EV_DEVICE_UNBLOCKED 0x0016
358 struct mgmt_ev_device_unblocked {
362 #define MGMT_EV_USER_PASSKEY_REQUEST 0x0017
363 struct mgmt_ev_user_passkey_request {