Bluetooth: Mesh: Warn log mode incompatibility with friendship
Log modes other than the deferred may cause unintended delays during processing of log messages. This in turns will affect scheduling of the receive delay and receive window for both, Friend and LPN. Adding a compilation warning instead of assert as a user may still want to compile a code with friendship feature enabled without actually establishing a friendship. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
parent
37ab40f2f7
commit
163c2bc316
3 changed files with 28 additions and 0 deletions
|
@ -26,6 +26,17 @@
|
|||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_REGISTER(bt_mesh_friend);
|
||||
|
||||
/**
|
||||
* Log modes other than the deferred may cause unintended delays during processing of log messages.
|
||||
* This in turns will affect scheduling of the receive delay and receive window.
|
||||
*/
|
||||
#if !defined(CONFIG_TEST) && !defined(CONFIG_ARCH_POSIX) && \
|
||||
defined(CONFIG_LOG) && !defined(CONFIG_LOG_MODE_DEFERRED) && \
|
||||
(LOG_LEVEL >= LOG_LEVEL_INF)
|
||||
#warning Frienship feature may work unstable when non-deferred log mode is selected. Use the \
|
||||
CONFIG_LOG_MODE_DEFERRED Kconfig option when Friend feature is enabled.
|
||||
#endif
|
||||
|
||||
/* We reserve one extra buffer for each friendship, since we need to be able
|
||||
* to resend the last sent PDU, which sits separately outside of the queue.
|
||||
*/
|
||||
|
|
|
@ -27,6 +27,17 @@
|
|||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_REGISTER(bt_mesh_lpn);
|
||||
|
||||
/**
|
||||
* Log modes other than the deferred may cause unintended delays during processing of log messages.
|
||||
* This in turns will affect scheduling of the receive delay and receive window.
|
||||
*/
|
||||
#if !defined(CONFIG_TEST) && !defined(CONFIG_ARCH_POSIX) && \
|
||||
defined(CONFIG_LOG) && !defined(CONFIG_LOG_MODE_DEFERRED) && \
|
||||
(LOG_LEVEL >= LOG_LEVEL_INF)
|
||||
#warning Frienship feature may work unstable when non-deferred log mode is selected. Use the \
|
||||
CONFIG_LOG_MODE_DEFERRED Kconfig option when Low Power node feature is enabled.
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_MESH_LPN_AUTO)
|
||||
#define LPN_AUTO_TIMEOUT (CONFIG_BT_MESH_LPN_AUTO_TIMEOUT * MSEC_PER_SEC)
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue