1 /******************************************************************************
3 * Copyright (C) 2014 The Android Open Source Project
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:
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 ******************************************************************************/
19 /******************************************************************************
21 * This is the main implementation file for the BTA MCE I/F
23 ******************************************************************************/
26 #include "common/bt_target.h"
27 #include "bta/bta_api.h"
28 #include "bta/bta_sys.h"
29 #include "bta/bta_sdp_api.h"
30 #include "bta_sdp_int.h"
32 #if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE)
34 /*****************************************************************************
35 ** Constants and types
36 *****************************************************************************/
38 #if BTA_DYNAMIC_MEMORY == FALSE
39 tBTA_SDP_CB bta_sdp_cb;
41 tBTA_SDP_CB *bta_sdp_cb_ptr;
44 /* state machine action enumeration list */
45 #define BTA_SDP_NUM_ACTIONS (BTA_SDP_MAX_INT_EVT & 0x00ff)
47 /* type for action functions */
48 typedef void (*tBTA_SDP_ACTION)(tBTA_SDP_MSG *p_data);
50 /* action function list */
51 const tBTA_SDP_ACTION bta_sdp_action[] = {
52 bta_sdp_enable, /* BTA_SDP_API_ENABLE_EVT */
53 bta_sdp_search, /* BTA_SDP_API_SEARCH_EVT */
54 bta_sdp_create_record, /* BTA_SDP_API_CREATE_RECORD_USER_EVT */
55 bta_sdp_remove_record, /* BTA_SDP_API_REMOVE_RECORD_USER_EVT */
58 /*******************************************************************************
59 ** Function bta_sdp_sm_execute
61 ** Description State machine event handling function for SDP search
64 *******************************************************************************/
65 BOOLEAN bta_sdp_sm_execute(BT_HDR *p_msg)
72 UINT16 action = (p_msg->event & 0x00ff);
74 /* execute action functions */
75 if (action < BTA_SDP_NUM_ACTIONS) {
76 (*bta_sdp_action[action])((tBTA_SDP_MSG *)p_msg);
83 #endif /* #if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE) */