Refactor btsnoop and stack config into modules
Moves stack config out of the combined bte_config, and into
its own module.
Makes btsnoop more self sufficient and removes uneccessary
levels of indirection.
Refactor logging slightly into a (temporary) module to disassociate
from the direct calls from config. Eliminates some useless stuff in
the module as well.
diff --git a/hci/include/btsnoop.h b/hci/include/btsnoop.h
index 05ff791..49df9ee 100644
--- a/hci/include/btsnoop.h
+++ b/hci/include/btsnoop.h
@@ -23,12 +23,10 @@
#include "bt_types.h"
typedef struct btsnoop_t {
- // Sets the logging path for btsnoop to the provided |path|.
- void (*set_logging_path)(const char *path);
-
- // Turns btsnoop logging on or off, depending on |value|. If
- // you are turning btsnoop on, you must have set a logging path.
- void (*set_is_running)(bool value);
+ // Inform btsnoop whether the API desires to log. If |value| is true.
+ // logging will be enabled. Otherwise it defers to the value from the
+ // config file.
+ void (*set_api_wants_to_log)(bool value);
// Capture |packet| and dump it to the btsnoop logs. If |is_received| is
// true, the packet is marked as incoming. Otherwise, the packet is marked
@@ -36,4 +34,5 @@
void (*capture)(const BT_HDR *packet, bool is_received);
} btsnoop_t;
+#define BTSNOOP_MODULE "btsnoop_module"
const btsnoop_t *btsnoop_get_interface();