Home | History | Annotate | Download | only in srvc
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 1999-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 #ifndef SRVC_DIS_INT_H
     20 #define SRVC_DIS_INT_H
     21 
     22 #include "bt_target.h"
     23 #include "srvc_api.h"
     24 #include "gatt_api.h"
     25 
     26 #define DIS_MAX_CHAR_NUM            9
     27 
     28 
     29 typedef struct
     30 {
     31     UINT16      uuid;
     32     UINT16      handle;
     33 }tDIS_DB_ENTRY;
     34 
     35 #define DIS_SYSTEM_ID_SIZE      8
     36 #define DIS_PNP_ID_SIZE         7
     37 
     38 
     39 
     40 typedef struct
     41 {
     42     tDIS_DB_ENTRY           dis_attr[DIS_MAX_CHAR_NUM];
     43     tDIS_VALUE              dis_value;
     44 
     45     tDIS_READ_CBACK         *p_read_dis_cback;
     46 
     47     UINT16                  service_handle;
     48     UINT16                  max_handle;
     49 
     50     BOOLEAN                 enabled;
     51 
     52     UINT8                   dis_read_uuid_idx;
     53 }tDIS_CB;
     54 
     55 
     56 
     57 #ifdef __cplusplus
     58 extern "C" {
     59 #endif
     60 
     61 /* Global GATT data */
     62 #if GATT_DYNAMIC_MEMORY == FALSE
     63 GATT_API extern tDIS_CB dis_cb;
     64 #else
     65 GATT_API extern tDIS_CB *dis_cb_ptr;
     66 #define dis_cb (*dis_cb_ptr)
     67 #endif
     68 
     69 
     70 extern BOOLEAN dis_valid_handle_range(UINT16 handle);
     71 extern UINT8 dis_read_attr_value (UINT8 clcb_idx, UINT16 handle, tGATT_VALUE *p_value,
     72                            BOOLEAN is_long, tGATT_STATUS *p_status);
     73 extern UINT8 dis_write_attr_value(tGATT_WRITE_REQ * p_data, tGATT_STATUS *p_status);
     74 
     75 extern void dis_c_cmpl_cback (tSRVC_CLCB *p_clcb, tGATTC_OPTYPE op,
     76                                     tGATT_STATUS status, tGATT_CL_COMPLETE *p_data);
     77 
     78 
     79 #ifdef __cplusplus
     80 }
     81 #endif
     82 #endif
     83