Commit 264c207f authored by Johan Hedberg's avatar Johan Hedberg
Browse files

Bluetooth: Add custom "monitor" protocol logging over UART



With most boards there's no simple way to get access to the HCI
traffic. Simultaneously these boards only have one external UART for
the console. This patch introduces a protocol which combines both
normal logs and HCI logs over a single binary protocol sent over the
console UART.

The protocol is modeled based on the btsnoop/monitor protocols used by
BlueZ, and the first tool that's able to decode this is btmon from
BlueZ ("btmon --tty <tty>").

For platforms with two or more external UARTs it is still possible to
use CONFIG_UART_CONSOLE as long as the UART devices used are
different, however on platforms with a single external UART
UART_CONSOLE should be disabled if BLUETOOTH_DEBUG_MONITOR is enabled
(in this case printk/printf get encoded to the monitor protocol).

Origin: Original
Change-Id: I9d3997c7a06fe48e7decb212b2ac9bd8b8f9b74c
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent ad475d86
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -80,4 +80,7 @@ config BLUETOOTH_UART_ON_DEV_NAME
config UART_PIPE_ON_DEV_NAME
	default "UART_2" if UART_PIPE

config BLUETOOTH_MONITOR_ON_DEV_NAME
	default "UART_2" if  BLUETOOTH_DEBUG_MONITOR

endif
+3 −0
Original line number Diff line number Diff line
@@ -94,4 +94,7 @@ config UART_PIPE_ON_DEV_NAME

endif

config BLUETOOTH_MONITOR_ON_DEV_NAME
	default "UART_1" if BLUETOOTH_DEBUG_MONITOR

endif
+3 −0
Original line number Diff line number Diff line
@@ -101,4 +101,7 @@ config UART_PIPE_ON_DEV_NAME

endif

config BLUETOOTH_MONITOR_ON_DEV_NAME
	default "UART_1" if BLUETOOTH_DEBUG_MONITOR

endif
+3 −0
Original line number Diff line number Diff line
@@ -124,6 +124,9 @@ config UART_PIPE_ON_DEV_NAME

endif

config BLUETOOTH_MONITOR_ON_DEV_NAME
	default "UART_1" if BLUETOOTH_DEBUG_MONITOR

if WATCHDOG
config WDT_DW
	def_bool y
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ config UART_PIPE_ON_DEV_NAME

endif

config BLUETOOTH_MONITOR_ON_DEV_NAME
	default UART_NS16550_PORT_1_NAME if BLUETOOTH_DEBUG_MONITOR

if FLASH && SPI

config SPI_FLASH_W25QXXDV
Loading