From cf56071974fa1c8feaa1aaec4ae4cb73400755db Mon Sep 17 00:00:00 2001 From: Martin Turon Date: Fri, 11 Oct 2019 10:05:56 -0700 Subject: [PATCH] [toble] Increase GATT table. --- main/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index baf14d5e..5d341151 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -215,12 +215,19 @@ int main(void) { uint32_t appRAMStart = 0; + ble_cfg_t bleCfg; // Configure the BLE stack using the default settings. // Fetch the start address of the application RAM. ret = nrf_sdh_ble_default_cfg_set(WEAVE_DEVICE_LAYER_BLE_CONN_CFG_TAG, &appRAMStart); APP_ERROR_CHECK(ret); + // Increase the GATT table size to allow room for both WoBLE and ToBLE services. + memset(&bleCfg, 0, sizeof(bleCfg)); + bleCfg.gatts_cfg.attr_tab_size.attr_tab_size = NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE * 2; + ret = sd_ble_cfg_set(BLE_GATTS_CFG_ATTR_TAB_SIZE, &bleCfg, appRAMStart); + APP_ERROR_CHECK(ret); + // Enable BLE stack. ret = nrf_sdh_ble_enable(&appRAMStart); APP_ERROR_CHECK(ret);