mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-23 18:39:52 +00:00
allow to config unix domain path and daemon log file via btstack-config.h
This commit is contained in:
parent
4e6f32d5a8
commit
ea3e9e661d
@ -45,6 +45,8 @@
|
||||
#include <btstack/run_loop.h>
|
||||
#include <btstack/utils.h>
|
||||
|
||||
#include "btstack-config.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined __cplusplus
|
||||
@ -52,10 +54,14 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
// Default TCP port for BTstack daemon
|
||||
#ifndef BTSTACK_PORT
|
||||
#define BTSTACK_PORT 13333
|
||||
#endif
|
||||
|
||||
// UNIX domain socket for BTstack */
|
||||
#ifndef BTSTACK_UNIX
|
||||
#define BTSTACK_UNIX "/tmp/BTstack"
|
||||
#endif
|
||||
|
||||
// packet handler
|
||||
typedef void (*btstack_packet_handler_t) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
|
||||
|
12
src/daemon.c
12
src/daemon.c
@ -87,6 +87,15 @@
|
||||
#include <libusb-1.0/libusb.h>
|
||||
#endif
|
||||
|
||||
#ifndef BTSTACK_LOG_FILE
|
||||
#define BTSTACK_LOG_FILE "/tmp/hci_dump.pklg"
|
||||
#endif
|
||||
|
||||
// use logger: format HCI_DUMP_PACKETLOGGER, HCI_DUMP_BLUEZ or HCI_DUMP_STDOUT
|
||||
#ifndef BTSTACK_LOG_TYPE
|
||||
#define BTSTACK_LOG_TYPE HCI_DUMP_PACKETLOGGER
|
||||
#endif
|
||||
|
||||
#define DAEMON_NO_ACTIVE_CLIENT_TIMEOUT 10000
|
||||
|
||||
|
||||
@ -744,8 +753,7 @@ static int daemon_client_handler(connection_t *connection, uint16_t packet_type,
|
||||
|
||||
static void daemon_set_logging_enabled(int enabled){
|
||||
if (enabled && !loggingEnabled){
|
||||
// use logger: format HCI_DUMP_PACKETLOGGER, HCI_DUMP_BLUEZ or HCI_DUMP_STDOUT
|
||||
hci_dump_open("/data/btstack/hci_dump.pklg", HCI_DUMP_PACKETLOGGER);
|
||||
hci_dump_open(BTSTACK_LOG_FILE, BTSTACK_LOG_TYPE);
|
||||
}
|
||||
if (!enabled && loggingEnabled){
|
||||
hci_dump_close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user