move pairing event handle code to BLEGap

- add bond_init()
- move thing around
This commit is contained in:
hathach committed 2018-02-22 23:38:41 +07:00
1 parent 86ea7e7ae5
commit c4e25295e2
7 files changed
+349 -220

No files matched your search

@@ -54,6 +54,13 @@
* - CCCD variable
*------------------------------------------------------------------*/
void bond_init(void)
{
// Initialize nffs for bonding (it is safe to call nffs_pkg_init() multiple time)
Nffs.begin();
(void) Nffs.mkdir_p(CFG_BOND_NFFS_DIR);
}
/*------------------------------------------------------------------*/
/* Keys
*------------------------------------------------------------------*/
@@ -56,6 +56,8 @@ enum
BOND_FILE_CCCD_OFFSET = BOND_FILE_DEVNAME_OFFSET + CFG_MAX_DEVNAME_LEN
};
void bond_init(void);
void bond_clear(void);
void bond_save_keys(uint16_t conn_hdl, bond_data_t* bdata);
bool bond_load_keys(uint16_t ediv, bond_data_t* bdata);
@@ -63,7 +65,6 @@ bool bond_load_keys(uint16_t ediv, bond_data_t* bdata);
void bond_save_cccd(uint16_t cond_hdl, uint16_t ediv);
bool bond_load_cccd(uint16_t cond_hdl, uint16_t ediv);
void bond_clear(void);
#endif /* BONDING_H_ */