Hello @DS.4
The REDUC_GATTDB_NVM can be used in all the cases.
When using the FULL_GATTDB_NVM and SVC_CHANGE_DESC, the GATT database record in NVM is composed as describe in the wiki page by:
- Per service:
- 2 bytes for handle
- 3 bytes if 16-bit UUID or 17 bytes if 128-bit UUID
- Per characteristic attribute:
- 2 bytes for handle
- 3 bytes if 16-bit UUID or 17 bytes if 128-bit UUID
- 2 bytes for CCCD value (only if the attribute is a CCCD)
When using the REDUC_GATTDB_NVM and SVC_CHANGE_DESC, the GATT database record in NVM is composed by:
- Per characteristic attribute:
- 3 bytes for CCCD value (only if the attribute is a CCCD)
+ 16 bytes (The Data Base hash stores a 128 bits value calculated from the Data Base structure. Any change in the Data Base structure results in a different hash value.)
When a connection is established with a previously bonded device, the GATT database is compared with the GATT database saved in NVM. If there is a difference between the databases, a service change indication will be sent to the peer device. The contents of the indication will depend of FULL_GATTDB_NVM and REDUC_GATTDB_NVM flags:
- When using FULL_GATTDB_NVM, you know where the change is located, the service change indication will contain the specific handle of the service/characteristic where there is the modification.
- When using REDUC_GATTDB_NVM, since the data stored in NVM is a hash, it is not possible to know where is located the change, the service change indication will indicate a change of all the database.
More details are available on this WiKi.
Best Regards.
STTwo-32