Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SDK improvement suggestion - BLE_GATT_DB_MAX_CHARS, BLE_DB_DISCOVERY_MAX_SRV

ble_gatt_db.h and ble_db_discovery.h each contain #defines that are problematic, BLE_GATT_DB_MAX_CHARS and BLE_DB_DISCOVERY_MAX_SRV respectively.

Of course, one can change those values to suit the application but there are 2 drawbacks to this approach:
1. We have multiple applications with different requirements sharing the same SDK.
2. Changing SDK code invites problems when updating to a new SDK version.

A simple solution would be to move the #defines to sdk_config.h

Alternatively, allow one to define it without modifying the sdk
#ifndef BLE_GATT_DB_MAX_CHARS
#define BLE_GATT_DB_MAX_CHARS 5 /**< The maximum number of characteristics present in a service record. */
#endif

Related