Functions
Functions
BLE » Generic Attribute Profile (GATT) » Generic Attribute Profile (GATT) Client Cache

## Functions
uint16_t | ble_gattc_cache_enable (uint8_t conn_idx)
| GATTC cache feature enable. More...
uint16_t | ble_gattc_cache_disable (uint8_t conn_idx)
| GATTC cache feature disable. More...
bool | ble_gattc_cache_feat_get (uint8_t conn_idx)
| GATTC Get cache feature state. More...
uint16_t | ble_gattc_cache_get (uint8_t conn_idx, attr_cache_info_t *p_cache_data, uint16_t *p_cache_count)
| GATTC cache data get. More...
uint16_t | ble_gattc_cache_list_get (gatt_cache_list_t *p_cache_list)
| Get the content of the whole GATT caching list. More...
uint16_t | ble_gattc_cache_delete (ble_gap_bdaddr_t *p_peer_bd_addr)
| GATTC cache date delete on disconnection state. More...

## Detailed Description

## Function Documentation

## ◆ ble_gattc_cache_delete()

uint16_t ble_gattc_cache_delete | ( | ble_gap_bdaddr_t * | p_peer_bd_addr | ) |

GATTC cache date delete on disconnection state.

Parameters

  [in] | p_peer_bd_addr | Identity address of peer device.

Return values

  SDK_SUCCESS | Successfully delete cache in nvds.
  BLE_SDK_ERR_BAD_PARAM | Invalid parameter(s) supplied.
  BLE_SDK_ERR_LIST_ITEM_NOT_FOUND | Item not found in list.

## ◆ ble_gattc_cache_disable()

uint16_t ble_gattc_cache_disable | ( | uint8_t | conn_idx | ) |

GATTC cache feature disable.

Note
  This function will delete caching data saved in nvds and disable cache feature.

Parameters

  [in] | conn_idx | Current connection index.

Return values

  SDK_SUCCESS | Successfully enable cache feature.
  BLE_SDK_ERR_BAD_PARAM | Invalid parameter(s) supplied.

## ◆ ble_gattc_cache_enable()

uint16_t ble_gattc_cache_enable | ( | uint8_t | conn_idx | ) |

GATTC cache feature enable.

Note
  Once enabling peer cache feature and caching data finished, the event BLE_GATTC_EVT_CACHE_UPDATE will be called.

Parameters

  [in] | conn_idx | Current connection index.

Return values

  SDK_SUCCESS | Successfully enable cache feature.
  BLE_SDK_ERR_BAD_PARAM | Invalid parameter(s) supplied.

## ◆ ble_gattc_cache_feat_get()

bool ble_gattc_cache_feat_get | ( | uint8_t | conn_idx | ) |

GATTC Get cache feature state.

Note
  This function returns cache feature state.

Parameters

  [in] | conn_idx | Current connection index.

Returns
  true if cache feature enable, false otherwise.

## ◆ ble_gattc_cache_get()

uint16_t ble_gattc_cache_get | ( | uint8_t | conn_idx,
|  | attr_cache_info_t * | p_cache_data,
|  | uint16_t * | p_cache_count
| ) |  |

GATTC cache data get.

Note
  User should get cache data after gattc_cb_fun_t::app_gattc_cache_update_cb called. Real cache data length will be returned whether user provide enough buf or not. If cache data is NULL, p_cache_count will return cache data length.

Parameters

  [in] | conn_idx | Current connection index.
  [in] | p_cache_data | The attribute cache buf.
  [out] | p_cache_count | The count of attribute cache buf.

Return values

  SDK_SUCCESS | Successfully get cache attributes info.
  BLE_SDK_ERR_BAD_PARAM | Invalid parameter(s) supplied.
  BLE_SDK_ERR_CACHE_NOT_ENABLE | Cache feature is not enabled.
  BLE_SDK_ERR_BUSY | Caching data operation is not finished.
  BLE_SDK_ERR_BUF_LEN_NOT_ENOUGH | The cache buf lenth is not enough.

## ◆ ble_gattc_cache_list_get()

uint16_t ble_gattc_cache_list_get | ( | gatt_cache_list_t * | p_cache_list | ) |

Get the content of the whole GATT caching list.

Parameters

  [in] | p_cache_list | Pointer to the output caching list.

Return values

  SDK_SUCCESS | Operation is successful.
  SDK_ERR_POINTER_NULL | Invalid pointer supplied.