mgmt.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. BlueZ - Bluetooth protocol stack for Linux
  3. Copyright (C) 2010 Nokia Corporation
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License version 2 as
  6. published by the Free Software Foundation;
  7. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  8. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
  10. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
  11. CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
  12. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
  16. COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
  17. SOFTWARE IS DISCLAIMED.
  18. */
  19. struct mgmt_hdr {
  20. __le16 opcode;
  21. __le16 len;
  22. } __packed;
  23. #define MGMT_HDR_SIZE 4
  24. #define MGMT_OP_READ_VERSION 0x0001
  25. struct mgmt_rp_read_version {
  26. __u8 version;
  27. __le16 revision;
  28. } __packed;
  29. #define MGMT_OP_READ_INDEX_LIST 0x0003
  30. struct mgmt_rp_read_index_list {
  31. __le16 num_controllers;
  32. __le16 index[0];
  33. } __packed;
  34. #define MGMT_OP_READ_INFO 0x0004
  35. struct mgmt_cp_read_info {
  36. __le16 index;
  37. } __packed;
  38. struct mgmt_rp_read_info {
  39. __le16 index;
  40. __u8 type;
  41. __u8 powered;
  42. __u8 discoverable;
  43. __u8 pairable;
  44. __u8 sec_mode;
  45. bdaddr_t bdaddr;
  46. __u8 dev_class[3];
  47. __u8 features[8];
  48. __u16 manufacturer;
  49. __u8 hci_ver;
  50. __u16 hci_rev;
  51. } __packed;
  52. #define MGMT_EV_CMD_COMPLETE 0x0001
  53. struct mgmt_ev_cmd_complete {
  54. __le16 opcode;
  55. __u8 data[0];
  56. } __packed;
  57. #define MGMT_EV_CMD_STATUS 0x0002
  58. struct mgmt_ev_cmd_status {
  59. __u8 status;
  60. __le16 opcode;
  61. } __packed;
  62. #define MGMT_EV_CONTROLLER_ERROR 0x0003
  63. struct mgmt_ev_controller_error {
  64. __le16 index;
  65. __u8 error_code;
  66. } __packed;
  67. #define MGMT_EV_INDEX_ADDED 0x0004
  68. struct mgmt_ev_index_added {
  69. __le16 index;
  70. } __packed;
  71. #define MGMT_EV_INDEX_REMOVED 0x0005
  72. struct mgmt_ev_index_removed {
  73. __le16 index;
  74. } __packed;