1 /******************************************************************************
2  *
3  *  Copyright 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 #ifndef BTA_HH_API_H
19 #define BTA_HH_API_H
20 
21 #include <base/strings/stringprintf.h>
22 #include <bluetooth/log.h>
23 
24 #include <cstdint>
25 #include <string>
26 
27 #include "internal_include/bt_target.h"
28 #include "macros.h"
29 #include "stack/include/bt_hdr.h"
30 #include "stack/include/hiddefs.h"
31 #include "stack/include/l2cap_types.h"
32 #include "types/ble_address_with_type.h"
33 #include "types/bluetooth/uuid.h"
34 
35 /*****************************************************************************
36  *  Constants and Type Definitions
37  ****************************************************************************/
38 #ifndef BTA_HH_DEBUG
39 #define BTA_HH_DEBUG TRUE
40 #endif
41 
42 #ifndef BTA_HH_SSR_MAX_LATENCY_DEF
43 #define BTA_HH_SSR_MAX_LATENCY_DEF 800 /* 500 ms*/
44 #endif
45 
46 #ifndef BTA_HH_SSR_MIN_TOUT_DEF
47 #define BTA_HH_SSR_MIN_TOUT_DEF 2
48 #endif
49 
50 /* BTA HID Host callback events */
51 #define BTA_HH_EMPTY_EVT 0      /* No op */
52 #define BTA_HH_ENABLE_EVT 1     /* HH enabled */
53 #define BTA_HH_DISABLE_EVT 2    /* HH disabled */
54 #define BTA_HH_OPEN_EVT 3       /* connection opened */
55 #define BTA_HH_CLOSE_EVT 4      /* connection closed */
56 #define BTA_HH_GET_RPT_EVT 5    /* BTA_HhGetReport callback */
57 #define BTA_HH_SET_RPT_EVT 6    /* BTA_HhSetReport callback */
58 #define BTA_HH_GET_PROTO_EVT 7  /* BTA_GetProtoMode callback */
59 #define BTA_HH_SET_PROTO_EVT 8  /* BTA_HhSetProtoMode callback */
60 #define BTA_HH_GET_IDLE_EVT 9   /* BTA_HhGetIdle comes callback */
61 #define BTA_HH_SET_IDLE_EVT 10  /* BTA_HhSetIdle finish callback */
62 #define BTA_HH_GET_DSCP_EVT 11  /* Get report descriptor */
63 #define BTA_HH_ADD_DEV_EVT 12   /* Add Device callback */
64 #define BTA_HH_RMV_DEV_EVT 13   /* remove device finished */
65 #define BTA_HH_VC_UNPLUG_EVT 14 /* virtually unplugged */
66 #define BTA_HH_DATA_EVT 15
67 #define BTA_HH_API_ERR_EVT 16     /* API error is caught */
68 #define BTA_HH_UPDATE_SCPP_EVT 17 /* update scan paramter complete */
69 
70 typedef uint16_t tBTA_HH_EVT;
71 
72 /* application ID(none-zero) for each type of device */
73 #define BTA_HH_APP_ID_MI 1
74 #define BTA_HH_APP_ID_KB 2
75 #define BTA_HH_APP_ID_RMC 3
76 #define BTA_HH_APP_ID_3DSG 4
77 #define BTA_HH_APP_ID_JOY 5
78 #define BTA_HH_APP_ID_GPAD 6
79 #define BTA_HH_APP_ID_LE 0xff
80 
81 /* defined the minimum offset */
82 #define BTA_HH_MIN_OFFSET (L2CAP_MIN_OFFSET + 1)
83 
84 /* HID_HOST_MAX_DEVICES can not exceed 15 for th design of BTA HH */
85 #define BTA_HH_IDX_INVALID 0xff
86 #define BTA_HH_MAX_KNOWN HID_HOST_MAX_DEVICES
87 
88 /* GATT_MAX_PHY_CHANNEL can not exceed 14 for the design of BTA HH */
89 #if GATT_MAX_PHY_CHANNEL > 14
90 #define BTA_HH_LE_MAX_KNOWN 14
91 #else
92 #define BTA_HH_LE_MAX_KNOWN GATT_MAX_PHY_CHANNEL
93 #endif
94 
95 #define BTA_HH_MAX_DEVICE (HID_HOST_MAX_DEVICES + BTA_HH_LE_MAX_KNOWN)
96 /* invalid device handle */
97 #define BTA_HH_INVALID_HANDLE 0xff
98 
99 /* type of protocol mode */
100 #define BTA_HH_PROTO_RPT_MODE (0x00)
101 #define BTA_HH_PROTO_BOOT_MODE (0x01)
102 #define BTA_HH_PROTO_UNKNOWN (0xff)
103 typedef uint8_t tBTA_HH_PROTO_MODE;
104 
105 enum { BTA_HH_KEYBD_RPT_ID = 1, BTA_HH_MOUSE_RPT_ID };
106 typedef uint8_t tBTA_HH_BOOT_RPT_ID;
107 
108 /* type of devices, bit mask */
109 #define BTA_HH_DEVT_UNKNOWN 0x00
110 #define BTA_HH_DEVT_JOS 0x01 /* joy stick */
111 #define BTA_HH_DEVT_GPD 0x02 /* game pad */
112 #define BTA_HH_DEVT_RMC 0x03 /* remote control */
113 #define BTA_HH_DEVT_SED 0x04 /* sensing device */
114 #define BTA_HH_DEVT_DGT 0x05 /* Digitizer tablet */
115 #define BTA_HH_DEVT_CDR 0x06 /* card reader */
116 #define BTA_HH_DEVT_KBD 0x10 /* keyboard */
117 #define BTA_HH_DEVT_MIC 0x20 /* pointing device */
118 #define BTA_HH_DEVT_COM 0x30 /* Combo keyboard/pointing */
119 #define BTA_HH_DEVT_OTHER 0x80
120 typedef uint8_t tBTA_HH_DEVT;
121 
122 typedef enum : uint8_t {
123   BTA_HH_OK = 0,
124   BTA_HH_HS_HID_NOT_READY,  /* handshake error : device not ready */
125   BTA_HH_HS_INVALID_RPT_ID, /* handshake error : invalid report ID */
126   BTA_HH_HS_TRANS_NOT_SPT,  /* handshake error : transaction not spt */
127   BTA_HH_HS_INVALID_PARAM,  /* handshake error : invalid paremter */
128   BTA_HH_HS_ERROR,          /* handshake error : unspecified HS error */
129   BTA_HH_ERR,               /* general BTA HH error */
130   BTA_HH_ERR_SDP,           /* SDP error */
131   BTA_HH_ERR_PROTO,         /* SET_Protocol error,
132                                 only used in BTA_HH_OPEN_EVT callback */
133 
134   BTA_HH_ERR_DB_FULL,     /* device database full error, used in
135                              BTA_HH_OPEN_EVT/BTA_HH_ADD_DEV_EVT */
136   BTA_HH_ERR_TOD_UNSPT,   /* type of device not supported */
137   BTA_HH_ERR_NO_RES,      /* out of system resources */
138   BTA_HH_ERR_AUTH_FAILED, /* authentication fail */
139   BTA_HH_ERR_HDL,
140   BTA_HH_ERR_SEC,
141   BTA_HH_HS_SERVICE_CHANGED /* GATT service changed on the peer */
142 } tBTA_HH_STATUS;
143 
to_bta_hh_status(uint32_t status)144 inline tBTA_HH_STATUS to_bta_hh_status(uint32_t status) {
145   return static_cast<tBTA_HH_STATUS>(status);
146 }
147 
bta_hh_status_text(const tBTA_HH_STATUS & status)148 inline std::string bta_hh_status_text(const tBTA_HH_STATUS& status) {
149   switch (status) {
150     CASE_RETURN_STRING(BTA_HH_OK);
151     CASE_RETURN_STRING(BTA_HH_HS_HID_NOT_READY);
152     CASE_RETURN_STRING(BTA_HH_HS_INVALID_RPT_ID);
153     CASE_RETURN_STRING(BTA_HH_HS_TRANS_NOT_SPT);
154     CASE_RETURN_STRING(BTA_HH_HS_INVALID_PARAM);
155     CASE_RETURN_STRING(BTA_HH_HS_ERROR);
156     CASE_RETURN_STRING(BTA_HH_ERR);
157     CASE_RETURN_STRING(BTA_HH_ERR_SDP);
158     CASE_RETURN_STRING(BTA_HH_ERR_PROTO);
159     CASE_RETURN_STRING(BTA_HH_ERR_DB_FULL);
160     CASE_RETURN_STRING(BTA_HH_ERR_TOD_UNSPT);
161     CASE_RETURN_STRING(BTA_HH_ERR_NO_RES);
162     CASE_RETURN_STRING(BTA_HH_ERR_AUTH_FAILED);
163     CASE_RETURN_STRING(BTA_HH_ERR_HDL);
164     CASE_RETURN_STRING(BTA_HH_ERR_SEC);
165     CASE_RETURN_STRING(BTA_HH_HS_SERVICE_CHANGED);
166   }
167   RETURN_UNKNOWN_TYPE_STRING(tBTA_HH_STATUS, status);
168 }
169 
bta_hh_event_text(uint16_t event)170 inline std::string bta_hh_event_text(uint16_t event) {
171   switch (event) {
172     CASE_RETURN_STRING(BTA_HH_EMPTY_EVT);
173     CASE_RETURN_STRING(BTA_HH_ENABLE_EVT);
174     CASE_RETURN_STRING(BTA_HH_DISABLE_EVT);
175     CASE_RETURN_STRING(BTA_HH_OPEN_EVT);
176     CASE_RETURN_STRING(BTA_HH_CLOSE_EVT);
177     CASE_RETURN_STRING(BTA_HH_GET_DSCP_EVT);
178     CASE_RETURN_STRING(BTA_HH_GET_PROTO_EVT);
179     CASE_RETURN_STRING(BTA_HH_GET_RPT_EVT);
180     CASE_RETURN_STRING(BTA_HH_GET_IDLE_EVT);
181     CASE_RETURN_STRING(BTA_HH_SET_PROTO_EVT);
182     CASE_RETURN_STRING(BTA_HH_SET_RPT_EVT);
183     CASE_RETURN_STRING(BTA_HH_SET_IDLE_EVT);
184     CASE_RETURN_STRING(BTA_HH_VC_UNPLUG_EVT);
185     CASE_RETURN_STRING(BTA_HH_ADD_DEV_EVT);
186     CASE_RETURN_STRING(BTA_HH_RMV_DEV_EVT);
187     CASE_RETURN_STRING(BTA_HH_API_ERR_EVT);
188   }
189   RETURN_UNKNOWN_TYPE_STRING(bta_hh_event, event);
190 }
191 
192 typedef uint16_t tBTA_HH_ATTR_MASK;
193 
194 /* supported type of device and corresponding application ID */
195 typedef struct {
196   tBTA_HH_DEVT tod; /* type of device               */
197   uint8_t app_id;   /* corresponding application ID */
198 } tBTA_HH_SPT_TOD;
199 
200 /* configuration struct */
201 typedef struct {
202   uint8_t max_devt_spt;         /* max number of types of devices spt */
203   tBTA_HH_SPT_TOD* p_devt_list; /* supported types of device list     */
204   uint16_t sdp_db_size;
205 } tBTA_HH_CFG;
206 
207 enum {
208   BTA_HH_RPTT_RESRV,  /* reserved         */
209   BTA_HH_RPTT_INPUT,  /* input report     */
210   BTA_HH_RPTT_OUTPUT, /* output report    */
211   BTA_HH_RPTT_FEATURE /* feature report   */
212 };
213 typedef uint8_t tBTA_HH_RPT_TYPE;
214 
215 /* HID_CONTROL operation code used in BTA_HhSendCtrl()
216  */
217 enum {
218   BTA_HH_CTRL_NOP = 0 + HID_PAR_CONTROL_NOP, /* mapping from BTE */
219   BTA_HH_CTRL_HARD_RESET,                    /* hard reset       */
220   BTA_HH_CTRL_SOFT_RESET,                    /* soft reset       */
221   BTA_HH_CTRL_SUSPEND,                       /* enter suspend    */
222   BTA_HH_CTRL_EXIT_SUSPEND,                  /* exit suspend     */
223   BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG           /* virtual unplug   */
224 };
225 typedef uint8_t tBTA_HH_TRANS_CTRL_TYPE;
226 
227 typedef tHID_DEV_DSCP_INFO tBTA_HH_DEV_DESCR;
228 
229 #define BTA_HH_SSR_PARAM_INVALID HID_SSR_PARAM_INVALID
230 
231 /* id DI is not existing in remote device, vendor_id in tBTA_HH_DEV_DSCP_INFO
232  * will be set to 0xffff */
233 #define BTA_HH_VENDOR_ID_INVALID 0xffff
234 
235 /* report descriptor information */
236 typedef struct {
237   uint16_t vendor_id;       /* vendor ID */
238   uint16_t product_id;      /* product ID */
239   uint16_t version;         /* version */
240   uint16_t ssr_max_latency; /* SSR max latency, BTA_HH_SSR_PARAM_INVALID if
241                                unknown */
242   uint16_t ssr_min_tout;    /* SSR min timeout, BTA_HH_SSR_PARAM_INVALID if unknown */
243   uint8_t ctry_code;        /*Country Code.*/
244 #define BTA_HH_LE_REMOTE_WAKE 0x01
245 #define BTA_HH_LE_NORMAL_CONN 0x02
246 
247   uint8_t flag;
248   tBTA_HH_DEV_DESCR descriptor;
249   uint8_t hid_handle;
250 
ToString__anon3aae04521808251   std::string ToString() const {
252     return base::StringPrintf("%04x::%04x::%04x", vendor_id, product_id, version);
253   }
254 } tBTA_HH_DEV_DSCP_INFO;
255 
256 /* callback event data for BTA_HH_OPEN_EVT */
257 typedef struct {
258   tAclLinkSpec link_spec; /* HID device ACL link specification */
259   tBTA_HH_STATUS status;  /* operation status         */
260   uint8_t handle;         /* device handle            */
261   bool scps_supported;    /* scan parameter service supported */
262   uint8_t sub_class;      /* Cod sub class */
263   uint16_t attr_mask;     /* attribute mask */
264   uint8_t app_id;
265 } tBTA_HH_CONN;
266 
267 typedef tBTA_HH_CONN tBTA_HH_DEV_INFO;
268 
269 /* callback event data */
270 typedef struct {
271   tBTA_HH_STATUS status; /* operation status         */
272   uint8_t handle;        /* device handle            */
273 } tBTA_HH_CBDATA;
274 
275 enum {
276   BTA_HH_MOD_CTRL_KEY,
277   BTA_HH_MOD_SHFT_KEY,
278   BTA_HH_MOD_ALT_KEY,
279   BTA_HH_MOD_GUI_KEY,
280   BTA_HH_MOD_MAX_KEY
281 };
282 
283 /* parsed boot mode keyboard report */
284 typedef struct {
285   uint8_t this_char[6]; /* virtual key code     */
286   bool mod_key[BTA_HH_MOD_MAX_KEY];
287   /* ctrl, shift, Alt, GUI */
288   /* modifier key: is Shift key pressed */
289   /* modifier key: is Ctrl key pressed  */
290   /* modifier key: is Alt key pressed   */
291   /* modifier key: GUI up/down */
292   bool caps_lock; /* is caps locked       */
293   bool num_lock;  /* is Num key pressed   */
294 } tBTA_HH_KEYBD_RPT;
295 
296 /* parsed boot mode mouse report */
297 typedef struct {
298   uint8_t mouse_button; /* mouse button is clicked   */
299   int8_t delta_x;       /* displacement x            */
300   int8_t delta_y;       /* displacement y            */
301 } tBTA_HH_MICE_RPT;
302 
303 /* parsed Boot report */
304 typedef struct {
305   tBTA_HH_BOOT_RPT_ID dev_type; /* type of device report */
306   union {
307     tBTA_HH_KEYBD_RPT keybd_rpt; /* keyboard report      */
308     tBTA_HH_MICE_RPT mice_rpt;   /* mouse report         */
309   } data_rpt;
310 } tBTA_HH_BOOT_RPT;
311 
312 /* handshake data */
313 typedef struct {
314   tBTA_HH_STATUS status; /* handshake status */
315   uint8_t handle;        /* device handle    */
316   union {
317     tBTA_HH_PROTO_MODE proto_mode; /* GET_PROTO_EVT :protocol mode */
318     BT_HDR* p_rpt_data;            /* GET_RPT_EVT   : report data  */
319     uint8_t idle_rate;             /* GET_IDLE_EVT  : idle rate    */
320   } rsp_data;
321 } tBTA_HH_HSDATA;
322 
323 /* union of data associated with HD callback */
324 typedef union {
325   tBTA_HH_DEV_INFO dev_info; /* BTA_HH_ADD_DEV_EVT, BTA_HH_RMV_DEV_EVT   */
326   tBTA_HH_CONN conn;         /* BTA_HH_OPEN_EVT      */
327   tBTA_HH_CBDATA dev_status; /* BTA_HH_CLOSE_EVT,
328                                 BTA_HH_SET_PROTO_EVT
329                                 BTA_HH_SET_RPT_EVT
330                                 BTA_HH_SET_IDLE_EVT
331                                 BTA_HH_UPDATE_SCPP_EVT */
332 
333   tBTA_HH_STATUS status;           /* BTA_HH_ENABLE_EVT */
334   tBTA_HH_DEV_DSCP_INFO dscp_info; /* BTA_HH_GET_DSCP_EVT */
335   tBTA_HH_HSDATA hs_data;          /* GET_ transaction callback
336                                       BTA_HH_GET_RPT_EVT
337                                       BTA_HH_GET_PROTO_EVT
338                                       BTA_HH_GET_IDLE_EVT */
339 } tBTA_HH;
340 
341 /**
342  * Android Headtracker Service UUIDs
343  */
344 #define ANDROID_HEADTRACKER_SERVICE_UUID_STRING "109b862f-50e3-45cc-8ea1-ac62de4846d1"
345 #define ANDROID_HEADTRACKER_VERSION_CHARAC_UUID_STRING "b4eb9919-a910-46a2-a9dd-fec2525196fd"
346 #define ANDROID_HEADTRACKER_CONTROL_CHARAC_UUID_STRING "8584cbb5-2d58-45a3-ab9d-583e0958b067"
347 #define ANDROID_HEADTRACKER_REPORT_CHARAC_UUID_STRING "e66dd173-b2ae-4f5a-ae16-0162af8038ae"
348 
349 extern const bluetooth::Uuid ANDROID_HEADTRACKER_SERVICE_UUID;
350 extern const bluetooth::Uuid ANDROID_HEADTRACKER_VERSION_CHARAC_UUID;
351 extern const bluetooth::Uuid ANDROID_HEADTRACKER_CONTROL_CHARAC_UUID;
352 extern const bluetooth::Uuid ANDROID_HEADTRACKER_REPORT_CHARAC_UUID;
353 
354 /* BTA HH callback function */
355 typedef void(tBTA_HH_CBACK)(tBTA_HH_EVT event, tBTA_HH* p_data);
356 
357 /*****************************************************************************
358  *  External Function Declarations
359  ****************************************************************************/
360 
361 /*******************************************************************************
362  *
363  * Function         BTA_HhEnable
364  *
365  * Description      This function enable HID host and registers HID-Host with
366  *                  lower layers.
367  *
368  * Returns          void
369  *
370  ******************************************************************************/
371 void BTA_HhEnable(tBTA_HH_CBACK* p_cback, bool enable_hid, bool enable_hogp);
372 
373 /*******************************************************************************
374  *
375  * Function         BTA_HhDisable
376  *
377  * Description      This function is called when the host is about power down.
378  *
379  * Returns          void
380  *
381  ******************************************************************************/
382 void BTA_HhDisable(void);
383 
384 /*******************************************************************************
385  *
386  * Function         BTA_HhOpen
387  *
388  * Description      This function is called to start an inquiry and read SDP
389  *                  record of responding devices; connect to a device if only
390  *                  one active HID device is found.
391  *
392  * Returns          void
393  *
394  ******************************************************************************/
395 void BTA_HhOpen(const tAclLinkSpec& link_spec);
396 
397 /*******************************************************************************
398  *
399  * Function         BTA_HhClose
400  *
401  * Description      This function disconnects the device.
402  *
403  * Returns          void
404  *
405  ******************************************************************************/
406 void BTA_HhClose(uint8_t dev_handle);
407 
408 /*******************************************************************************
409  *
410  * Function         BTA_HhSetProtoMode
411  *
412  * Description      This function set the protocol mode at specified HID handle
413  *
414  * Returns          void
415  *
416  ******************************************************************************/
417 void BTA_HhSetProtoMode(uint8_t handle, tBTA_HH_PROTO_MODE t_type);
418 
419 /*******************************************************************************
420  *
421  * Function         BTA_HhGetProtoMode
422  *
423  * Description      This function get the protocol mode of a specified HID
424  *                  device.
425  *
426  * Returns          void
427  *
428  ******************************************************************************/
429 void BTA_HhGetProtoMode(uint8_t dev_handle);
430 /*******************************************************************************
431  *
432  * Function         BTA_HhSetReport
433  *
434  * Description      send SET_REPORT to device.
435  *
436  * Returns          void
437  *
438  ******************************************************************************/
439 void BTA_HhSetReport(uint8_t dev_handle, tBTA_HH_RPT_TYPE r_type, BT_HDR* p_data);
440 
441 /*******************************************************************************
442  *
443  * Function         BTA_HhGetReport
444  *
445  * Description      Send a GET_REPORT to HID device.
446  *
447  * Returns          void
448  *
449  ******************************************************************************/
450 void BTA_HhGetReport(uint8_t dev_handle, tBTA_HH_RPT_TYPE r_type, uint8_t rpt_id,
451                      uint16_t buf_size);
452 /*******************************************************************************
453  *
454  * Function         BTA_HhSetIdle
455  *
456  * Description      send SET_IDLE to device.
457  *
458  * Returns          void
459  *
460  ******************************************************************************/
461 void BTA_HhSetIdle(uint8_t dev_handle, uint16_t idle_rate);
462 
463 /*******************************************************************************
464  *
465  * Function         BTA_HhGetIdle
466  *
467  * Description      Send a GET_IDLE to HID device.
468  *
469  * Returns          void
470  *
471  ******************************************************************************/
472 void BTA_HhGetIdle(uint8_t dev_handle);
473 
474 /*******************************************************************************
475  *
476  * Function         BTA_HhSendCtrl
477  *
478  * Description      Send HID_CONTROL request to a HID device.
479  *
480  * Returns          void
481  *
482  ******************************************************************************/
483 void BTA_HhSendCtrl(uint8_t dev_handle, tBTA_HH_TRANS_CTRL_TYPE c_type);
484 
485 /*******************************************************************************
486  *
487  * Function         BTA_HhSetIdle
488  *
489  * Description      send SET_IDLE to device.
490  *
491  * Returns          void
492  *
493  ******************************************************************************/
494 void BTA_HhSetIdle(uint8_t dev_handle, uint16_t idle_rate);
495 
496 /*******************************************************************************
497  *
498  * Function         BTA_HhGetIdle
499  *
500  * Description      Send a GET_IDLE from HID device.
501  *
502  * Returns          void
503  *
504  ******************************************************************************/
505 void BTA_HhGetIdle(uint8_t dev_handle);
506 
507 /*******************************************************************************
508  *
509  * Function         BTA_HhSendData
510  *
511  * Description      Send DATA transaction to a HID device.
512  *
513  * Returns          void
514  *
515  ******************************************************************************/
516 void BTA_HhSendData(uint8_t dev_handle, const tAclLinkSpec& link_spec, BT_HDR* p_buf);
517 
518 /*******************************************************************************
519  *
520  * Function         BTA_HhGetDscpInfo
521  *
522  * Description      Get report descriptor of the device
523  *
524  * Returns          void
525  *
526  ******************************************************************************/
527 void BTA_HhGetDscpInfo(uint8_t dev_handle);
528 
529 /*******************************************************************************
530  * Function         BTA_HhAddDev
531  *
532  * Description      Add a virtually cabled device into HID-Host device list
533  *                  to manage and assign a device handle for future API call,
534  *                  host applciation call this API at start-up to initialize its
535  *                  virtually cabled devices.
536  *
537  * Returns          void
538  *
539  ******************************************************************************/
540 void BTA_HhAddDev(const tAclLinkSpec& link_spec, tBTA_HH_ATTR_MASK attr_mask, uint8_t sub_class,
541                   uint8_t app_id, tBTA_HH_DEV_DSCP_INFO dscp_info);
542 /*******************************************************************************
543  *
544  * Function         BTA_HhRemoveDev
545  *
546  * Description      Remove a device from the HID host devices list.
547  *
548  * Returns          void
549  *
550  ******************************************************************************/
551 void BTA_HhRemoveDev(uint8_t dev_handle);
552 
553 /*******************************************************************************
554  *
555  * Function         BTA_HhDump
556  *
557  * Description      Dump BTA HH control block
558  *
559  * Returns          void
560  *
561  ******************************************************************************/
562 void BTA_HhDump(int fd);
563 
564 namespace std {
565 template <>
566 struct formatter<tBTA_HH_STATUS> : enum_formatter<tBTA_HH_STATUS> {};
567 }  // namespace std
568 #endif /* BTA_HH_API_H */
569