return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
-esp_err_t esp_ble_gattc_cache_associat(esp_gatt_if_t gattc_if, esp_bd_addr_t src_addr, esp_bd_addr_t ass_addr, bool is_associat)
+esp_err_t esp_ble_gattc_cache_assoc(esp_gatt_if_t gattc_if, esp_bd_addr_t src_addr, esp_bd_addr_t assoc_addr, bool is_assoc)
{
btc_msg_t msg;
btc_ble_gattc_args_t arg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GATTC;
- msg.act = BTC_GATTC_ACT_CACHE_ASSOCIAT;
- arg.cache_associat.is_associat = is_associat;
- arg.cache_associat.gattc_if = gattc_if;
- memcpy(arg.cache_associat.src_addr, src_addr, sizeof(esp_bd_addr_t));
- memcpy(arg.cache_associat.ass_addr, ass_addr, sizeof(esp_bd_addr_t));
+ msg.act = BTC_GATTC_ACT_CACHE_ASSOC;
+ arg.cache_assoc.is_assoc = is_assoc;
+ arg.cache_assoc.gattc_if = gattc_if;
+ memcpy(arg.cache_assoc.src_addr, src_addr, sizeof(esp_bd_addr_t));
+ memcpy(arg.cache_assoc.assoc_addr, assoc_addr, sizeof(esp_bd_addr_t));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
ESP_GATTC_DISCONNECT_EVT = 41, /*!< When the ble physical connection disconnected, the event comes */
ESP_GATTC_READ_MULTIPLE_EVT = 42, /*!< When the ble characteristic or descriptor multiple complete, the event comes */
ESP_GATTC_QUEUE_FULL_EVT = 43, /*!< When the gattc command queue full, the event comes */
- ESP_GATTC_SET_ASSOCIAT_EVT = 44, /*!< When the ble gattc set the associat address complete, the event comes */
+ ESP_GATTC_SET_ASSOC_EVT = 44, /*!< When the ble gattc set the associated address complete, the event comes */
ESP_GATTC_GET_ADDR_LIST_EVT = 45, /*!< When the ble get gattc address list in cache finish, the event comes */
} esp_gattc_cb_event_t;
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
} disconnect; /*!< Gatt client callback param of ESP_GATTC_DISCONNECT_EVT */
/**
- * @brief ESP_GATTC_SET_ASSOCIAT_EVT
+ * @brief ESP_GATTC_SET_ASSOC_EVT
*/
- struct gattc_set_ass_addr_cmp_evt_param {
+ struct gattc_set_assoc_addr_cmp_evt_param {
esp_gatt_status_t status; /*!< Operation status */
- } set_ass_cmp; /*!< Gatt client callback param of ESP_GATTC_SET_ASSOCIAT_EVT */
+ } set_assoc_cmp; /*!< Gatt client callback param of ESP_GATTC_SET_ASSOC_EVT */
/**
* @brief ESP_GATTC_GET_ADDR_LIST_EVT
*/
/**
* @brief Add or delete the associated address with the source address.
+* Note: The role of this API is mainly when the client side has stored a server-side database,
+* when it needs to connect another device, but the device's attribute database is the same
+* as the server database stored on the client-side, calling this API can use the database
+* that the device has stored used as the peer server database to reduce the attribute
+* database search and discovery process and speed up the connection time.
+* The associated address mains that device want to used the database has stored in the local cache.
+* The source address mains that device want to share the database to the associated address device.
*
* @param[in] gattc_if: Gatt client access interface.
* @param[in] src_addr: the source address which provide the attribute table.
-* @param[in] ass_addr: the associated device address which went to share the attribute table with the source address.
-* @param[in] is_associat: true add the associated device address, false remove the associated device address.
+* @param[in] assoc_addr: the associated device address which went to share the attribute table with the source address.
+* @param[in] is_assoc: true add the associated device address, false remove the associated device address.
* @return
* - ESP_OK: success
* - other: failed
*
*/
-esp_err_t esp_ble_gattc_cache_associat(esp_gatt_if_t gattc_if, esp_bd_addr_t src_addr,
- esp_bd_addr_t ass_addr, bool is_associat);
+esp_err_t esp_ble_gattc_cache_assoc(esp_gatt_if_t gattc_if, esp_bd_addr_t src_addr,
+ esp_bd_addr_t assoc_addr, bool is_assoc);
/**
* @brief Get the address list which has store the attribute table in the gattc cache. There will
* callback ESP_GATTC_GET_ADDR_LIST_EVT event when get address list complete.
bta_gattc_cache_reset(p_msg->api_conn.remote_bda);
}
-void bta_gattc_process_api_cache_associat(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg)
+void bta_gattc_process_api_cache_assoc(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg)
{
tBTA_GATTC gattc_cb = {0};
- gattc_cb.set_associa.client_if = p_msg->api_associa.client_if;
+ gattc_cb.set_assoc.client_if = p_msg->api_assoc.client_if;
BOOLEAN state = FALSE;
- tBTA_GATTC_CLCB *p_ass_clcb = bta_gattc_find_clcb_by_cif(p_msg->api_associa.client_if,
- p_msg->api_associa.ass_addr, BTA_TRANSPORT_LE);
- tBTA_GATTC_RCB *p_clrcb = bta_gattc_cl_get_regcb(p_msg->api_associa.client_if);
- if (p_ass_clcb != NULL) {
- if (p_ass_clcb->state == BTA_GATTC_CONN_ST || p_ass_clcb->state == BTA_GATTC_DISCOVER_ST) {
- gattc_cb.set_associa.status = BTA_GATT_BUSY;
+ tBTA_GATTC_CLCB *p_assoc_clcb = bta_gattc_find_clcb_by_cif(p_msg->api_assoc.client_if,
+ p_msg->api_assoc.assoc_addr, BTA_TRANSPORT_LE);
+ tBTA_GATTC_RCB *p_clrcb = bta_gattc_cl_get_regcb(p_msg->api_assoc.client_if);
+ if (p_assoc_clcb != NULL) {
+ if (p_assoc_clcb->state == BTA_GATTC_CONN_ST || p_assoc_clcb->state == BTA_GATTC_DISCOVER_ST) {
+ gattc_cb.set_assoc.status = BTA_GATT_BUSY;
if (p_clrcb != NULL) {
- (*p_clrcb->p_cback)(BTA_GATTC_ASSOCIAT_EVT, &gattc_cb);
+ (*p_clrcb->p_cback)(BTA_GATTC_ASSOC_EVT, &gattc_cb);
return;
}
}
}
- if (p_msg->api_associa.is_associa) {
- if ((state = bta_gattc_co_cache_append_ass_addr(p_msg->api_associa.src_addr, p_msg->api_associa.ass_addr)) == TRUE) {
- gattc_cb.set_associa.status = BTA_GATT_OK;
+ if (p_msg->api_assoc.is_assoc) {
+ if ((state = bta_gattc_co_cache_append_assoc_addr(p_msg->api_assoc.src_addr, p_msg->api_assoc.assoc_addr)) == TRUE) {
+ gattc_cb.set_assoc.status = BTA_GATT_OK;
} else {
- gattc_cb.set_associa.status = BTA_GATT_ERROR;
+ gattc_cb.set_assoc.status = BTA_GATT_ERROR;
if (p_clrcb != NULL) {
- (*p_clrcb->p_cback)(BTA_GATTC_ASSOCIAT_EVT, &gattc_cb);
+ (*p_clrcb->p_cback)(BTA_GATTC_ASSOC_EVT, &gattc_cb);
return;
}
}
} else {
- if (( state = bta_gattc_co_cache_remove_ass_addr(p_msg->api_associa.src_addr, p_msg->api_associa.ass_addr)) == TRUE) {
- gattc_cb.set_associa.status = BTA_GATT_OK;
+ if (( state = bta_gattc_co_cache_remove_assoc_addr(p_msg->api_assoc.src_addr, p_msg->api_assoc.assoc_addr)) == TRUE) {
+ gattc_cb.set_assoc.status = BTA_GATT_OK;
} else {
- gattc_cb.set_associa.status = BTA_GATT_ERROR;
+ gattc_cb.set_assoc.status = BTA_GATT_ERROR;
if (p_clrcb != NULL) {
- (*p_clrcb->p_cback)(BTA_GATTC_ASSOCIAT_EVT, &gattc_cb);
+ (*p_clrcb->p_cback)(BTA_GATTC_ASSOC_EVT, &gattc_cb);
return;
}
}
}
if (p_clrcb != NULL) {
- (*p_clrcb->p_cback)(BTA_GATTC_ASSOCIAT_EVT, &gattc_cb);
+ (*p_clrcb->p_cback)(BTA_GATTC_ASSOC_EVT, &gattc_cb);
}
return;
return;
}
-void BTA_GATTC_CacheAssociat(tBTA_GATTC_IF client_if, BD_ADDR src_addr, BD_ADDR ass_addr, BOOLEAN is_associa)
+void BTA_GATTC_CacheAssoc(tBTA_GATTC_IF client_if, BD_ADDR src_addr, BD_ADDR assoc_addr, BOOLEAN is_assoc)
{
- tBTA_GATTC_API_CACHE_ASSO *p_buf;
+ tBTA_GATTC_API_CACHE_ASSOC *p_buf;
- if ((p_buf = (tBTA_GATTC_API_CACHE_ASSO *)osi_malloc(sizeof(tBTA_GATTC_API_CACHE_ASSO))) != NULL) {
- p_buf->hdr.event = BTA_GATTC_API_CACHE_ASSOCIAT_EVT;
- p_buf->is_associa = is_associa;
+ if ((p_buf = (tBTA_GATTC_API_CACHE_ASSOC *)osi_malloc(sizeof(tBTA_GATTC_API_CACHE_ASSOC))) != NULL) {
+ p_buf->hdr.event = BTA_GATTC_API_CACHE_ASSOC_EVT;
+ p_buf->is_assoc = is_assoc;
p_buf->client_if = client_if;
memcpy(p_buf->src_addr, src_addr, sizeof(BD_ADDR));
- memcpy(p_buf->ass_addr, ass_addr, sizeof(BD_ADDR));
+ memcpy(p_buf->assoc_addr, assoc_addr, sizeof(BD_ADDR));
bta_sys_sendmsg(p_buf);
case BTA_GATTC_API_REFRESH_EVT:
bta_gattc_process_api_refresh(p_cb, (tBTA_GATTC_DATA *) p_msg);
break;
- case BTA_GATTC_API_CACHE_ASSOCIAT_EVT:
- bta_gattc_process_api_cache_associat(p_cb, (tBTA_GATTC_DATA *)p_msg);
+ case BTA_GATTC_API_CACHE_ASSOC_EVT:
+ bta_gattc_process_api_cache_assoc(p_cb, (tBTA_GATTC_DATA *)p_msg);
break;
case BTA_GATTC_API_CACHE_GET_ADDR_LIST_EVT:
bta_gattc_process_api_cache_get_addr_list(p_cb, (tBTA_GATTC_DATA *)p_msg);
#define BTA_GATTC_DISCONNECT_EVT 36 /* GATTC DISCONNECT event */
#define BTA_GATTC_READ_MULTIPLE_EVT 37 /* GATTC Read mutiple event */
#define BTA_GATTC_QUEUE_FULL_EVT 38 /* GATTC queue full event */
-#define BTA_GATTC_ASSOCIAT_EVT 39 /* GATTC association address event */
+#define BTA_GATTC_ASSOC_EVT 39 /* GATTC association address event */
#define BTA_GATTC_GET_ADDR_LIST_EVT 40 /* GATTC get address list in the cache event */
typedef UINT8 tBTA_GATTC_EVT;
typedef struct {
tBTA_GATT_STATUS status;
tBTA_GATTC_IF client_if;
-} tBTA_GATTC_SET_ASSOCIAT;
+} tBTA_GATTC_SET_ASSOC;
typedef struct {
tBTA_GATT_STATUS status;
tBTA_GATTC_CONGEST congest;
tBTA_GATTC_QUEUE_FULL queue_full;
tBTA_GATTC_SERVICE_CHANGE srvc_chg; /* service change event */
- tBTA_GATTC_SET_ASSOCIAT set_associa;
+ tBTA_GATTC_SET_ASSOC set_assoc;
tBTA_GATTC_GET_ADDR_LIST get_addr_list;
} tBTA_GATTC;
*******************************************************************************/
extern void BTA_GATTC_Refresh(BD_ADDR remote_bda);
-extern void BTA_GATTC_CacheAssociat(tBTA_GATTC_IF client_if, BD_ADDR src_addr, BD_ADDR ass_addr, BOOLEAN is_associa);
+extern void BTA_GATTC_CacheAssoc(tBTA_GATTC_IF client_if, BD_ADDR src_addr, BD_ADDR assoc_addr, BOOLEAN is_assoc);
extern void BTA_GATTC_CacheGetAddrList(tBTA_GATTC_IF client_if);
extern void bta_gattc_co_cache_addr_save(BD_ADDR bd_addr, coap_key_t hash_key);
-extern BOOLEAN bta_gattc_co_cache_new_ass_list(BD_ADDR src_addr, uint8_t index);
+extern BOOLEAN bta_gattc_co_cache_new_assoc_list(BD_ADDR src_addr, uint8_t index);
-extern BOOLEAN bta_gattc_co_cache_append_ass_addr(BD_ADDR src_addr, BD_ADDR ass_addr);
+extern BOOLEAN bta_gattc_co_cache_append_assoc_addr(BD_ADDR src_addr, BD_ADDR assoc_addr);
-extern BOOLEAN bta_gattc_co_cache_remove_ass_addr(BD_ADDR src_addr, BD_ADDR ass_addr);
+extern BOOLEAN bta_gattc_co_cache_remove_assoc_addr(BD_ADDR src_addr, BD_ADDR assoc_addr);
-uint8_t* bta_gattc_co_cache_find_src_addr(BD_ADDR ass_addr, uint8_t *index);
+uint8_t* bta_gattc_co_cache_find_src_addr(BD_ADDR assoc_addr, uint8_t *index);
-extern BOOLEAN bta_gattc_co_cache_clear_ass_addr(BD_ADDR src_addr);
+extern BOOLEAN bta_gattc_co_cache_clear_assoc_addr(BD_ADDR src_addr);
#endif /* BTA_GATT_CO_H */
BTA_GATTC_API_BROADCAST_EVT,
BTA_GATTC_API_DISABLE_EVT,
BTA_GATTC_ENC_CMPL_EVT,
- BTA_GATTC_API_CACHE_ASSOCIAT_EVT,
+ BTA_GATTC_API_CACHE_ASSOC_EVT,
BTA_GATTC_API_CACHE_GET_ADDR_LIST_EVT,
};
typedef UINT16 tBTA_GATTC_INT_EVT;
BT_HDR hdr;
tBTA_GATTC_IF client_if;
BD_ADDR src_addr;
- BD_ADDR ass_addr;
- BOOLEAN is_associa;
-} tBTA_GATTC_API_CACHE_ASSO;
+ BD_ADDR assoc_addr;
+ BOOLEAN is_assoc;
+} tBTA_GATTC_API_CACHE_ASSOC;
typedef struct {
BT_HDR hdr;
tBTA_GATTC_API_EXEC api_exec;
tBTA_GATTC_API_READ_MULTI api_read_multi;
tBTA_GATTC_API_CFG_MTU api_mtu;
- tBTA_GATTC_API_CACHE_ASSO api_associa;
+ tBTA_GATTC_API_CACHE_ASSOC api_assoc;
tBTA_GATTC_API_GET_ADDR api_get_addr;
tBTA_GATTC_OP_CMPL op_cmpl;
tBTA_GATTC_INT_CONN int_conn;
extern void bta_gattc_send_disconnect_cback( tBTA_GATTC_RCB *p_clreg, tGATT_DISCONN_REASON reason,
BD_ADDR remote_bda, UINT16 conn_id);
extern void bta_gattc_process_api_refresh(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg);
-extern void bta_gattc_process_api_cache_associat(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg);
+extern void bta_gattc_process_api_cache_assoc(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg);
extern void bta_gattc_process_api_cache_get_addr_list(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg);
extern void bta_gattc_cfg_mtu(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
#if BLE_INCLUDED == TRUE
case BTC_GATTC_ACT_CACHE_REFRESH:
BTA_GATTC_Refresh(arg->cache_refresh.remote_bda);
break;
- case BTC_GATTC_ACT_CACHE_ASSOCIAT:
- BTA_GATTC_CacheAssociat(arg->cache_associat.gattc_if,
- arg->cache_associat.src_addr,
- arg->cache_associat.ass_addr,
- arg->cache_associat.is_associat);
+ case BTC_GATTC_ACT_CACHE_ASSOC:
+ BTA_GATTC_CacheAssoc(arg->cache_assoc.gattc_if,
+ arg->cache_assoc.src_addr,
+ arg->cache_assoc.assoc_addr,
+ arg->cache_assoc.is_assoc);
break;
case BTC_GATTC_ATC_CACHE_GET_ADDR_LIST:
BTA_GATTC_CacheGetAddrList(arg->get_addr_list.gattc_if);
btc_gattc_cb_to_app(ESP_GATTC_QUEUE_FULL_EVT, gattc_if, ¶m);
break;
}
- case BTA_GATTC_ASSOCIAT_EVT: {
- gattc_if = arg->set_associa.client_if;
- param.set_ass_cmp.status = arg->set_associa.status;
- btc_gattc_cb_to_app(ESP_GATTC_SET_ASSOCIAT_EVT, gattc_if, ¶m);
+ case BTA_GATTC_ASSOC_EVT: {
+ gattc_if = arg->set_assoc.client_if;
+ param.set_assoc_cmp.status = arg->set_assoc.status;
+ btc_gattc_cb_to_app(ESP_GATTC_SET_ASSOC_EVT, gattc_if, ¶m);
break;
}
case BTA_GATTC_GET_ADDR_LIST_EVT: {
BTC_GATTC_ACT_REG_FOR_NOTIFY,
BTC_GATTC_ACT_UNREG_FOR_NOTIFY,
BTC_GATTC_ACT_CACHE_REFRESH,
- BTC_GATTC_ACT_CACHE_ASSOCIAT,
+ BTC_GATTC_ACT_CACHE_ASSOC,
BTC_GATTC_ATC_CACHE_GET_ADDR_LIST,
} btc_gattc_act_t;
struct cache_refresh_arg {
esp_bd_addr_t remote_bda;
} cache_refresh;
- //BTC_GATTC_ACT_CACHE_ASSOCIAT
- struct cache_associat_arg {
+ //BTC_GATTC_ACT_CACHE_ASSOC
+ struct cache_assoc_arg {
esp_gatt_if_t gattc_if;
esp_bd_addr_t src_addr;
- esp_bd_addr_t ass_addr;
- bool is_associat;
- } cache_associat;
+ esp_bd_addr_t assoc_addr;
+ bool is_assoc;
+ } cache_assoc;
//BTC_GATTC_ATC_CACHE_GET_ADDR_LIST
struct cache_get_addr_list_arg {
esp_gatt_if_t gattc_if;
BOOLEAN is_open;
BD_ADDR addr;
coap_key_t hash_key;
- list_t *ass_addr;
+ list_t *assoc_addr;
}cache_addr_info_t;
typedef struct {
{
UNUSED(to_save);
char fname[255] = {0};
- UINT8 *ass_addr = NULL;
+ UINT8 *assoc_addr = NULL;
esp_err_t status = ESP_FAIL;
coap_key_t hash_key = {0};
if (((*index = bta_gattc_co_find_addr_in_cache(bda)) != INVALID_ADDR_NUM) ||
- ((ass_addr = bta_gattc_co_cache_find_src_addr(bda, index)) != NULL)) {
+ ((assoc_addr = bta_gattc_co_cache_find_src_addr(bda, index)) != NULL)) {
if (cache_env.cache_addr[*index].is_open) {
return TRUE;
} else {
//cache_env.cache_addr
if ((index = bta_gattc_co_find_addr_in_cache(bda)) != INVALID_ADDR_NUM) {
//clear the association address pending in the source address.
- bta_gattc_co_cache_clear_ass_addr(bda);
+ bta_gattc_co_cache_clear_assoc_addr(bda);
if (cache_env.cache_addr[index].is_open) {
nvs_erase_all(cache_env.cache_addr[index].cache_fp);
nvs_close(cache_env.cache_addr[index].cache_fp);
cache_env.cache_addr[i].addr[3], cache_env.cache_addr[i].addr[4], cache_env.cache_addr[i].addr[5]);
APPL_TRACE_DEBUG("hash_key[%x] = %x%x%x%x", i, cache_env.cache_addr[i].hash_key[0], cache_env.cache_addr[i].hash_key[1],
cache_env.cache_addr[i].hash_key[2], cache_env.cache_addr[i].hash_key[3]);
- bta_gattc_co_cache_new_ass_list(cache_env.cache_addr[i].addr, i);
+ bta_gattc_co_cache_new_assoc_list(cache_env.cache_addr[i].addr, i);
}
} else {
APPL_TRACE_ERROR("%s, Line = %d, nvs flash open fail, err_code = %x", __func__, __LINE__, err_code);
}
-BOOLEAN bta_gattc_co_cache_new_ass_list(BD_ADDR src_addr, UINT8 index)
+BOOLEAN bta_gattc_co_cache_new_assoc_list(BD_ADDR src_addr, UINT8 index)
{
cache_addr_info_t *addr_info = &cache_env.cache_addr[index];
- addr_info->ass_addr = list_new(osi_free_func);
- return (addr_info->ass_addr != NULL ? TRUE : FALSE);
+ addr_info->assoc_addr = list_new(osi_free_func);
+ return (addr_info->assoc_addr != NULL ? TRUE : FALSE);
}
-BOOLEAN bta_gattc_co_cache_append_ass_addr(BD_ADDR src_addr, BD_ADDR ass_addr)
+BOOLEAN bta_gattc_co_cache_append_assoc_addr(BD_ADDR src_addr, BD_ADDR assoc_addr)
{
UINT8 addr_index = 0;
cache_addr_info_t *addr_info;
- UINT8 *p_ass_buf = osi_malloc(sizeof(BD_ADDR));
- memcpy(p_ass_buf, ass_addr, sizeof(BD_ADDR));
+ UINT8 *p_assoc_buf = osi_malloc(sizeof(BD_ADDR));
+ memcpy(p_assoc_buf, assoc_addr, sizeof(BD_ADDR));
if ((addr_index = bta_gattc_co_find_addr_in_cache(src_addr)) != INVALID_ADDR_NUM) {
addr_info = &cache_env.cache_addr[addr_index];
- if (addr_info->ass_addr == NULL) {
- addr_info->ass_addr =list_new(NULL);
+ if (addr_info->assoc_addr == NULL) {
+ addr_info->assoc_addr =list_new(NULL);
}
- return list_append(addr_info->ass_addr, p_ass_buf);
+ return list_append(addr_info->assoc_addr, p_assoc_buf);
}
return FALSE;
}
-BOOLEAN bta_gattc_co_cache_remove_ass_addr(BD_ADDR src_addr, BD_ADDR ass_addr)
+BOOLEAN bta_gattc_co_cache_remove_assoc_addr(BD_ADDR src_addr, BD_ADDR assoc_addr)
{
UINT8 addr_index = 0;
cache_addr_info_t *addr_info;
if ((addr_index = bta_gattc_co_find_addr_in_cache(src_addr)) != INVALID_ADDR_NUM) {
addr_info = &cache_env.cache_addr[addr_index];
- if (addr_info->ass_addr != NULL) {
- for (list_node_t *sn = list_begin(addr_info->ass_addr);
- sn != list_end(addr_info->ass_addr); sn = list_next(sn)) {
+ if (addr_info->assoc_addr != NULL) {
+ for (list_node_t *sn = list_begin(addr_info->assoc_addr);
+ sn != list_end(addr_info->assoc_addr); sn = list_next(sn)) {
void *addr = list_node(sn);
- if (!memcmp(addr, ass_addr, sizeof(BD_ADDR))) {
- return list_remove(addr_info->ass_addr, addr);
+ if (!memcmp(addr, assoc_addr, sizeof(BD_ADDR))) {
+ return list_remove(addr_info->assoc_addr, addr);
}
}
- //return list_remove(addr_info->ass_addr, ass_addr);
+ //return list_remove(addr_info->assoc_addr, assoc_addr);
} else {
return FALSE;
}
return FALSE;
}
-UINT8* bta_gattc_co_cache_find_src_addr(BD_ADDR ass_addr, UINT8 *index)
+UINT8* bta_gattc_co_cache_find_src_addr(BD_ADDR assoc_addr, UINT8 *index)
{
UINT8 num = cache_env.num_addr;
cache_addr_info_t *addr_info = &cache_env.cache_addr[0];
UINT8 *addr_data;
- //Check the ass_addr list is NULL or not
- if (addr_info->ass_addr == NULL) {
+ //Check the assoc_addr list is NULL or not
+ if (addr_info->assoc_addr == NULL) {
*index = INVALID_ADDR_NUM;
return NULL;
}
for (int i = 0; i < num; i++) {
- for (const list_node_t *node = list_begin(addr_info->ass_addr); node != list_end(addr_info->ass_addr);
+ for (const list_node_t *node = list_begin(addr_info->assoc_addr); node != list_end(addr_info->assoc_addr);
node = list_next(node)) {
addr_data = (UINT8 *)list_node(node);
- if (!memcmp(addr_data, ass_addr, sizeof(BD_ADDR))) {
+ if (!memcmp(addr_data, assoc_addr, sizeof(BD_ADDR))) {
*index = i;
return (UINT8 *)addr_info->addr;
}
}
addr_info++;
- if (addr_info->ass_addr == NULL) {
+ if (addr_info->assoc_addr == NULL) {
*index = INVALID_ADDR_NUM;
return NULL;
}
return NULL;
}
-BOOLEAN bta_gattc_co_cache_clear_ass_addr(BD_ADDR src_addr)
+BOOLEAN bta_gattc_co_cache_clear_assoc_addr(BD_ADDR src_addr)
{
UINT8 addr_index = 0;
cache_addr_info_t *addr_info;
if ((addr_index = bta_gattc_co_find_addr_in_cache(src_addr)) != INVALID_ADDR_NUM) {
addr_info = &cache_env.cache_addr[addr_index];
- if (addr_info->ass_addr != NULL) {
- list_clear(addr_info->ass_addr);
+ if (addr_info->assoc_addr != NULL) {
+ list_clear(addr_info->assoc_addr);
} else {
return FALSE;
}