From 017394c2a67d83c961f9f306e2cdec06618e9e81 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Tue, 16 Feb 2016 15:16:41 +0200 Subject: [PATCH] drivers/nble: Add debug option for Nordic RPC This debug option enables debug of Nordic RPC. Change-Id: I2e963f10ed6407b836e1572673244cb0187227d2 Signed-off-by: Andrei Emeltchenko --- drivers/nble/Kconfig | 7 +++++++ drivers/nble/rpc_deserialize.c | 7 ++++++- drivers/nble/rpc_serialize.c | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/nble/Kconfig b/drivers/nble/Kconfig index 7cb7e98daca..c7cfa7e355f 100644 --- a/drivers/nble/Kconfig +++ b/drivers/nble/Kconfig @@ -103,6 +103,13 @@ config NBLE_DEBUG_GAP Generic Access Profile (GAP) in the interfaces to the Nordic chip. +config NBLE_DEBUG_RPC + bool "NBLE RPC debug" + default n + help + This option enables debug for RPC interface to the Nordic + Bluetooth LE chip. + endif # BLUETOOTH_DEBUG config NBLE_UART_ON_DEV_NAME diff --git a/drivers/nble/rpc_deserialize.c b/drivers/nble/rpc_deserialize.c index 9f165d8c7dd..b0bea044565 100644 --- a/drivers/nble/rpc_deserialize.c +++ b/drivers/nble/rpc_deserialize.c @@ -33,6 +33,11 @@ #include "rpc_functions_to_quark.h" +#if !defined(CONFIG_NBLE_DEBUG_RPC) +#undef BT_DBG +#define BT_DBG(fmt, ...) +#endif + /* Build the list of prototypes and check that list are made only of matching * signatures */ @@ -176,7 +181,7 @@ static void (*m_fct_s_b_b_p[])(void *structure, void *buffer1, uint8_t length1, /* Build debug table to help development with this "robust" macro stuff */ -#if defined(CONFIG_BLUETOOTH_DEBUG) +#if defined(CONFIG_NBLE_DEBUG_RPC) #undef FN_SIG_NONE #undef FN_SIG_S diff --git a/drivers/nble/rpc_serialize.c b/drivers/nble/rpc_serialize.c index 1f4046c8573..1ae09ddfbe1 100644 --- a/drivers/nble/rpc_serialize.c +++ b/drivers/nble/rpc_serialize.c @@ -23,6 +23,11 @@ #include "rpc_functions_to_ble_core.h" +#if !defined(CONFIG_NBLE_DEBUG_RPC) +#undef BT_DBG +#define BT_DBG(fmt, ...) +#endif + /* Build the functions exposed */ /* Define the functions identifiers per signature */ #define FN_SIG_NONE(__fn) fn_index_##__fn,