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"
#include "osi/allocator.h"
gap_cb
GAP_SetTraceLevel(UINT8)
GAP_Init()
GAP_Deinit()
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/bt/host/bluedroid/stack/gap/gap_api.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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/****************************************************************************** * * 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" #include "osi/allocator.h" #if GAP_DYNAMIC_MEMORY == FALSE tGAP_CB gap_cb; #else tGAP_CB *gap_cb_ptr; #endif /******************************************************************************* ** ** Function GAP_SetTraceLevel ** ** Description This function sets the trace level for GAP. If called with ** a value of 0xFF, it simply returns the current trace level. ** ** Returns The new or current trace level ** *******************************************************************************//* ... */ UINT8 GAP_SetTraceLevel (UINT8 new_level) { if (new_level != 0xFF) { gap_cb.trace_level = new_level; }{...} return (gap_cb.trace_level); }{ ... } /******************************************************************************* ** ** Function GAP_Init ** ** Description Initializes the control blocks used by GAP. ** ** This routine should not be called except once per ** stack invocation. ** ** Returns status ** *******************************************************************************//* ... */ bt_status_t GAP_Init(void) { #if GAP_DYNAMIC_MEMORY == TRUE gap_cb_ptr = (tGAP_CB *)osi_malloc(sizeof(tGAP_CB)); if (!gap_cb_ptr) { return BT_STATUS_NOMEM; }{...} #endif/* ... */ memset (&gap_cb, 0, sizeof (tGAP_CB)); #if defined(GAP_INITIAL_TRACE_LEVEL) gap_cb.trace_level = GAP_INITIAL_TRACE_LEVEL; #else gap_cb.trace_level = BT_TRACE_LEVEL_NONE; /* No traces */ #endif #if GAP_CONN_INCLUDED == TRUE gap_conn_init(); #endif #if BLE_INCLUDED == TRUE && GATTS_INCLUDED == TRUE gap_attr_db_init(); #endif return BT_STATUS_SUCCESS; }{ ... } /******************************************************************************* ** ** Function GAP_Deinit ** ** Description This function is called to deinitialize the control block ** for this layer. ** ** Returns void ** *******************************************************************************//* ... */ void GAP_Deinit(void) { #if GAP_DYNAMIC_MEMORY == TRUE if (gap_cb_ptr) { osi_free(gap_cb_ptr); gap_cb_ptr = NULL; }{...} #endif/* ... */ }{ ... }
Details