Rename btstack_link_key_db_fixed into btstack_link_key_db_static

This commit is contained in:
Matthias Ringwald 2017-06-20 11:04:57 +02:00
parent ba2939f612
commit ba9e989ad9
3 changed files with 17 additions and 14 deletions

View File

@ -3,7 +3,7 @@
#include "btstack_debug.h" #include "btstack_debug.h"
#include "btstack_chipset_cc256x.h" #include "btstack_chipset_cc256x.h"
#include "btstack_run_loop_embedded.h" #include "btstack_run_loop_embedded.h"
#include "classic/btstack_link_key_db_fixed.h" #include "classic/btstack_link_key_db_static.h"
#include "classic/btstack_link_key_db_tlv.h" #include "classic/btstack_link_key_db_tlv.h"
#include "hal_flash_sector.h" #include "hal_flash_sector.h"
#include "btstack_tlv.h" #include "btstack_tlv.h"

View File

@ -35,13 +35,14 @@
* *
*/ */
#define __BTSTACK_FILE__ "btstack_link_key_db_fixed.c" #define __BTSTACK_FILE__ "btstack_link_key_db_static.c"
/* /*
* btstack_link_key_db_fixed.c * btstack_link_key_db_static.c
* *
* Fixed Link Key implemenetation to use during development/porting * Static Link Key implementation to use during development/porting:
* Link keys have to be manually added to this file to make them usable * - Link keys have to be manually added to this file to make them usable
* + Link keys are preserved on reflash in constrast to the program flash based link key store
*/ */
#include "classic/btstack_link_key_db.h" #include "classic/btstack_link_key_db.h"
@ -76,7 +77,7 @@ static char *link_key_to_str(link_key_t link_key){
return (char *) link_key_to_str_buffer; return (char *) link_key_to_str_buffer;
} }
static int sscanf_link_key(char * link_key_string, link_key_t link_key){ static int sscanf_link_key(const char * link_key_string, link_key_t link_key){
unsigned int buffer[LINK_KEY_LEN]; unsigned int buffer[LINK_KEY_LEN];
// reset result buffer // reset result buffer
@ -133,7 +134,7 @@ static void link_key_db_put_link_key(bd_addr_t bd_addr, link_key_t link_key, lin
static void link_key_db_set_local_bd_addr(bd_addr_t bd_addr){ static void link_key_db_set_local_bd_addr(bd_addr_t bd_addr){
} }
const btstack_link_key_db_t btstack_link_key_db_fixed = { const btstack_link_key_db_t btstack_link_key_db_static = {
link_key_db_init, link_key_db_init,
link_key_db_set_local_bd_addr, link_key_db_set_local_bd_addr,
link_key_db_close, link_key_db_close,
@ -142,6 +143,6 @@ const btstack_link_key_db_t btstack_link_key_db_fixed = {
link_key_db_delete_link_key, link_key_db_delete_link_key,
}; };
const btstack_link_key_db_t * btstack_link_key_db_fixed_instance(void){ const btstack_link_key_db_t * btstack_link_key_db_static_instance(void){
return &btstack_link_key_db_fixed; return &btstack_link_key_db_static;
} }

View File

@ -36,11 +36,13 @@
*/ */
/** /**
* interface to provide link key storage * Static Link Key implementation to use during development/porting:
* - Link keys have to be manually added to this file to make them usable
* + Link keys are preserved on reflash in constrast to the program flash based link key store
*/ */
#ifndef __BTSTACK_LINK_KEY_DB_FIXED_H #ifndef __BTSTACK_LINK_KEY_DB_STATIC_H
#define __BTSTACK_LINK_KEY_DB_FIXED_H #define __BTSTACK_LINK_KEY_DB_STATIC_H
#include "btstack_link_key_db.h" #include "btstack_link_key_db.h"
@ -51,7 +53,7 @@ extern "C" {
/* /*
* @brief * @brief
*/ */
const btstack_link_key_db_t * btstack_link_key_db_fixed_instance(void); const btstack_link_key_db_t * btstack_link_key_db_static_instance(void);
/* API_END */ /* API_END */
@ -59,4 +61,4 @@ const btstack_link_key_db_t * btstack_link_key_db_fixed_instance(void);
} }
#endif #endif
#endif // __BTSTACK_LINK_KEY_DB_FIXED_H #endif // __BTSTACK_LINK_KEY_DB_STATIC_H