1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
24
25
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
64
65
66
74
75
76
77
78
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
106
107
108
109
110
/* ... */
/* ... */
#include "bta/bta_api.h"
#include "bta/bta_sys.h"
#include "bta/bta_jv_api.h"
#include "bta_jv_int.h"
#include "common/bt_target.h"5 includes
#if (defined BTA_JV_INCLUDED && BTA_JV_INCLUDED == TRUE)
/* ... */
#if BTA_DYNAMIC_MEMORY == FALSE
tBTA_JV_CB bta_jv_cb;
#else
tBTA_JV_CB *bta_jv_cb_ptr;
#endif
#define BTA_JV_NUM_ACTIONS (BTA_JV_MAX_INT_EVT & 0x00ff)
typedef void (*tBTA_JV_ACTION)(tBTA_JV_MSG *p_data);
const tBTA_JV_ACTION bta_jv_action[] = {
bta_jv_enable,
bta_jv_disable,
bta_jv_get_channel_id,
bta_jv_free_scn,
bta_jv_start_discovery,
bta_jv_create_record,
bta_jv_delete_record,
#if BTA_JV_L2CAP_INCLUDED
bta_jv_l2cap_connect,
bta_jv_l2cap_close,
bta_jv_l2cap_start_server,
bta_jv_l2cap_stop_server,
bta_jv_l2cap_read,
bta_jv_l2cap_write, /* ... */
#endif
#if BTA_JV_RFCOMM_INCLUDED
bta_jv_rfcomm_config,
bta_jv_rfcomm_connect,
bta_jv_rfcomm_close,
bta_jv_rfcomm_start_server,
bta_jv_rfcomm_stop_server,
bta_jv_rfcomm_read,
bta_jv_rfcomm_write,
bta_jv_rfcomm_flow_control, /* ... */
#endif
bta_jv_set_pm_profile,
bta_jv_change_pm_state,
#if BTA_JV_L2CAP_INCLUDED
bta_jv_l2cap_connect_le,
bta_jv_l2cap_start_server_le,
bta_jv_l2cap_stop_server_le,
bta_jv_l2cap_write_fixed,
bta_jv_l2cap_close_fixed, /* ... */
#endif
}{...};
/* ... */
BOOLEAN bta_jv_sm_execute(BT_HDR *p_msg)
{
BOOLEAN ret = FALSE;
UINT16 action = (p_msg->event & 0x00ff);
if (action < BTA_JV_NUM_ACTIONS) {
(*bta_jv_action[action])((tBTA_JV_MSG *)p_msg);
ret = TRUE;
}{...}
return (ret);
}{...}
/* ... */
#endif