/* Deletes all entries from the store that are attached to the specified peer address. This function deletes security entries and CCCD records. */
int ble_store_util_delete_peer(const ble_addr_t *peer_id_addr)
/* Deletes all entries from the store that are attached to the specified peer address. This function deletes security entries and CCCD records. */
int ble_store_util_delete_peer(const ble_addr_t *peer_id_addr)
{
    union ble_store_key key;
    int rc;
    memset(&key, 0, sizeof key);
    key.sec.peer_addr = *peer_id_addr;
    rc = ble_store_util_delete_all(BLE_STORE_OBJ_TYPE_OUR_SEC, &key);
    if (rc != 0) {
        return rc;
    }
    rc = ble_store_util_delete_all(BLE_STORE_OBJ_TYPE_PEER_SEC, &key);
    if (rc != 0) {
        return rc;
    }
    memset(&key, 0, sizeof key);
    key.cccd.peer_addr = *peer_id_addr;
    rc = ble_store_util_delete_all(BLE_STORE_OBJ_TYPE_CCCD, &key);
    if (rc != 0) {
        return rc;
    }
    return 0;
}