1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
24
25
31
32
33
34
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
58
59
66
67
68
71
72
73
74
75
76
80
81
82
83
84
/* ... */
/* ... */
#include <stdlib.h>
#include "common/bt_target.h"
#include "bta/bta_api.h"
#include "bta/bta_sys.h"
#include "bta/bta_sdp_api.h"
#include "bta_sdp_int.h"6 includes
#if defined(BTA_SDP_INCLUDED) && (BTA_SDP_INCLUDED == TRUE)
/* ... */
#if BTA_DYNAMIC_MEMORY == FALSE
tBTA_SDP_CB bta_sdp_cb;
#else
tBTA_SDP_CB *bta_sdp_cb_ptr;
#endif
#define BTA_SDP_NUM_ACTIONS (BTA_SDP_MAX_INT_EVT & 0x00ff)
typedef void (*tBTA_SDP_ACTION)(tBTA_SDP_MSG *p_data);
const tBTA_SDP_ACTION bta_sdp_action[] = {
bta_sdp_enable,
bta_sdp_search,
bta_sdp_create_record,
bta_sdp_remove_record,
bta_sdp_disable,
}{...};
/* ... */
BOOLEAN bta_sdp_sm_execute(BT_HDR *p_msg)
{
if (p_msg == NULL) {
return FALSE;
}{...}
BOOLEAN ret = FALSE;
UINT16 action = (p_msg->event & 0x00ff);
if (action < BTA_SDP_NUM_ACTIONS) {
(*bta_sdp_action[action])((tBTA_SDP_MSG *)p_msg);
ret = TRUE;
}{...}
return (ret);
}{...}
/* ... */
#endif