1 /***************************************************************************** 2 ** 3 ** Name: srvc_eng_int.h 4 ** 5 ** Description: this file contains the Service Engine internal interface 6 ** definitions. 7 ** 8 ** 9 ** Copyright (c) 1999-2008, Broadcom Corp., All Rights Reserved. 10 ** Broadcom Corp. Bluetooth Core. Proprietary and confidential. 11 ******************************************************************************/ 12 13 #ifndef SRVC_ENG_INT_H 14 #define SRVC_ENG_INT_H 15 16 #include "bt_target.h" 17 #include "gatt_api.h" 18 #include "srvc_api.h" 19 20 #define SRVC_MAX_APPS GATT_CL_MAX_LCB 21 22 #define SRVC_ID_NONE 0 23 #define SRVC_ID_DIS 1 24 #define SRVC_ID_MAX SRVC_ID_DIS 25 26 #define SRVC_ACT_IGNORE 0 27 #define SRVC_ACT_RSP 1 28 #define SRVC_ACT_PENDING 2 29 30 typedef struct 31 { 32 BOOLEAN in_use; 33 UINT16 conn_id; 34 BOOLEAN connected; 35 BD_ADDR bda; 36 UINT32 trans_id; 37 UINT8 cur_srvc_id; 38 39 tDIS_VALUE dis_value; 40 41 }tSRVC_CLCB; 42 43 44 /* service engine control block */ 45 typedef struct 46 { 47 tSRVC_CLCB clcb[SRVC_MAX_APPS]; /* connection link*/ 48 tGATT_IF gatt_if; 49 BOOLEAN enabled; 50 51 }tSRVC_ENG_CB; 52 53 54 55 #ifdef __cplusplus 56 extern "C" { 57 #endif 58 59 /* Global GATT data */ 60 #if GATT_DYNAMIC_MEMORY == FALSE 61 GATT_API extern tSRVC_ENG_CB srvc_eng_cb; 62 #else 63 GATT_API extern tSRVC_ENG_CB srvc_eng_cb_ptr; 64 #define srvc_eng_cb (*srvc_eng_cb_ptr) 65 66 #endif 67 68 extern tSRVC_CLCB *srvc_eng_find_clcb_by_conn_id(UINT16 conn_id); 69 extern tSRVC_CLCB *srvc_eng_find_clcb_by_bd_addr(BD_ADDR bda); 70 extern UINT16 srvc_eng_find_conn_id_by_bd_addr(BD_ADDR bda); 71 72 73 extern void srvc_eng_release_channel (UINT16 conn_id) ; 74 extern BOOLEAN srvc_eng_request_channel (BD_ADDR remote_bda, UINT8 srvc_id ); 75 extern void srvc_sr_rsp(UINT8 clcb_idx, tGATT_STATUS st, tGATTS_RSP *p_rsp); 76 extern void srvc_sr_notify(BD_ADDR remote_bda, UINT16 handle, UINT16 len, UINT8 *p_value); 77 78 79 #ifdef __cplusplus 80 } 81 #endif 82 #endif 83