• 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_BLE_STORE_CONFIG_PRIV_
21 #define H_BLE_STORE_CONFIG_PRIV_
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 extern struct ble_store_value_sec
28 ble_store_config_our_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
29 extern int ble_store_config_num_our_secs;
30 
31 extern struct ble_store_value_sec
32 ble_store_config_peer_secs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
33 extern int ble_store_config_num_peer_secs;
34 
35 extern struct ble_store_value_cccd
36 ble_store_config_cccds[MYNEWT_VAL(BLE_STORE_MAX_CCCDS)*MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
37 extern int ble_store_config_num_cccds;
38 
39 #if MYNEWT_VAL(BLE_STORE_CONFIG_PERSIST)
40 
41 int ble_store_config_persist_our_secs(bool flush);
42 int ble_store_config_persist_peer_secs(bool flush);
43 int ble_store_config_persist_cccds(bool flush);
44 void ble_store_config_conf_init(void);
45 void ble_store_config_conf_deinit(void);
46 void ble_store_config_persist_flush(void);
47 int ble_store_config_delete_all(void);
48 
49 #else
50 
ble_store_config_persist_our_secs(bool flush)51 static inline int ble_store_config_persist_our_secs(bool flush)
52 {
53     return 0;
54 }
ble_store_config_persist_peer_secs(bool flush)55 static inline int ble_store_config_persist_peer_secs(bool flush)
56 {
57     return 0;
58 }
ble_store_config_persist_cccds(bool flush)59 static inline int ble_store_config_persist_cccds(bool flush)
60 {
61     return 0;
62 }
ble_store_config_conf_init(void)63 static inline void ble_store_config_conf_init(void) {}
ble_store_config_conf_deinit(void)64 static inline void ble_store_config_conf_deinit(void) {}
ble_store_config_persist_flush(void)65 static inline void ble_store_config_persist_flush(void) {}
ble_store_config_delete_all(void)66 static inline int ble_store_config_delete_all(void) {}
67 
68 #endif /* MYNEWT_VAL(BLE_STORE_CONFIG_PERSIST) */
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif