-
Notifications
You must be signed in to change notification settings - Fork 463
nimble/host: implement robust gatt caching (server side) #2098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
3e5a5ba to
0b27c37
Compare
23bf060 to
aa0ae98
Compare
aa0ae98 to
1095778
Compare
447da04 to
74a3cc4
Compare
74a3cc4 to
94441bd
Compare
nimble/host/include/host/ble_gatt.h
Outdated
|
|
||
| /** | ||
| * Calculates database hash value | ||
| * @return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Describe return values for this function.
|
|
||
| hash = ble_gatts_get_db_hash(); | ||
|
|
||
| for (int i = 0; i < BLE_GATT_DB_HASH_SZ; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare the loop control variable at the beginning of the function with the rest of the variables.
| 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*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * reading hash*/ | |
| * reading hash */ |
| int rc; | ||
| ble_svc_gatt_start_handle = start_handle; | ||
| ble_svc_gatt_end_handle = end_handle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (rc != 0) { | |
| if (rc) { |
|
|
||
| #if MYNEWT_VAL(BLE_ATT_SVR_ROBUST_CACHE) | ||
| rc = ble_gatts_calculate_db_hash(); | ||
| if (rc != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (rc != 0) { | |
| if (rc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This applies in multiple places further in the code.
| } | ||
|
|
||
| diff = 0; | ||
| for (size_t i = 0; i < BLE_GATT_DB_HASH_SZ; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare control variable outside loop definition.
| for (size_t i = 0; i < BLE_GATT_DB_HASH_SZ; ++i) { | |
| for (i = 0; i < BLE_GATT_DB_HASH_SZ; ++i) { |
| value: 1 | ||
|
|
||
| BLE_ATT_SVR_ROBUST_CACHE: | ||
| description: dupa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm
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
Add support for Robust GATT Caching.
Depends on #2114 #2088