mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-10 15:44:32 +00:00
posix: allow to configure LINK_KEY_PATH and LE_DEVICE_DB_PATH
This commit is contained in:
parent
182c3ec8d7
commit
fd19b115ee
@ -57,7 +57,8 @@ HAVE_POSIX_B600_MAPPED_TO_3000000 | Workaround to use serial port with 3 mpbs
|
||||
HAVE_POSIX_FILE_IO | POSIX File i/o used for hci dump
|
||||
HAVE_POSIX_STDIN | STDIN is available for CLI interface
|
||||
HAVE_POSIX_TIME | System provides time function
|
||||
|
||||
LINK_KEY_PATH | Path to stored link keys
|
||||
LE_DEVICE_DB_PATH | Path to stored LE device information
|
||||
<!-- a name "lst:btstackFeatureConfiguration"></a-->
|
||||
<!-- -->
|
||||
|
||||
|
@ -42,16 +42,20 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "btstack_config.h"
|
||||
#include "btstack_link_key_db_fs.h"
|
||||
#include "btstack_debug.h"
|
||||
|
||||
#include "btstack_util.h"
|
||||
|
||||
// allow to pre-set LINK_KEY_PATH from btstack_config.h
|
||||
#ifndef LINK_KEY_PATH
|
||||
#ifdef _WIN32
|
||||
#define LINK_KEY_PATH ""
|
||||
#else
|
||||
#define LINK_KEY_PATH "/tmp/"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define LINK_KEY_PREFIX "btstack_at_"
|
||||
#define LINK_KEY_FOR "_link_key_for_"
|
||||
#define LINK_KEY_SUFFIX ".txt"
|
||||
|
@ -37,13 +37,13 @@
|
||||
|
||||
#define __BTSTACK_FILE__ "le_device_db_fs.c"
|
||||
|
||||
#include "ble/le_device_db.h"
|
||||
|
||||
#include "ble/core.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "btstack_config.h"
|
||||
#include "btstack_debug.h"
|
||||
#include "ble/le_device_db.h"
|
||||
#include "ble/core.h"
|
||||
|
||||
// Central Device db implemenation using static memory
|
||||
typedef struct le_device_memory_db {
|
||||
@ -76,7 +76,17 @@ typedef struct le_device_memory_db {
|
||||
|
||||
#define LE_DEVICE_MEMORY_SIZE 20
|
||||
#define INVALID_ENTRY_ADDR_TYPE 0xff
|
||||
#define DB_PATH_TEMPLATE "/tmp/btstack_at_%s_le_device_db.txt"
|
||||
|
||||
#ifndef LE_DEVICE_DB_PATH
|
||||
#ifdef _WIN32
|
||||
#define LE_DEVICE_DB_PATH ""
|
||||
#else
|
||||
#define LE_DEVICE_DB_PATH "/tmp/"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define DB_PATH_TEMPLATE (LE_DEVICE_DB_PATH "btstack_at_%s_le_device_db.txt")
|
||||
|
||||
const char * csv_header = "# addr_type, addr, irk, ltk, ediv, rand[8], key_size, authenticated, authorized, remote_csrk, remote_counter, local_csrk, local_counter";
|
||||
static char db_path[sizeof(DB_PATH_TEMPLATE) - 2 + 17 + 1];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user