Bluetooth: Switch from SYS_LOG to logger-based logging
Initial conversion to use syslog instead of logger. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
5bd6bc4bed
commit
343c53e841
60 changed files with 93 additions and 25 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_driver
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "../util.h"
|
#include "../util.h"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_driver
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "../util.h"
|
#include "../util.h"
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_driver
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#define HCI_CMD 0x01
|
#define HCI_CMD 0x01
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_driver
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#define BTPROTO_HCI 1
|
#define BTPROTO_HCI 1
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_nrf51_pm
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#define NBLE_SWDIO_PIN 6
|
#define NBLE_SWDIO_PIN 6
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME: temporary workaround until thread details are made internal */
|
|
||||||
#include "../../subsys/bluetooth/common/log.h"
|
|
||||||
#include <bluetooth/buf.h>
|
#include <bluetooth/buf.h>
|
||||||
#include <bluetooth/conn.h>
|
#include <bluetooth/conn.h>
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <bluetooth/buf.h>
|
#include <bluetooth/buf.h>
|
||||||
#include <bluetooth/hci_raw.h>
|
#include <bluetooth/hci_raw.h>
|
||||||
|
|
||||||
|
#define LOG_MODULE_NAME hci_spi
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#define HCI_CMD 0x01
|
#define HCI_CMD 0x01
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <bluetooth/buf.h>
|
#include <bluetooth/buf.h>
|
||||||
#include <bluetooth/hci_raw.h>
|
#include <bluetooth/hci_raw.h>
|
||||||
|
|
||||||
|
#define LOG_MODULE_NAME hci_uart
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
static struct device *hci_uart_dev;
|
static struct device *hci_uart_dev;
|
||||||
|
|
|
@ -59,7 +59,7 @@ config BT_DEBUG_LOG
|
||||||
bool "Normal printf-style to console"
|
bool "Normal printf-style to console"
|
||||||
select BT_DEBUG
|
select BT_DEBUG
|
||||||
select PRINTK
|
select PRINTK
|
||||||
select SYS_LOG
|
select LOG
|
||||||
help
|
help
|
||||||
This option enables Bluetooth debug going to standard
|
This option enables Bluetooth debug going to standard
|
||||||
serial console.
|
serial console.
|
||||||
|
|
|
@ -54,21 +54,27 @@ __printf_like(2, 3) void bt_log(int prio, const char *fmt, ...);
|
||||||
|
|
||||||
#elif defined(CONFIG_BT_DEBUG_LOG)
|
#elif defined(CONFIG_BT_DEBUG_LOG)
|
||||||
|
|
||||||
#if !defined(SYS_LOG_DOMAIN)
|
#if BT_DBG_ENABLED
|
||||||
#define SYS_LOG_DOMAIN "bt"
|
#define LOG_LEVEL LOG_LEVEL_DBG
|
||||||
|
#else
|
||||||
|
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
|
||||||
#endif
|
#endif
|
||||||
#define SYS_LOG_LEVEL SYS_LOG_LEVEL_DEBUG
|
|
||||||
#include <logging/sys_log.h>
|
|
||||||
|
|
||||||
#define BT_DBG(fmt, ...) \
|
#include <logging/log.h>
|
||||||
if (BT_DBG_ENABLED) { \
|
|
||||||
SYS_LOG_DBG("(%p) " fmt, k_current_get(), \
|
|
||||||
##__VA_ARGS__); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define BT_ERR(fmt, ...) SYS_LOG_ERR(fmt, ##__VA_ARGS__)
|
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
|
||||||
#define BT_WARN(fmt, ...) SYS_LOG_WRN(fmt, ##__VA_ARGS__)
|
|
||||||
#define BT_INFO(fmt, ...) SYS_LOG_INF(fmt, ##__VA_ARGS__)
|
#if IS_ENABLED(CONFIG_LOG_FUNCTION_NAME)
|
||||||
|
#define BT_DBG(fmt, ...) LOG_DBG(fmt, ##__VA_ARGS__)
|
||||||
|
#define BT_ERR(fmt, ...) LOG_ERR(fmt, ##__VA_ARGS__)
|
||||||
|
#define BT_WARN(fmt, ...) LOG_WRN(fmt, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define BT_DBG(fmt, ...) LOG_DBG("%s: " fmt, __func__, ##__VA_ARGS__)
|
||||||
|
#define BT_ERR(fmt, ...) LOG_ERR("%s: " fmt, __func__, ##__VA_ARGS__)
|
||||||
|
#define BT_WARN(fmt, ...) LOG_WRN("%s: " fmt, __func__, ##__VA_ARGS__)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define BT_INFO(fmt, ...) LOG_INF(fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
/* Enabling debug increases stack size requirement considerably */
|
/* Enabling debug increases stack size requirement considerably */
|
||||||
#define BT_STACK_DEBUG_EXTRA 300
|
#define BT_STACK_DEBUG_EXTRA 300
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <tinycrypt/cmac_mode.h>
|
#include <tinycrypt/cmac_mode.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_RPA)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_RPA)
|
||||||
|
#define LOG_MODULE_NAME bt_rpa
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
static int ah(const u8_t irk[16], const u8_t r[3], u8_t out[3])
|
static int ah(const u8_t irk[16], const u8_t r[3], u8_t out[3])
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_crypto
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hal/ecb.h"
|
#include "hal/ecb.h"
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include "hal/cntr.h"
|
#include "hal/cntr.h"
|
||||||
|
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_cntr
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "hal/debug.h"
|
#include "hal/debug.h"
|
||||||
#include "nrf_rtc.h"
|
#include "nrf_rtc.h"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "util/mem.h"
|
#include "util/mem.h"
|
||||||
#include "hal/ecb.h"
|
#include "hal/ecb.h"
|
||||||
|
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_nrf5_ecb
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "hal/debug.h"
|
#include "hal/debug.h"
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "util/memq.h"
|
#include "util/memq.h"
|
||||||
#include "util/mayfly.h"
|
#include "util/mayfly.h"
|
||||||
|
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_nrf5_mayfly
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "hal/debug.h"
|
#include "hal/debug.h"
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include "ticker/ticker.h"
|
#include "ticker/ticker.h"
|
||||||
|
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_nrf5_ticker
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "hal/debug.h"
|
#include "hal/debug.h"
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#endif /* CONFIG_BT_CTLR_DTM_HCI */
|
#endif /* CONFIG_BT_CTLR_DTM_HCI */
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_hci
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "hal/debug.h"
|
#include "hal/debug.h"
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_hci_driver
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "util/util.h"
|
#include "util/util.h"
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "ll_filter.h"
|
#include "ll_filter.h"
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_llsw_ctrl
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_CONN_RSSI)
|
#if defined(CONFIG_BT_CTLR_CONN_RSSI)
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <bluetooth/hci.h>
|
#include <bluetooth/hci.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_llsw_ll
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hal/cpu.h"
|
#include "hal/cpu.h"
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#define ADDR_TYPE_ANON 0xFF
|
#define ADDR_TYPE_ANON 0xFF
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_llsw_llfilter
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hal/debug.h"
|
#include "hal/debug.h"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "ticker.h"
|
#include "ticker.h"
|
||||||
|
|
||||||
|
#define LOG_MODULE_NAME bt_ctlr_ticker
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "hal/debug.h"
|
#include "hal/debug.h"
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <bluetooth/a2dp.h>
|
#include <bluetooth/a2dp.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_A2DP)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_A2DP)
|
||||||
|
#define LOG_MODULE_NAME bt_a2dp
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_ATT)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_ATT)
|
||||||
|
#define LOG_MODULE_NAME bt_att
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/avdtp.h>
|
#include <bluetooth/avdtp.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_AVDTP)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_AVDTP)
|
||||||
|
#define LOG_MODULE_NAME bt_avdtp
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <bluetooth/att.h>
|
#include <bluetooth/att.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_CONN)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_CONN)
|
||||||
|
#define LOG_MODULE_NAME bt_conn
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <tinycrypt/utils.h>
|
#include <tinycrypt/utils.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
||||||
|
#define LOG_MODULE_NAME bt_crypto
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_GATT)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_GATT)
|
||||||
|
#define LOG_MODULE_NAME bt_gatt
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
||||||
|
#define LOG_MODULE_NAME bt_hci_core
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "common/rpa.h"
|
#include "common/rpa.h"
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
||||||
|
#define LOG_MODULE_NAME bt_hci_ecc
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_ecc.h"
|
#include "hci_ecc.h"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <bluetooth/hci_raw.h>
|
#include <bluetooth/hci_raw.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
||||||
|
#define LOG_MODULE_NAME bt_hci_raw
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_ecc.h"
|
#include "hci_ecc.h"
|
||||||
|
|
|
@ -15,7 +15,9 @@
|
||||||
#include <bluetooth/conn.h>
|
#include <bluetooth/conn.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HFP_HF)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HFP_HF)
|
||||||
/* FIXME: #include "common/log.h" */
|
#define LOG_MODULE_NAME bt_hfp_hf
|
||||||
|
#include "common/log.h"
|
||||||
|
|
||||||
#include <bluetooth/rfcomm.h>
|
#include <bluetooth/rfcomm.h>
|
||||||
#include <bluetooth/hfp_hf.h>
|
#include <bluetooth/hfp_hf.h>
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/hci.h>
|
#include <bluetooth/hci.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_KEYS)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_KEYS)
|
||||||
|
#define LOG_MODULE_NAME bt_keys
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "common/rpa.h"
|
#include "common/rpa.h"
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <bluetooth/hci.h>
|
#include <bluetooth/hci.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_KEYS)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_KEYS)
|
||||||
|
#define LOG_MODULE_NAME bt_keys_br
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_L2CAP)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_L2CAP)
|
||||||
|
#define LOG_MODULE_NAME bt_l2cap
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/hci_driver.h>
|
#include <bluetooth/hci_driver.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_L2CAP)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_L2CAP)
|
||||||
|
#define LOG_MODULE_NAME bt_l2cap_br
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_ACCESS)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_ACCESS)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_access
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "mesh.h"
|
#include "mesh.h"
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_ADV)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_ADV)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_adv
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "../hci_core.h"
|
#include "../hci_core.h"
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_BEACON)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_BEACON)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_beacon
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "adv.h"
|
#include "adv.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_MODEL)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_MODEL)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_cfg_cli
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_MODEL)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_MODEL)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_cfg_srv
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "../testing.h"
|
#include "../testing.h"
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <bluetooth/crypto.h>
|
#include <bluetooth/crypto.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_CRYPTO)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_CRYPTO)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_crypto
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "mesh.h"
|
#include "mesh.h"
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_FRIEND)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_FRIEND)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_friend
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_MODEL)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_MODEL)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_health_cli
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_MODEL)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_MODEL)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_health_srv
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "mesh.h"
|
#include "mesh.h"
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_LOW_POWER)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_LOW_POWER)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_lpn
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_main
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_NET)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_NET)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_net
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/uuid.h>
|
#include <bluetooth/uuid.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_PROV)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_PROV)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_prov
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "../ecc.h"
|
#include "../ecc.h"
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_PROXY)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_PROXY)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_proxy
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "mesh.h"
|
#include "mesh.h"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_SETTINGS)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_SETTINGS)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_settings
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "../settings.h"
|
#include "../settings.h"
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_test
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "mesh.h"
|
#include "mesh.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/mesh.h>
|
#include <bluetooth/mesh.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_TRANS)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_TRANS)
|
||||||
|
#define LOG_MODULE_NAME bt_mesh_transport
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "../testing.h"
|
#include "../testing.h"
|
||||||
|
|
|
@ -21,7 +21,9 @@
|
||||||
#include <bluetooth/l2cap.h>
|
#include <bluetooth/l2cap.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_RFCOMM)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_RFCOMM)
|
||||||
/* FIXME: #include "common/log.h" */
|
#define LOG_MODULE_NAME bt_rfcomm
|
||||||
|
#include "common/log.h"
|
||||||
|
|
||||||
#include <bluetooth/rfcomm.h>
|
#include <bluetooth/rfcomm.h>
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <bluetooth/sdp.h>
|
#include <bluetooth/sdp.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_SDP)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_SDP)
|
||||||
|
#define LOG_MODULE_NAME bt_sdp
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <bluetooth/conn.h>
|
#include <bluetooth/conn.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_SETTINGS)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_SETTINGS)
|
||||||
|
#define LOG_MODULE_NAME bt_settings
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <tinycrypt/cmac_mode.h>
|
#include <tinycrypt/cmac_mode.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_SMP)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_SMP)
|
||||||
|
#define LOG_MODULE_NAME bt_smp
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <bluetooth/buf.h>
|
#include <bluetooth/buf.h>
|
||||||
|
|
||||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_CORE)
|
||||||
|
#define LOG_MODULE_NAME bt_smp
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
|
|
||||||
#include "hci_core.h"
|
#include "hci_core.h"
|
||||||
|
|
|
@ -415,6 +415,7 @@ static int cmd_name(const struct shell *shell, size_t argc, char *argv[])
|
||||||
|
|
||||||
static int cmd_id_create(const struct shell *shell, size_t argc, char *argv[])
|
static int cmd_id_create(const struct shell *shell, size_t argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
char addr_str[BT_ADDR_LE_STR_LEN];
|
||||||
bt_addr_le_t addr;
|
bt_addr_le_t addr;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
@ -432,14 +433,15 @@ static int cmd_id_create(const struct shell *shell, size_t argc, char *argv[])
|
||||||
error(shell, "Creating new ID failed (err %d)", err);
|
error(shell, "Creating new ID failed (err %d)", err);
|
||||||
}
|
}
|
||||||
|
|
||||||
print(shell, "New identity (%d) created: %s", err,
|
bt_addr_le_to_str(&addr, addr_str, sizeof(addr_str));
|
||||||
bt_addr_le_str(&addr));
|
print(shell, "New identity (%d) created: %s", err, addr_str);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cmd_id_reset(const struct shell *shell, size_t argc, char *argv[])
|
static int cmd_id_reset(const struct shell *shell, size_t argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
char addr_str[BT_ADDR_LE_STR_LEN];
|
||||||
bt_addr_le_t addr;
|
bt_addr_le_t addr;
|
||||||
u8_t id;
|
u8_t id;
|
||||||
int err;
|
int err;
|
||||||
|
@ -467,7 +469,8 @@ static int cmd_id_reset(const struct shell *shell, size_t argc, char *argv[])
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
print(shell, "Identity %u reset: %s", id, bt_addr_le_str(&addr));
|
bt_addr_le_to_str(&addr, addr_str, sizeof(addr_str));
|
||||||
|
print(shell, "Identity %u reset: %s", id, addr_str);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -503,8 +506,11 @@ static int cmd_id_show(const struct shell *shell, size_t argc, char *argv[])
|
||||||
bt_id_get(addrs, &count);
|
bt_id_get(addrs, &count);
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
|
char addr_str[BT_ADDR_LE_STR_LEN];
|
||||||
|
|
||||||
|
bt_addr_le_to_str(&addrs[i], addr_str, sizeof(addr_str));
|
||||||
print(shell, "%s%zu: %s", i == selected_id ? "*" : " ", i,
|
print(shell, "%s%zu: %s", i == selected_id ? "*" : " ", i,
|
||||||
bt_addr_le_str(&addrs[i]));
|
addr_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -512,6 +518,7 @@ static int cmd_id_show(const struct shell *shell, size_t argc, char *argv[])
|
||||||
|
|
||||||
static int cmd_id_select(const struct shell *shell, size_t argc, char *argv[])
|
static int cmd_id_select(const struct shell *shell, size_t argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
char addr_str[BT_ADDR_LE_STR_LEN];
|
||||||
bt_addr_le_t addrs[CONFIG_BT_ID_MAX];
|
bt_addr_le_t addrs[CONFIG_BT_ID_MAX];
|
||||||
size_t count = CONFIG_BT_ID_MAX;
|
size_t count = CONFIG_BT_ID_MAX;
|
||||||
u8_t id;
|
u8_t id;
|
||||||
|
@ -530,8 +537,8 @@ static int cmd_id_select(const struct shell *shell, size_t argc, char *argv[])
|
||||||
return -ENOEXEC;
|
return -ENOEXEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
print(shell, "Selected identity: %s",
|
bt_addr_le_to_str(&addrs[id], addr_str, sizeof(addr_str));
|
||||||
bt_addr_le_str(&addrs[id]));
|
print(shell, "Selected identity: %s", addr_str);
|
||||||
selected_id = id;
|
selected_id = id;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -18,8 +18,8 @@ CONFIG_BT_TINYCRYPT_ECC=y
|
||||||
CONFIG_BT_SHELL=y
|
CONFIG_BT_SHELL=y
|
||||||
CONFIG_BT_DEVICE_NAME="test shell"
|
CONFIG_BT_DEVICE_NAME="test shell"
|
||||||
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
|
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
|
||||||
CONFIG_BT_L2CAP_TX_BUF_COUNT=6
|
CONFIG_BT_L2CAP_TX_BUF_COUNT=4
|
||||||
CONFIG_BT_ID_MAX=4
|
CONFIG_BT_ID_MAX=2
|
||||||
|
|
||||||
CONFIG_BT_SETTINGS=y
|
CONFIG_BT_SETTINGS=y
|
||||||
CONFIG_FLASH=y
|
CONFIG_FLASH=y
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue