From 04d723ed0595fa9c36696fcfd63ae61714a84a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Mon, 25 Oct 2021 13:03:08 +0200 Subject: [PATCH] host/mesh: define Low Latency mode for non-NimBLE controller This fixes build for porting --- nimble/host/mesh/src/adv_legacy.c | 8 +++++++- porting/examples/linux_blemesh/include/syscfg/syscfg.h | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nimble/host/mesh/src/adv_legacy.c b/nimble/host/mesh/src/adv_legacy.c index ab8a92161..837eaa736 100644 --- a/nimble/host/mesh/src/adv_legacy.c +++ b/nimble/host/mesh/src/adv_legacy.c @@ -22,6 +22,12 @@ /* Convert from ms to 0.625ms units */ #define ADV_SCAN_UNIT(_ms) ((_ms) * 8 / 5) +#if (MYNEWT_VAL(BSP_NRF51) && !MYNEWT_VAL(BLE_CONTROLLER)) +#define CONFIG_BT_CTLR_LOW_LAT 1 +#else +#define CONFIG_BT_CTLR_LOW_LAT 0 +#endif + /* Pre-5.0 controllers enforce a minimum interval of 100ms * whereas 5.0+ controllers can go down to 20ms. */ @@ -83,7 +89,7 @@ static inline void adv_send(struct os_mbuf *buf) * amount of scan window duration to compensate for the blocked * advertising events. */ - if (MYNEWT_VAL(BSP_NRF51)) { + if (CONFIG_BT_CTLR_LOW_LAT) { duration += BT_MESH_SCAN_WINDOW_MS; } #endif diff --git a/porting/examples/linux_blemesh/include/syscfg/syscfg.h b/porting/examples/linux_blemesh/include/syscfg/syscfg.h index 2fd5232b9..e132d4c06 100644 --- a/porting/examples/linux_blemesh/include/syscfg/syscfg.h +++ b/porting/examples/linux_blemesh/include/syscfg/syscfg.h @@ -1013,6 +1013,11 @@ #define MYNEWT_VAL_BLE_MESH_OOB_OUTPUT_SIZE (4) #endif + +#ifndef MYNEWT_VAL_BSP_NRF51 +#define MYNEWT_VAL_BSP_NRF51 (0) +#endif + /* Overridden by @apache-mynewt-nimble/porting/targets/linux_blemesh (defined by @apache-mynewt-nimble/nimble/host/mesh) */ #ifndef MYNEWT_VAL_BLE_MESH_PB_ADV #define MYNEWT_VAL_BLE_MESH_PB_ADV (1)