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
32 #define MGMT_OP_READ_VERSION 0x0001
33 struct mgmt_rp_read_version
{
38 #define MGMT_OP_READ_INDEX_LIST 0x0003
39 struct mgmt_rp_read_index_list
{
40 __le16 num_controllers
;
44 /* Reserve one extra byte for names in management messages so that they
45 * are always guaranteed to be nul-terminated */
46 #define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1)
48 #define MGMT_OP_READ_INFO 0x0004
49 struct mgmt_rp_read_info
{
62 __u8 name
[MGMT_MAX_NAME_LENGTH
];
69 #define MGMT_OP_SET_POWERED 0x0005
71 #define MGMT_OP_SET_DISCOVERABLE 0x0006
73 #define MGMT_OP_SET_CONNECTABLE 0x0007
75 #define MGMT_OP_SET_PAIRABLE 0x0008
77 #define MGMT_OP_ADD_UUID 0x0009
78 struct mgmt_cp_add_uuid
{
83 #define MGMT_OP_REMOVE_UUID 0x000A
84 struct mgmt_cp_remove_uuid
{
88 #define MGMT_OP_SET_DEV_CLASS 0x000B
89 struct mgmt_cp_set_dev_class
{
94 #define MGMT_OP_SET_SERVICE_CACHE 0x000C
95 struct mgmt_cp_set_service_cache
{
99 struct mgmt_key_info
{
108 #define MGMT_OP_LOAD_KEYS 0x000D
109 struct mgmt_cp_load_keys
{
112 struct mgmt_key_info keys
[0];
115 #define MGMT_OP_REMOVE_KEY 0x000E
116 struct mgmt_cp_remove_key
{
121 #define MGMT_OP_DISCONNECT 0x000F
122 struct mgmt_cp_disconnect
{
125 struct mgmt_rp_disconnect
{
129 #define MGMT_OP_GET_CONNECTIONS 0x0010
130 struct mgmt_rp_get_connections
{
135 #define MGMT_OP_PIN_CODE_REPLY 0x0011
136 struct mgmt_cp_pin_code_reply
{
141 struct mgmt_rp_pin_code_reply
{
146 #define MGMT_OP_PIN_CODE_NEG_REPLY 0x0012
147 struct mgmt_cp_pin_code_neg_reply
{
151 #define MGMT_OP_SET_IO_CAPABILITY 0x0013
152 struct mgmt_cp_set_io_capability
{
156 #define MGMT_OP_PAIR_DEVICE 0x0014
157 struct mgmt_cp_pair_device
{
161 struct mgmt_rp_pair_device
{
166 #define MGMT_OP_USER_CONFIRM_REPLY 0x0015
167 struct mgmt_cp_user_confirm_reply
{
170 struct mgmt_rp_user_confirm_reply
{
175 #define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x0016
177 #define MGMT_OP_SET_LOCAL_NAME 0x0017
178 struct mgmt_cp_set_local_name
{
179 __u8 name
[MGMT_MAX_NAME_LENGTH
];
182 #define MGMT_OP_READ_LOCAL_OOB_DATA 0x0018
183 struct mgmt_rp_read_local_oob_data
{
188 #define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0019
189 struct mgmt_cp_add_remote_oob_data
{
195 #define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x001A
196 struct mgmt_cp_remove_remote_oob_data
{
200 #define MGMT_OP_START_DISCOVERY 0x001B
202 #define MGMT_OP_STOP_DISCOVERY 0x001C
204 #define MGMT_OP_BLOCK_DEVICE 0x001D
205 struct mgmt_cp_block_device
{
209 #define MGMT_OP_UNBLOCK_DEVICE 0x001E
210 struct mgmt_cp_unblock_device
{
214 #define MGMT_EV_CMD_COMPLETE 0x0001
215 struct mgmt_ev_cmd_complete
{
220 #define MGMT_EV_CMD_STATUS 0x0002
221 struct mgmt_ev_cmd_status
{
226 #define MGMT_EV_CONTROLLER_ERROR 0x0003
227 struct mgmt_ev_controller_error
{
231 #define MGMT_EV_INDEX_ADDED 0x0004
233 #define MGMT_EV_INDEX_REMOVED 0x0005
235 #define MGMT_EV_POWERED 0x0006
237 #define MGMT_EV_DISCOVERABLE 0x0007
239 #define MGMT_EV_CONNECTABLE 0x0008
241 #define MGMT_EV_PAIRABLE 0x0009
243 #define MGMT_EV_NEW_KEY 0x000A
244 struct mgmt_ev_new_key
{
246 struct mgmt_key_info key
;
249 #define MGMT_EV_CONNECTED 0x000B
250 struct mgmt_ev_connected
{
255 #define MGMT_EV_DISCONNECTED 0x000C
256 struct mgmt_ev_disconnected
{
260 #define MGMT_EV_CONNECT_FAILED 0x000D
261 struct mgmt_ev_connect_failed
{
266 #define MGMT_EV_PIN_CODE_REQUEST 0x000E
267 struct mgmt_ev_pin_code_request
{
272 #define MGMT_EV_USER_CONFIRM_REQUEST 0x000F
273 struct mgmt_ev_user_confirm_request
{
279 #define MGMT_EV_AUTH_FAILED 0x0010
280 struct mgmt_ev_auth_failed
{
285 #define MGMT_EV_LOCAL_NAME_CHANGED 0x0011
286 struct mgmt_ev_local_name_changed
{
287 __u8 name
[MGMT_MAX_NAME_LENGTH
];
290 #define MGMT_EV_DEVICE_FOUND 0x0012
291 struct mgmt_ev_device_found
{
295 __u8 eir
[HCI_MAX_EIR_LENGTH
];
298 #define MGMT_EV_REMOTE_NAME 0x0013
299 struct mgmt_ev_remote_name
{
301 __u8 name
[MGMT_MAX_NAME_LENGTH
];
304 #define MGMT_EV_DISCOVERING 0x0014
306 #define MGMT_EV_DEVICE_BLOCKED 0x0015
307 struct mgmt_ev_device_blocked
{
311 #define MGMT_EV_DEVICE_UNBLOCKED 0x0016
312 struct mgmt_ev_device_unblocked
{