nimble/host: implement robust gatt caching (server side)#2098
Draft
piotrnarajowski wants to merge 6 commits intoapache:masterfrom
Draft
nimble/host: implement robust gatt caching (server side)#2098piotrnarajowski wants to merge 6 commits intoapache:masterfrom
piotrnarajowski wants to merge 6 commits intoapache:masterfrom
Conversation
3e5a5ba to
0b27c37
Compare
23bf060 to
aa0ae98
Compare
aa0ae98 to
1095778
Compare
This was referenced Aug 27, 2025
447da04 to
74a3cc4
Compare
74a3cc4 to
94441bd
Compare
szymon-czapracki
suggested changes
Dec 2, 2025
|
|
||
| /** | ||
| * Calculates database hash value | ||
| * @return |
Contributor
There was a problem hiding this comment.
Describe return values for this function.
|
|
||
| hash = ble_gatts_get_db_hash(); | ||
|
|
||
| for (int i = 0; i < BLE_GATT_DB_HASH_SZ; i++) { |
Contributor
There was a problem hiding this comment.
Declare the loop control variable at the beginning of the function with the rest of the variables.
Suggested change
| for (int i = 0; i < BLE_GATT_DB_HASH_SZ; i++) { | |
| for (i = 0; i < BLE_GATT_DB_HASH_SZ; i++) { |
|
|
||
| if (rc == 0) { | ||
| /* Peer will become change aware after first att request after | ||
| * reading hash*/ |
Contributor
There was a problem hiding this comment.
Suggested change
| * reading hash*/ | |
| * reading hash */ |
Comment on lines
+211
to
213
| int rc; | ||
| ble_svc_gatt_start_handle = start_handle; | ||
| ble_svc_gatt_end_handle = end_handle; |
Contributor
There was a problem hiding this comment.
Suggested change
| int rc; | |
| ble_svc_gatt_start_handle = start_handle; | |
| ble_svc_gatt_end_handle = end_handle; | |
| int rc; | |
| ble_svc_gatt_start_handle = start_handle; | |
| ble_svc_gatt_end_handle = end_handle; |
| ble_svc_gatt_end_handle = end_handle; | ||
| ble_hs_lock(); | ||
| rc = ble_gatts_calculate_db_hash(); | ||
| if (rc != 0) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (rc != 0) { | |
| if (rc) { |
| for (entry = STAILQ_FIRST(&ble_att_svr_list); entry != NULL; | ||
| entry = STAILQ_NEXT(entry, ha_next)) { | ||
| rc = cb(entry, arg); | ||
| if (rc != 0) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (rc != 0) { | |
| if (rc) { |
| * to such a client until it becomes change-aware */ | ||
| if (!is_change_aware(conn_handle)) { | ||
| rc = ble_att_svr_read_local(chr_val_handle - 1, &om); | ||
| if (rc != 0) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (rc != 0) { | |
| if (rc) { |
|
|
||
| #if MYNEWT_VAL(BLE_ATT_SVR_ROBUST_CACHE) | ||
| rc = ble_gatts_calculate_db_hash(); | ||
| if (rc != 0) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (rc != 0) { | |
| if (rc) { |
Contributor
There was a problem hiding this comment.
This applies in multiple places further in the code.
| } | ||
|
|
||
| diff = 0; | ||
| for (size_t i = 0; i < BLE_GATT_DB_HASH_SZ; ++i) { |
Contributor
There was a problem hiding this comment.
Declare control variable outside loop definition.
Suggested change
| for (size_t i = 0; i < BLE_GATT_DB_HASH_SZ; ++i) { | |
| for (i = 0; i < BLE_GATT_DB_HASH_SZ; ++i) { |
Add support for Robust GATT Caching.
Add support for BLE_STORE_OBJ_TYPE_PEER_CL_SUP_FEAT. This is used for storing values of Client Supported Features for clients with a trusted relationship.
This adds support for storing client supported features for clients with a trusted relationship. Fixes Host qualification test case GATT/SR/GAS/BV-04-C
Move BLE_GATT_CHR_CLI_SUP_FEAT_SZ to public header.
Extend storage unit tests to cover new object type PEER_CL_SUP_FEAT
Extend storage unit tests to test new object type DB_HASH.
94441bd to
cd2e0bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for Robust GATT Caching.
Depends on #2114 #2088