xref: /nrf52832-nimble/packages/NimBLE-latest/nimble/include/nimble/nimble_opt_auto.h (revision 042d53a763ad75cb1465103098bb88c245d95138)
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements.  See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership.  The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License.  You may obtain a copy of the License at
9  *
10  *  http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied.  See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef H_NIMBLE_OPT_AUTO_
21 #define H_NIMBLE_OPT_AUTO_
22 
23 #include "syscfg/syscfg.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /***
30  * Automatic options.
31  *
32  * These settings are generated automatically from the user-specified syscfg
33  * settings.
34  */
35 
36 #undef NIMBLE_BLE_ADVERTISE
37 #define NIMBLE_BLE_ADVERTISE                    \
38     (MYNEWT_VAL(BLE_ROLE_BROADCASTER) || MYNEWT_VAL(BLE_ROLE_PERIPHERAL))
39 
40 #undef NIMBLE_BLE_SCAN
41 #define NIMBLE_BLE_SCAN                         \
42     (MYNEWT_VAL(BLE_ROLE_CENTRAL) || MYNEWT_VAL(BLE_ROLE_OBSERVER))
43 
44 #undef NIMBLE_BLE_CONNECT
45 #define NIMBLE_BLE_CONNECT                      \
46     (MYNEWT_VAL(BLE_ROLE_CENTRAL) || MYNEWT_VAL(BLE_ROLE_PERIPHERAL))
47 
48 
49 /** Supported client ATT commands. */
50 
51 #undef NIMBLE_BLE_ATT_CLT_FIND_INFO
52 #define NIMBLE_BLE_ATT_CLT_FIND_INFO            \
53     (MYNEWT_VAL(BLE_GATT_DISC_ALL_DSCS))
54 
55 #undef NIMBLE_BLE_ATT_CLT_FIND_TYPE
56 #define NIMBLE_BLE_ATT_CLT_FIND_TYPE            \
57     (MYNEWT_VAL(BLE_GATT_DISC_SVC_UUID))
58 
59 #undef NIMBLE_BLE_ATT_CLT_READ_TYPE
60 #define NIMBLE_BLE_ATT_CLT_READ_TYPE            \
61     (MYNEWT_VAL(BLE_GATT_FIND_INC_SVCS) ||      \
62      MYNEWT_VAL(BLE_GATT_DISC_ALL_CHRS) ||      \
63      MYNEWT_VAL(BLE_GATT_DISC_CHRS_UUID) ||     \
64      MYNEWT_VAL(BLE_GATT_READ_UUID))
65 
66 #undef NIMBLE_BLE_ATT_CLT_READ
67 #define NIMBLE_BLE_ATT_CLT_READ                 \
68     (MYNEWT_VAL(BLE_GATT_READ) ||               \
69      MYNEWT_VAL(BLE_GATT_READ_LONG) ||          \
70      MYNEWT_VAL(BLE_GATT_FIND_INC_SVCS))
71 
72 #undef NIMBLE_BLE_ATT_CLT_READ_BLOB
73 #define NIMBLE_BLE_ATT_CLT_READ_BLOB            \
74     (MYNEWT_VAL(BLE_GATT_READ_LONG))
75 
76 #undef NIMBLE_BLE_ATT_CLT_READ_MULT
77 #define NIMBLE_BLE_ATT_CLT_READ_MULT            \
78     (MYNEWT_VAL(BLE_GATT_READ_MULT))
79 
80 #undef NIMBLE_BLE_ATT_CLT_READ_GROUP_TYPE
81 #define NIMBLE_BLE_ATT_CLT_READ_GROUP_TYPE      \
82     (MYNEWT_VAL(BLE_GATT_DISC_ALL_SVCS))
83 
84 #undef NIMBLE_BLE_ATT_CLT_WRITE
85 #define NIMBLE_BLE_ATT_CLT_WRITE                \
86     (MYNEWT_VAL(BLE_GATT_WRITE))
87 
88 #undef NIMBLE_BLE_ATT_CLT_WRITE_NO_RSP
89 #define NIMBLE_BLE_ATT_CLT_WRITE_NO_RSP         \
90     (MYNEWT_VAL(BLE_GATT_WRITE_NO_RSP))
91 
92 #undef NIMBLE_BLE_ATT_CLT_PREP_WRITE
93 #define NIMBLE_BLE_ATT_CLT_PREP_WRITE           \
94     (MYNEWT_VAL(BLE_GATT_WRITE_LONG))
95 
96 #undef NIMBLE_BLE_ATT_CLT_EXEC_WRITE
97 #define NIMBLE_BLE_ATT_CLT_EXEC_WRITE           \
98     (MYNEWT_VAL(BLE_GATT_WRITE_LONG))
99 
100 #undef NIMBLE_BLE_ATT_CLT_NOTIFY
101 #define NIMBLE_BLE_ATT_CLT_NOTIFY               \
102     (MYNEWT_VAL(BLE_GATT_NOTIFY))
103 
104 #undef NIMBLE_BLE_ATT_CLT_INDICATE
105 #define NIMBLE_BLE_ATT_CLT_INDICATE             \
106     (MYNEWT_VAL(BLE_GATT_INDICATE))
107 
108 /** Security manager settings. */
109 
110 #undef NIMBLE_BLE_SM
111 #define NIMBLE_BLE_SM   (MYNEWT_VAL(BLE_SM_LEGACY) || MYNEWT_VAL(BLE_SM_SC))
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif
118