1 2 3 /****************************************************************************** 4 * 5 * Copyright (C) 2014 The Android Open Source Project 6 * Copyright (C) 2003-2012 Broadcom Corporation 7 * 8 * Licensed under the Apache License, Version 2.0 (the "License"); 9 * you may not use this file except in compliance with the License. 10 * You may obtain a copy of the License at: 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 * 20 ******************************************************************************/ 21 22 /****************************************************************************** 23 * 24 * This is the private interface file for the BTA SDP I/F 25 * 26 ******************************************************************************/ 27 #ifndef BTA_SDP_INT_H 28 #define BTA_SDP_INT_H 29 30 #include "bta_sys.h" 31 #include "bta_api.h" 32 #include "bta_sdp_api.h" 33 34 /***************************************************************************** 35 ** Constants 36 *****************************************************************************/ 37 38 enum 39 { 40 /* these events are handled by the state machine */ 41 BTA_SDP_API_ENABLE_EVT = BTA_SYS_EVT_START(BTA_ID_SDP), 42 BTA_SDP_API_SEARCH_EVT, 43 BTA_SDP_API_CREATE_RECORD_USER_EVT, 44 BTA_SDP_API_REMOVE_RECORD_USER_EVT, 45 BTA_SDP_MAX_INT_EVT 46 }; 47 48 enum 49 { 50 BTA_SDP_ACTIVE_NONE = 0, 51 BTA_SDP_ACTIVE_YES /* waiting for SDP result */ 52 }; 53 54 55 56 /* data type for BTA_SDP_API_ENABLE_EVT */ 57 typedef struct 58 { 59 BT_HDR hdr; 60 tBTA_SDP_DM_CBACK *p_cback; 61 } tBTA_SDP_API_ENABLE; 62 63 /* data type for BTA_SDP_API_SEARCH_EVT */ 64 typedef struct 65 { 66 BT_HDR hdr; 67 BD_ADDR bd_addr; 68 tSDP_UUID uuid; 69 } tBTA_SDP_API_SEARCH; 70 71 /* data type for BTA_SDP_API_SEARCH_EVT */ 72 typedef struct 73 { 74 BT_HDR hdr; 75 void* user_data; 76 } tBTA_SDP_API_RECORD_USER; 77 78 /* union of all data types */ 79 typedef union 80 { 81 /* GKI event buffer header */ 82 BT_HDR hdr; 83 tBTA_SDP_API_ENABLE enable; 84 tBTA_SDP_API_SEARCH get_search; 85 tBTA_SDP_API_RECORD_USER record; 86 } tBTA_SDP_MSG; 87 88 /* SDP control block */ 89 typedef struct 90 { 91 UINT8 sdp_active; /* see BTA_SDP_SDP_ACT_* */ 92 BD_ADDR remote_addr; 93 tBTA_SDP_DM_CBACK *p_dm_cback; 94 } tBTA_SDP_CB; 95 96 97 /* SDP control block */ 98 #if BTA_DYNAMIC_MEMORY == FALSE 99 extern tBTA_SDP_CB bta_sdp_cb; 100 #else 101 extern tBTA_SDP_CB *bta_sdp_cb_ptr; 102 #define bta_sdp_cb (*bta_sdp_cb_ptr) 103 #endif 104 105 /* config struct */ 106 extern tBTA_SDP_CFG *p_bta_sdp_cfg; 107 108 extern BOOLEAN bta_sdp_sm_execute(BT_HDR *p_msg); 109 110 extern void bta_sdp_enable (tBTA_SDP_MSG *p_data); 111 extern void bta_sdp_search (tBTA_SDP_MSG *p_data); 112 extern void bta_sdp_create_record(tBTA_SDP_MSG *p_data); 113 extern void bta_sdp_remove_record(tBTA_SDP_MSG *p_data); 114 115 #endif /* BTA_SDP_INT_H */ 116