• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /** Supported client ATT commands. */
49 
50 #undef NIMBLE_BLE_ATT_CLT_FIND_INFO
51 #define NIMBLE_BLE_ATT_CLT_FIND_INFO            \
52     (MYNEWT_VAL(BLE_GATT_DISC_ALL_DSCS))
53 
54 #undef NIMBLE_BLE_ATT_CLT_FIND_TYPE
55 #define NIMBLE_BLE_ATT_CLT_FIND_TYPE            \
56     (MYNEWT_VAL(BLE_GATT_DISC_SVC_UUID))
57 
58 #undef NIMBLE_BLE_ATT_CLT_READ_TYPE
59 #define NIMBLE_BLE_ATT_CLT_READ_TYPE            \
60     (MYNEWT_VAL(BLE_GATT_FIND_INC_SVCS) ||      \
61      MYNEWT_VAL(BLE_GATT_DISC_ALL_CHRS) ||      \
62      MYNEWT_VAL(BLE_GATT_DISC_CHRS_UUID) ||     \
63      MYNEWT_VAL(BLE_GATT_READ_UUID))
64 
65 #undef NIMBLE_BLE_ATT_CLT_READ
66 #define NIMBLE_BLE_ATT_CLT_READ                 \
67     (MYNEWT_VAL(BLE_GATT_READ) ||               \
68      MYNEWT_VAL(BLE_GATT_READ_LONG) ||          \
69      MYNEWT_VAL(BLE_GATT_FIND_INC_SVCS))
70 
71 #undef NIMBLE_BLE_ATT_CLT_READ_BLOB
72 #define NIMBLE_BLE_ATT_CLT_READ_BLOB            \
73     (MYNEWT_VAL(BLE_GATT_READ_LONG))
74 
75 #undef NIMBLE_BLE_ATT_CLT_READ_MULT
76 #define NIMBLE_BLE_ATT_CLT_READ_MULT            \
77     (MYNEWT_VAL(BLE_GATT_READ_MULT))
78 
79 #undef NIMBLE_BLE_ATT_CLT_READ_GROUP_TYPE
80 #define NIMBLE_BLE_ATT_CLT_READ_GROUP_TYPE      \
81     (MYNEWT_VAL(BLE_GATT_DISC_ALL_SVCS))
82 
83 #undef NIMBLE_BLE_ATT_CLT_WRITE
84 #define NIMBLE_BLE_ATT_CLT_WRITE                \
85     (MYNEWT_VAL(BLE_GATT_WRITE))
86 
87 #undef NIMBLE_BLE_ATT_CLT_WRITE_NO_RSP
88 #define NIMBLE_BLE_ATT_CLT_WRITE_NO_RSP         \
89     (MYNEWT_VAL(BLE_GATT_WRITE_NO_RSP))
90 
91 #undef NIMBLE_BLE_ATT_CLT_PREP_WRITE
92 #define NIMBLE_BLE_ATT_CLT_PREP_WRITE           \
93     (MYNEWT_VAL(BLE_GATT_WRITE_LONG))
94 
95 #undef NIMBLE_BLE_ATT_CLT_EXEC_WRITE
96 #define NIMBLE_BLE_ATT_CLT_EXEC_WRITE           \
97     (MYNEWT_VAL(BLE_GATT_WRITE_LONG))
98 
99 #undef NIMBLE_BLE_ATT_CLT_NOTIFY
100 #define NIMBLE_BLE_ATT_CLT_NOTIFY               \
101     (MYNEWT_VAL(BLE_GATT_NOTIFY))
102 
103 #undef NIMBLE_BLE_ATT_CLT_INDICATE
104 #define NIMBLE_BLE_ATT_CLT_INDICATE             \
105     (MYNEWT_VAL(BLE_GATT_INDICATE))
106 
107 /** Security manager settings. */
108 
109 #undef NIMBLE_BLE_SM
110 #define NIMBLE_BLE_SM   (MYNEWT_VAL(BLE_SM_LEGACY) || MYNEWT_VAL(BLE_SM_SC))
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif
117