Loading system/bta/gatt/bta_gattc_act.cc +5 −1 Original line number Original line Diff line number Diff line Loading @@ -478,7 +478,7 @@ void bta_gattc_conn(tBTA_GATTC_CLCB* p_clcb, tBTA_GATTC_DATA* p_data) { p_clcb->p_srcb->state != BTA_GATTC_SERV_IDLE) { p_clcb->p_srcb->state != BTA_GATTC_SERV_IDLE) { if (p_clcb->p_srcb->state == BTA_GATTC_SERV_IDLE) { if (p_clcb->p_srcb->state == BTA_GATTC_SERV_IDLE) { p_clcb->p_srcb->state = BTA_GATTC_SERV_LOAD; p_clcb->p_srcb->state = BTA_GATTC_SERV_LOAD; if (bta_gattc_cache_load(p_clcb)) { if (bta_gattc_cache_load(p_clcb->p_srcb)) { p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE; p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE; bta_gattc_reset_discover_st(p_clcb->p_srcb, GATT_SUCCESS); bta_gattc_reset_discover_st(p_clcb->p_srcb, GATT_SUCCESS); } else { } else { Loading Loading @@ -1127,6 +1127,10 @@ bool bta_gattc_process_srvc_chg_ind(uint16_t conn_id, tBTA_GATTC_RCB* p_clrcb, Uuid gattp_uuid = Uuid::From16Bit(UUID_SERVCLASS_GATT_SERVER); Uuid gattp_uuid = Uuid::From16Bit(UUID_SERVCLASS_GATT_SERVER); Uuid srvc_chg_uuid = Uuid::From16Bit(GATT_UUID_GATT_SRV_CHGD); Uuid srvc_chg_uuid = Uuid::From16Bit(GATT_UUID_GATT_SRV_CHGD); if (p_srcb->gatt_database.IsEmpty() && p_srcb->state == BTA_GATTC_SERV_IDLE) { bta_gattc_cache_load(p_srcb); } const gatt::Characteristic* p_char = const gatt::Characteristic* p_char = bta_gattc_get_characteristic_srcb(p_srcb, p_notify->handle); bta_gattc_get_characteristic_srcb(p_srcb, p_notify->handle); if (!p_char) return false; if (!p_char) return false; Loading system/bta/gatt/bta_gattc_cache.cc +4 −5 Original line number Original line Diff line number Diff line Loading @@ -703,15 +703,14 @@ void bta_gattc_get_gatt_db(uint16_t conn_id, uint16_t start_handle, * * * Description Load GATT cache from storage for server. * Description Load GATT cache from storage for server. * * * Parameter p_clcb: pointer to server clcb, that will * Parameter p_srcb: pointer to server cache, that will * be filled from storage * be filled from storage * Returns true on success, false otherwise * Returns true on success, false otherwise * * ******************************************************************************/ ******************************************************************************/ bool bta_gattc_cache_load(tBTA_GATTC_CLCB* p_clcb) { bool bta_gattc_cache_load(tBTA_GATTC_SERV* p_srcb) { char fname[255] = {0}; char fname[255] = {0}; bta_gattc_generate_cache_file_name(fname, sizeof(fname), bta_gattc_generate_cache_file_name(fname, sizeof(fname), p_srcb->server_bda); p_clcb->p_srcb->server_bda); FILE* fd = fopen(fname, "rb"); FILE* fd = fopen(fname, "rb"); if (!fd) { if (!fd) { Loading Loading @@ -748,7 +747,7 @@ bool bta_gattc_cache_load(tBTA_GATTC_CLCB* p_clcb) { goto done; goto done; } } p_clcb->p_srcb->gatt_database = gatt::Database::Deserialize(attr, &success); p_srcb->gatt_database = gatt::Database::Deserialize(attr, &success); } } done: done: Loading system/bta/gatt/bta_gattc_int.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -451,7 +451,7 @@ extern tBTA_GATTC_CONN* bta_gattc_conn_find(const RawAddress& remote_bda); extern tBTA_GATTC_CONN* bta_gattc_conn_find_alloc(const RawAddress& remote_bda); extern tBTA_GATTC_CONN* bta_gattc_conn_find_alloc(const RawAddress& remote_bda); extern bool bta_gattc_conn_dealloc(const RawAddress& remote_bda); extern bool bta_gattc_conn_dealloc(const RawAddress& remote_bda); extern bool bta_gattc_cache_load(tBTA_GATTC_CLCB* p_clcb); extern bool bta_gattc_cache_load(tBTA_GATTC_SERV* p_srcb); extern void bta_gattc_cache_reset(const RawAddress& server_bda); extern void bta_gattc_cache_reset(const RawAddress& server_bda); #endif /* BTA_GATTC_INT_H */ #endif /* BTA_GATTC_INT_H */ Loading
system/bta/gatt/bta_gattc_act.cc +5 −1 Original line number Original line Diff line number Diff line Loading @@ -478,7 +478,7 @@ void bta_gattc_conn(tBTA_GATTC_CLCB* p_clcb, tBTA_GATTC_DATA* p_data) { p_clcb->p_srcb->state != BTA_GATTC_SERV_IDLE) { p_clcb->p_srcb->state != BTA_GATTC_SERV_IDLE) { if (p_clcb->p_srcb->state == BTA_GATTC_SERV_IDLE) { if (p_clcb->p_srcb->state == BTA_GATTC_SERV_IDLE) { p_clcb->p_srcb->state = BTA_GATTC_SERV_LOAD; p_clcb->p_srcb->state = BTA_GATTC_SERV_LOAD; if (bta_gattc_cache_load(p_clcb)) { if (bta_gattc_cache_load(p_clcb->p_srcb)) { p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE; p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE; bta_gattc_reset_discover_st(p_clcb->p_srcb, GATT_SUCCESS); bta_gattc_reset_discover_st(p_clcb->p_srcb, GATT_SUCCESS); } else { } else { Loading Loading @@ -1127,6 +1127,10 @@ bool bta_gattc_process_srvc_chg_ind(uint16_t conn_id, tBTA_GATTC_RCB* p_clrcb, Uuid gattp_uuid = Uuid::From16Bit(UUID_SERVCLASS_GATT_SERVER); Uuid gattp_uuid = Uuid::From16Bit(UUID_SERVCLASS_GATT_SERVER); Uuid srvc_chg_uuid = Uuid::From16Bit(GATT_UUID_GATT_SRV_CHGD); Uuid srvc_chg_uuid = Uuid::From16Bit(GATT_UUID_GATT_SRV_CHGD); if (p_srcb->gatt_database.IsEmpty() && p_srcb->state == BTA_GATTC_SERV_IDLE) { bta_gattc_cache_load(p_srcb); } const gatt::Characteristic* p_char = const gatt::Characteristic* p_char = bta_gattc_get_characteristic_srcb(p_srcb, p_notify->handle); bta_gattc_get_characteristic_srcb(p_srcb, p_notify->handle); if (!p_char) return false; if (!p_char) return false; Loading
system/bta/gatt/bta_gattc_cache.cc +4 −5 Original line number Original line Diff line number Diff line Loading @@ -703,15 +703,14 @@ void bta_gattc_get_gatt_db(uint16_t conn_id, uint16_t start_handle, * * * Description Load GATT cache from storage for server. * Description Load GATT cache from storage for server. * * * Parameter p_clcb: pointer to server clcb, that will * Parameter p_srcb: pointer to server cache, that will * be filled from storage * be filled from storage * Returns true on success, false otherwise * Returns true on success, false otherwise * * ******************************************************************************/ ******************************************************************************/ bool bta_gattc_cache_load(tBTA_GATTC_CLCB* p_clcb) { bool bta_gattc_cache_load(tBTA_GATTC_SERV* p_srcb) { char fname[255] = {0}; char fname[255] = {0}; bta_gattc_generate_cache_file_name(fname, sizeof(fname), bta_gattc_generate_cache_file_name(fname, sizeof(fname), p_srcb->server_bda); p_clcb->p_srcb->server_bda); FILE* fd = fopen(fname, "rb"); FILE* fd = fopen(fname, "rb"); if (!fd) { if (!fd) { Loading Loading @@ -748,7 +747,7 @@ bool bta_gattc_cache_load(tBTA_GATTC_CLCB* p_clcb) { goto done; goto done; } } p_clcb->p_srcb->gatt_database = gatt::Database::Deserialize(attr, &success); p_srcb->gatt_database = gatt::Database::Deserialize(attr, &success); } } done: done: Loading
system/bta/gatt/bta_gattc_int.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -451,7 +451,7 @@ extern tBTA_GATTC_CONN* bta_gattc_conn_find(const RawAddress& remote_bda); extern tBTA_GATTC_CONN* bta_gattc_conn_find_alloc(const RawAddress& remote_bda); extern tBTA_GATTC_CONN* bta_gattc_conn_find_alloc(const RawAddress& remote_bda); extern bool bta_gattc_conn_dealloc(const RawAddress& remote_bda); extern bool bta_gattc_conn_dealloc(const RawAddress& remote_bda); extern bool bta_gattc_cache_load(tBTA_GATTC_CLCB* p_clcb); extern bool bta_gattc_cache_load(tBTA_GATTC_SERV* p_srcb); extern void bta_gattc_cache_reset(const RawAddress& server_bda); extern void bta_gattc_cache_reset(const RawAddress& server_bda); #endif /* BTA_GATTC_INT_H */ #endif /* BTA_GATTC_INT_H */