From ee3f634cf71a03fca0326871c620b720c1c01091 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 12 Feb 2020 12:49:34 +0100 Subject: [PATCH] Bluetooth: GATT: Document settings_load and service register requirement Document that all services that should be included in the initial database hash should be registered before calling settings load. All services added after settings_load will trigger a new hash calculation and a new value stored. This would result in the database hash always being rewritten. Signed-off-by: Joakim Andersson --- include/bluetooth/gatt.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/bluetooth/gatt.h b/include/bluetooth/gatt.h index 0e19593958a..b05ff532d62 100644 --- a/include/bluetooth/gatt.h +++ b/include/bluetooth/gatt.h @@ -310,6 +310,12 @@ struct bt_gatt_cpf { * macros such as BT_GATT_PRIMARY_SERVICE, BT_GATT_CHARACTERISTIC, * BT_GATT_DESCRIPTOR, etc. * + * When using :option:`CONFIG_BT_GATT_CACHING` and :option:`CONFIG_BT_SETTINGS` + * then all services that should be included in the GATT Database Hash + * calculation should be added before calling @ref settings_load. + * All services registered after settings_load will trigger a new database hash + * calculation and a new hash stored. + * * @param svc Service containing the available attributes * * @return 0 in case of success or negative value in case of error.