Implement robust caching (client)
Flag:
- Use flag to enable/disable robust caching on client side
When receiving service changed indication
- set read_db_hash flag to true
Read db hash function and response handler
- add bta_gattc_read_db_hash
- add bta_gattc_read_db_hash_cmpl
- reset read_db_hash flag
- If hash match, set states of all related clcb back to CONN_ST
- If hash not match, start service discovery
When start service discovery is called
- read db hash first if read_db_hash flag is on
- start service discovery immediately if above request is rejected
- start service discovery immediately if read_db_hash flag is off
When receiving response during discover state
- call bta_gattc_read_db_hash_cmpl,
if BTA_GATTC_DISCOVER_REQ_READ_DB_HASH is set
- call bta_gattc_read_ext_prop_desc_cmpl,
if BTA_GATTC_DISCOVER_REQ_READ_EXT_PROP_DESC is set
When DATABASE OUT OF SYNC is received during connected state
- send the error(0x12) to application layer
- start service discovery immediately
When DATABASE OUT OF SYNC is received during discover state
- if the retry count exceeds the limit, do nothing
- otherwise restart service discovery again, and increase the retry count
When service discovery is completed (bta_gattc_explore_srvc_finished)
- if result is GATT_SUCCESS, reset the count to zero
Bug: 154056389
Test: compile & verify gatt client behavior
Tag: #feature
Change-Id: I8e3e03302c03f49bda40f0ec20ad5c607ef6dcdf
Loading
Please register or sign in to comment