ReelTwo
RSeries astromech firmware
gap_api.h
Go to the documentation of this file.
1
/******************************************************************************
2
*
3
* Copyright (C) 2009-2013 Broadcom Corporation
4
*
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:
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
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.
16
*
17
******************************************************************************/
18
19
#ifndef GAP_API_H
20
#define GAP_API_H
21
22
#include "
bt/private/stack/profiles_api.h
"
23
#include "
bt/private/stack/btm_api.h
"
24
#include "
bt/private/stack/l2c_api.h
"
25
26
/*****************************************************************************
27
** Constants
28
*****************************************************************************/
29
/*** GAP Error and Status Codes ***/
30
#define GAP_EVT_CONN_OPENED 0x0100
31
#define GAP_EVT_CONN_CLOSED 0x0101
32
#define GAP_EVT_CONN_DATA_AVAIL 0x0102
33
#define GAP_EVT_CONN_CONGESTED 0x0103
34
#define GAP_EVT_CONN_UNCONGESTED 0x01043
35
36
/*** used in connection variables and functions ***/
37
#define GAP_INVALID_HANDLE 0xFFFF
38
39
/*****************************************************************************
40
** Type Definitions
41
*****************************************************************************/
42
/*
43
** Callback function for connection services
44
*/
45
typedef
void (
tGAP_CONN_CALLBACK
) (
UINT16
gap_handle,
UINT16
event);
46
47
48
/*****************************************************************************
49
** External Function Declarations
50
*****************************************************************************/
51
52
/*** Functions for L2CAP connection interface ***/
53
54
/*******************************************************************************
55
**
56
** Function GAP_ConnOpen
57
**
58
** Description This function is called to open a generic L2CAP connection.
59
**
60
** Returns handle of the connection if successful, else GAP_INVALID_HANDLE
61
**
62
*******************************************************************************/
63
extern
UINT16
GAP_ConnOpen
(
const
char
*p_serv_name,
UINT8
service_id,
BOOLEAN
is_server,
64
BD_ADDR
p_rem_bda,
UINT16
psm, tL2CAP_CFG_INFO *p_cfg,
65
tL2CAP_ERTM_INFO *ertm_info,
66
UINT16
security,
UINT8
chan_mode_mask,
tGAP_CONN_CALLBACK
*p_cb);
67
68
/*******************************************************************************
69
**
70
** Function GAP_ConnClose
71
**
72
** Description This function is called to close a connection.
73
**
74
** Returns BT_PASS - closed OK
75
** GAP_ERR_BAD_HANDLE - invalid handle
76
**
77
*******************************************************************************/
78
extern
UINT16
GAP_ConnClose
(
UINT16
gap_handle);
79
80
/*******************************************************************************
81
**
82
** Function GAP_ConnBTRead
83
**
84
** Description GKI buffer aware applications will call this function after
85
** receiving an GAP_EVT_RXDATA event to process the incoming
86
** data buffer.
87
**
88
** Returns BT_PASS - data read
89
** GAP_ERR_BAD_HANDLE - invalid handle
90
** GAP_NO_DATA_AVAIL - no data available
91
**
92
*******************************************************************************/
93
extern
UINT16
GAP_ConnBTRead
(
UINT16
gap_handle, BT_HDR **pp_buf);
94
95
/*******************************************************************************
96
**
97
** Function GAP_ConnBTWrite
98
**
99
** Description GKI buffer aware applications can call this function to write data
100
** by passing a pointer to the GKI buffer of data.
101
**
102
** Returns BT_PASS - data read
103
** GAP_ERR_BAD_HANDLE - invalid handle
104
** GAP_ERR_BAD_STATE - connection not established
105
** GAP_INVALID_BUF_OFFSET - buffer offset is invalid
106
*******************************************************************************/
107
extern
UINT16
GAP_ConnBTWrite
(
UINT16
gap_handle, BT_HDR *p_buf);
108
109
/*******************************************************************************
110
**
111
** Function GAP_ConnGetL2CAPCid
112
**
113
** Description Returns the L2CAP channel id
114
**
115
** Parameters: handle - Handle of the connection
116
**
117
** Returns UINT16 - The L2CAP channel id
118
** 0, if error
119
**
120
*******************************************************************************/
121
extern
UINT16
GAP_ConnGetL2CAPCid
(
UINT16
gap_handle);
122
123
#endif
/* GAP_API_H */
GAP_ConnBTWrite
UINT16 GAP_ConnBTWrite(UINT16 gap_handle, BT_HDR *p_buf)
BD_ADDR
uint8_t BD_ADDR[BD_ADDR_LEN]
Definition:
bt_types.h:66
GAP_ConnClose
UINT16 GAP_ConnClose(UINT16 gap_handle)
l2c_api.h
GAP_ConnGetL2CAPCid
UINT16 GAP_ConnGetL2CAPCid(UINT16 gap_handle)
GAP_ConnOpen
UINT16 GAP_ConnOpen(const char *p_serv_name, UINT8 service_id, BOOLEAN is_server, BD_ADDR p_rem_bda, UINT16 psm, tL2CAP_CFG_INFO *p_cfg, tL2CAP_ERTM_INFO *ertm_info, UINT16 security, UINT8 chan_mode_mask, tGAP_CONN_CALLBACK *p_cb)
UINT8
uint8_t UINT8
Definition:
bt_types.h:25
BOOLEAN
bool BOOLEAN
Definition:
bt_types.h:33
tGAP_CONN_CALLBACK
void() tGAP_CONN_CALLBACK(UINT16 gap_handle, UINT16 event)
Definition:
gap_api.h:45
btm_api.h
GAP_ConnBTRead
UINT16 GAP_ConnBTRead(UINT16 gap_handle, BT_HDR **pp_buf)
profiles_api.h
UINT16
uint16_t UINT16
Definition:
bt_types.h:26
bt
private
stack
gap_api.h
Generated by
1.8.17