Home | History | Annotate | Download | only in include
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 2005-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  *
     21  *  This is the interface file for hid host call-out functions.
     22  *
     23  ******************************************************************************/
     24 #ifndef BTA_HH_CO_H
     25 #define BTA_HH_CO_H
     26 
     27 #include "bta_hh_api.h"
     28 
     29 typedef struct {
     30   uint16_t rpt_uuid;
     31   uint8_t rpt_id;
     32   tBTA_HH_RPT_TYPE rpt_type;
     33   uint8_t srvc_inst_id;
     34   uint8_t char_inst_id;
     35 } tBTA_HH_RPT_CACHE_ENTRY;
     36 
     37 /*******************************************************************************
     38  *
     39  * Function         bta_hh_co_data
     40  *
     41  * Description      This callout function is executed by HH when data is
     42  *                  received
     43  *                  in interupt channel.
     44  *
     45  *
     46  * Returns          void.
     47  *
     48  ******************************************************************************/
     49 extern void bta_hh_co_data(uint8_t dev_handle, uint8_t* p_rpt, uint16_t len,
     50                            tBTA_HH_PROTO_MODE mode, uint8_t sub_class,
     51                            uint8_t ctry_code, BD_ADDR peer_addr,
     52                            uint8_t app_id);
     53 
     54 /*******************************************************************************
     55  *
     56  * Function         bta_hh_co_open
     57  *
     58  * Description      This callout function is executed by HH when connection is
     59  *                  opened, and application may do some device specific
     60  *                  initialization.
     61  *
     62  * Returns          void.
     63  *
     64  ******************************************************************************/
     65 extern void bta_hh_co_open(uint8_t dev_handle, uint8_t sub_class,
     66                            uint16_t attr_mask, uint8_t app_id);
     67 
     68 /*******************************************************************************
     69  *
     70  * Function         bta_hh_co_close
     71  *
     72  * Description      This callout function is executed by HH when connection is
     73  *                  closed, and device specific finalizatio nmay be needed.
     74  *
     75  * Returns          void.
     76  *
     77  ******************************************************************************/
     78 extern void bta_hh_co_close(uint8_t dev_handle, uint8_t app_id);
     79 
     80 #if (BTA_HH_LE_INCLUDED == TRUE)
     81 /*******************************************************************************
     82  *
     83  * Function         bta_hh_le_co_rpt_info
     84  *
     85  * Description      This callout function is to convey the report information on
     86  *                  a HOGP device to the application. Application can save this
     87  *                  information in NV if device is bonded and load it back when
     88  *                  stack reboot.
     89  *
     90  * Parameters       remote_bda  - remote device address
     91  *                  p_entry     - report entry pointer
     92  *                  app_id      - application id
     93  *
     94  * Returns          void.
     95  *
     96  ******************************************************************************/
     97 extern void bta_hh_le_co_rpt_info(BD_ADDR remote_bda,
     98                                   tBTA_HH_RPT_CACHE_ENTRY* p_entry,
     99                                   uint8_t app_id);
    100 
    101 /*******************************************************************************
    102  *
    103  * Function         bta_hh_le_co_cache_load
    104  *
    105  * Description      This callout function is to request the application to load
    106  *                  the cached HOGP report if there is any. When cache reading
    107  *                  is completed, bta_hh_le_ci_cache_load() is called by the
    108  *                  application.
    109  *
    110  * Parameters       remote_bda  - remote device address
    111  *                  p_num_rpt: number of cached report
    112  *                  app_id      - application id
    113  *
    114  * Returns          the acched report array
    115  *
    116  ******************************************************************************/
    117 extern tBTA_HH_RPT_CACHE_ENTRY* bta_hh_le_co_cache_load(BD_ADDR remote_bda,
    118                                                         uint8_t* p_num_rpt,
    119                                                         uint8_t app_id);
    120 
    121 /*******************************************************************************
    122  *
    123  * Function         bta_hh_le_co_reset_rpt_cache
    124  *
    125  * Description      This callout function is to reset the HOGP device cache.
    126  *
    127  * Parameters       remote_bda  - remote device address
    128  *
    129  * Returns          none
    130  *
    131  ******************************************************************************/
    132 extern void bta_hh_le_co_reset_rpt_cache(BD_ADDR remote_bda, uint8_t app_id);
    133 
    134 #endif /* #if (BTA_HH_LE_INCLUDED == TRUE) */
    135 
    136 #endif /* BTA_HH_CO_H */
    137