mgmt.h revision b02a68367321b323db81823f43d7332e35ce96fa
112d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg/* 212d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * BlueZ - Bluetooth protocol stack for Linux 312d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * 412d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * Copyright (C) 2010 Nokia Corporation 512d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * Copyright (C) 2010 Marcel Holtmann <marcel@holtmann.org> 612d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * 712d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * 812d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * This program is free software; you can redistribute it and/or modify 912d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * it under the terms of the GNU General Public License as published by 1012d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * the Free Software Foundation; either version 2 of the License, or 1112d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * (at your option) any later version. 1212d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * 1312d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * This program is distributed in the hope that it will be useful, 1412d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * but WITHOUT ANY WARRANTY; without even the implied warranty of 1512d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1612d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * GNU General Public License for more details. 1712d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * 1812d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * You should have received a copy of the GNU General Public License 1912d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * along with this program; if not, write to the Free Software 2012d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 2112d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg * 2212d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg */ 2312d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg 24b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg#ifndef __packed 25b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg#define __packed __attribute__((packed)) 26b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg#endif 27b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg 2812d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedbergstruct hci_mgmt_hdr { 2912d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg uint16_t opcode; 3012d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg uint16_t len; 3112d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg} __packed; 3212d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_HDR_SIZE 4 3312d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg 3412d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_OP_READ_VERSION 0x0001 35b02a68367321b323db81823f43d7332e35ce96faJohan Hedbergstruct hci_mgmt_read_version_rp { 36b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg uint8_t status; 37b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg uint8_t version; 38b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg uint16_t revision; 39b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg} __packed; 40b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg#define HCI_MGMT_READ_VERSION_RP_SIZE 4 41b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg 4212d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_OP_READ_FEATURES 0x0002 4312d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_OP_READ_INDEX_LIST 0x0003 4412d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_OP_READ_INFO 0x0004 4512d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_OP_READ_STATISTICS 0x0005 4612d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_OP_READ_MODE 0x0006 4712d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_OP_WRITE_MODE 0x0007 4812d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg 4912d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_EV_CMD_COMPLETE 0x0001 50b02a68367321b323db81823f43d7332e35ce96faJohan Hedbergstruct hci_mgmt_cmd_complete_ev { 51b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg uint16_t opcode; 52b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg uint8_t data[0]; 53b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg} __packed; 54b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg#define HCI_MGMT_CMD_COMPLETE_SIZE 2 55b02a68367321b323db81823f43d7332e35ce96faJohan Hedberg 5612d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_EV_CMD_STATUS 0x0002 5712d02e7f2283d0b1511fc7be08579b3037f5c9a9Johan Hedberg#define HCI_MGMT_EV_CONTROLLER_ERROR 0x0003 58