Select one of the symbols to view example projects that use it.
 
Outline
#include <string.h>
#include "common/bt_target.h"
#include "gap_int.h"
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/bt/host/bluedroid/stack/gap/gap_utils.c
 
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/****************************************************************************** * * Copyright (C) 2009-2013 Broadcom Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************//* ... */ #include <string.h> #include "common/bt_target.h" //#include "bt_utils.h" #include "gap_int.h" #if (CLASSIC_BT_INCLUDED == TRUE) /******************************************************************************* ** ** Function gap_allocate_cb ** ** Description Look through the GAP Control Blocks for a free one. ** ** Returns Pointer to the control block or NULL if not found ** *******************************************************************************//* ... */ tGAP_INFO *gap_allocate_cb (void) { tGAP_INFO *p_cb = &gap_cb.blk[0]; UINT8 x; for (x = 0; x < GAP_MAX_BLOCKS; x++, p_cb++) { if (!p_cb->in_use) { memset (p_cb, 0, sizeof (tGAP_INFO)); p_cb->in_use = TRUE; p_cb->index = x; p_cb->p_data = (void *)NULL; return (p_cb); }{...} }{...} /* If here, no free control blocks found */ return (NULL); }{...} /******************************************************************************* ** ** Function gap_free_cb ** ** Description Release GAP control block. ** ** Returns Pointer to the control block or NULL if not found ** *******************************************************************************//* ... */ void gap_free_cb (tGAP_INFO *p_cb) { if (p_cb) { p_cb->gap_cback = NULL; p_cb->in_use = FALSE; }{...} }{...} /******************************************************************************* ** ** Function gap_is_service_busy ** ** Description Look through the GAP Control Blocks that are in use ** and check to see if the event waiting for is the command ** requested. ** ** Returns TRUE if already in use ** FALSE if not busy ** *******************************************************************************//* ... */ BOOLEAN gap_is_service_busy (UINT16 request) { tGAP_INFO *p_cb = &gap_cb.blk[0]; UINT8 x; for (x = 0; x < GAP_MAX_BLOCKS; x++, p_cb++) { if (p_cb->in_use && p_cb->event == request) { return (TRUE); }{...} }{...} /* If here, service is not busy */ return (FALSE); }{...} /******************************************************************************* ** ** Function gap_convert_btm_status ** ** Description Converts a BTM error status into a GAP error status ** ** ** Returns GAP_UNKNOWN_BTM_STATUS is returned if not recognized ** *******************************************************************************//* ... */ UINT16 gap_convert_btm_status (tBTM_STATUS btm_status) { switch (btm_status) { case BTM_SUCCESS: return (BT_PASS); ... case BTM_CMD_STARTED: return (GAP_CMD_INITIATED); ... case BTM_BUSY: return (GAP_ERR_BUSY); ... case BTM_MODE_UNSUPPORTED: case BTM_ILLEGAL_VALUE: return (GAP_ERR_ILL_PARM); ... case BTM_WRONG_MODE: return (GAP_DEVICE_NOT_UP); ... case BTM_UNKNOWN_ADDR: return (GAP_BAD_BD_ADDR); ... case BTM_DEVICE_TIMEOUT: return (GAP_ERR_TIMEOUT); ... default: return (GAP_ERR_PROCESSING);... }{...} }{...} /* ... */ #endif ///CLASSIC_BT_INCLUDED == TRUE
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.