Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit bf008c60 authored by HsingYuan Lo's avatar HsingYuan Lo Committed by Jakub Pawlowski
Browse files

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
parent aad611cb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment