hid_conn.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2002-2012 Broadcom Corporation
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at:
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. ******************************************************************************/
  18. /******************************************************************************
  19. *
  20. * This file contains HID connection internal definitions
  21. *
  22. ******************************************************************************/
  23. #ifndef HID_CONN_H
  24. #define HID_CONN_H
  25. #include "common/bt_defs.h"
  26. #if (BT_HID_INCLUDED == TRUE)
  27. /* Define the HID Connection Block
  28. */
  29. typedef struct hid_conn {
  30. #define HID_CONN_STATE_UNUSED (0)
  31. #define HID_CONN_STATE_CONNECTING_CTRL (1)
  32. #define HID_CONN_STATE_CONNECTING_INTR (2)
  33. #define HID_CONN_STATE_CONFIG (3)
  34. #define HID_CONN_STATE_CONNECTED (4)
  35. #define HID_CONN_STATE_DISCONNECTING (5)
  36. #define HID_CONN_STATE_SECURITY (6)
  37. #define HID_CONN_STATE_DISCONNECTING_CTRL (7)
  38. #define HID_CONN_STATE_DISCONNECTING_INTR (8)
  39. UINT8 conn_state;
  40. #define HID_CONN_FLAGS_IS_ORIG (0x01)
  41. #define HID_CONN_FLAGS_HIS_CTRL_CFG_DONE (0x02)
  42. #define HID_CONN_FLAGS_MY_CTRL_CFG_DONE (0x04)
  43. #define HID_CONN_FLAGS_HIS_INTR_CFG_DONE (0x08)
  44. #define HID_CONN_FLAGS_MY_INTR_CFG_DONE (0x10)
  45. #define HID_CONN_FLAGS_ALL_CONFIGURED (0x1E) /* All the config done */
  46. #define HID_CONN_FLAGS_CONGESTED (0x20)
  47. #define HID_CONN_FLAGS_INACTIVE (0x40)
  48. UINT8 conn_flags;
  49. UINT8 ctrl_id;
  50. UINT16 ctrl_cid;
  51. UINT16 intr_cid;
  52. UINT16 rem_mtu_size;
  53. UINT16 disc_reason; /* Reason for disconnecting (for HID_HDEV_EVT_CLOSE) */
  54. TIMER_LIST_ENT timer_entry;
  55. } tHID_CONN;
  56. #define HID_SEC_CHN 1
  57. #define HID_NOSEC_CHN 2
  58. #define HIDD_SEC_CHN 3
  59. #define HIDD_NOSEC_CHN 4
  60. #endif ///BT_HID_INCLUDED == TRUE
  61. #endif