summaryrefslogtreecommitdiffstats
path: root/bta/include/bta_pan_co.h
blob: c8769f4bde12a1d159e868376ad35e07680282d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/*****************************************************************************
**
**  Name:           bta_pan_co.h
**
**  Description:    This is the interface file for data gateway call-out
**                  functions.
**
**  Copyright (c) 2004, Widcomm Inc., All Rights Reserved.
**  Widcomm Bluetooth Core. Proprietary and confidential.
**
*****************************************************************************/
#ifndef BTA_PAN_CO_H
#define BTA_PAN_CO_H

#include "bta_pan_api.h"

/*****************************************************************************
**  Constants
*****************************************************************************/



/* BT_HDR buffer offset */
#define BTA_PAN_MIN_OFFSET       PAN_MINIMUM_OFFSET


/* Data Flow Mask */
#define BTA_PAN_RX_PUSH          0x00        /* RX push. */
#define BTA_PAN_RX_PUSH_BUF      0x01        /* RX push with zero copy. */
#define BTA_PAN_RX_PULL          0x02        /* RX pull. */
#define BTA_PAN_TX_PUSH          0x00        /* TX push. */
#define BTA_PAN_TX_PUSH_BUF      0x10        /* TX push with zero copy. */
#define BTA_PAN_TX_PULL          0x20        /* TX pull. */



/*****************************************************************************
**  Function Declarations
*****************************************************************************/

/*******************************************************************************
**
** Function         bta_pan_co_init
**
** Description      This callout function is executed by PAN when a server is
**                  started by calling BTA_PanEnable().  This function can be
**                  used by the phone to initialize data paths or for other
**                  initialization purposes.  The function must return the
**                  data flow mask as described below.
**                  
**
** Returns          Data flow mask.
**
*******************************************************************************/
BTA_API extern UINT8 bta_pan_co_init(UINT8 *q_level);

/*******************************************************************************
**
** Function         bta_pan_co_open
**
** Description      This function is executed by PAN when a connection 
**                  is opened.  The phone can use this function to set
**                  up data paths or perform any required initialization.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void bta_pan_co_open(UINT16 handle, UINT8 app_id, tBTA_PAN_ROLE local_role, tBTA_PAN_ROLE peer_role, BD_ADDR peer_addr);

/*******************************************************************************
**
** Function         bta_pan_co_close
**
** Description      This function is called by PAN when a connection to a
**                  server is closed.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void bta_pan_co_close(UINT16 handle, UINT8 app_id);

/*******************************************************************************
**
** Function         bta_pan_co_tx_path
**
** Description      This function is called by PAN to transfer data on the
**                  TX path; that is, data being sent from BTA to the phone.
**                  This function is used when the TX data path is configured
**                  to use the pull interface.  
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void bta_pan_co_tx_path(UINT16 handle, UINT8 app_id);

/*******************************************************************************
**
** Function         bta_pan_co_rx_path
**
** Description      This function is called by PAN to transfer data on the
**                  RX path; that is, data being sent from the phone to BTA.
**                  This function is used when the RX data path is configured
**                  to use the pull interface.  
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void bta_pan_co_rx_path(UINT16 handle, UINT8 app_id);

/*******************************************************************************
**
** Function         bta_pan_co_tx_write
**
** Description      This function is called by PAN to send data to the phone
**                  when the TX path is configured to use a push interface.
**                  The implementation of this function must copy the data to
**                  the phone's memory.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void bta_pan_co_tx_write(UINT16 handle, UINT8 app_id, BD_ADDR src, BD_ADDR dst, UINT16 protocol, UINT8 *p_data, 
                                UINT16 len, BOOLEAN ext, BOOLEAN forward);

/*******************************************************************************
**
** Function         bta_pan_co_tx_writebuf
**
** Description      This function is called by PAN to send data to the phone
**                  when the TX path is configured to use a push interface with
**                  zero copy.  The phone must free the buffer using function
**                  GKI_freebuf() when it is through processing the buffer.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void bta_pan_co_tx_writebuf(UINT16 handle, UINT8 app_id, BD_ADDR src, BD_ADDR dst, UINT16 protocol, BT_HDR *p_buf,
                                   BOOLEAN ext, BOOLEAN forward);


/*******************************************************************************
**
** Function         bta_pan_co_rx_flow
**
** Description      This function is called by PAN to enable or disable
**                  data flow on the RX path when it is configured to use
**                  a push interface.  If data flow is disabled the phone must
**                  not call bta_pan_ci_rx_write() or bta_pan_ci_rx_writebuf()
**                  until data flow is enabled again. 
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void bta_pan_co_rx_flow(UINT16 handle, UINT8 app_id, BOOLEAN enable);


/*******************************************************************************
**
** Function         bta_pan_co_filt_ind
**
** Description      protocol filter indication from peer device
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void bta_pan_co_pfilt_ind(UINT16 handle, BOOLEAN indication, tBTA_PAN_STATUS result,
                                    UINT16 len, UINT8 *p_filters);

/*******************************************************************************
**
** Function         bta_pan_co_mfilt_ind
**
** Description      multicast filter indication from peer device
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void bta_pan_co_mfilt_ind(UINT16 handle,  BOOLEAN indication, tBTA_PAN_STATUS result,
                                    UINT16 len, UINT8 *p_filters);
 
#endif /* BTA_PAN_CO_H */