15738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************
25738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
35738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  Copyright (C) 2009-2012 Broadcom Corporation
45738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
55738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  Licensed under the Apache License, Version 2.0 (the "License");
65738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  you may not use this file except in compliance with the License.
75738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  You may obtain a copy of the License at:
85738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
95738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  http://www.apache.org/licenses/LICENSE-2.0
105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  Unless required by applicable law or agreed to in writing, software
125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  distributed under the License is distributed on an "AS IS" BASIS,
135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  See the License for the specific language governing permissions and
155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *  limitations under the License.
165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project *
175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project ******************************************************************************/
185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifndef BTIF_STORAGE_H
205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define BTIF_STORAGE_H
215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "bt_types.h"
235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**  Constants & Macros
265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project********************************************************************************/
275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define BTIF_STORAGE_FILL_PROPERTY(p_prop, t, l, p_v) \
285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project         (p_prop)->type = t;(p_prop)->len = l; (p_prop)->val = (p_v);
295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**  Functions
325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project********************************************************************************/
335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_get_adapter_property
375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Fetches the adapter property->type
395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  from NVRAM and fills property->val.
405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  Caller should provide memory for property->val and
415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  set the property->val
425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the fetch was successful,
445738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
475738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_get_adapter_property(bt_property_t *property);
485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_set_adapter_property
525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Stores the adapter property
545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  to NVRAM
555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the store was successful,
575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_set_adapter_property(bt_property_t *property);
615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_get_remote_device_property
655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Fetches the remote device property->type
675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  from NVRAM and fills property->val.
685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  Caller should provide memory for property->val and
695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  set the property->val
705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the fetch was successful,
725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_get_remote_device_property(bt_bdaddr_t *remote_bd_addr,
765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                                    bt_property_t *property);
775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_set_remote_device_property
815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Stores the remote device property
835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  to NVRAM
845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the store was successful,
865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_set_remote_device_property(bt_bdaddr_t *remote_bd_addr,
905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                                    bt_property_t *property);
915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_add_remote_device
955738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Adds a newly discovered device to NVRAM
975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  along with the timestamp. Also, stores the various
985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  properties - RSSI, BDADDR, NAME (if found in EIR)
995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the store was successful,
1015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
1025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
104ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_add_remote_device(bt_bdaddr_t *remote_bd_addr,
1055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                           uint32_t num_properties,
1065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                           bt_property_t *properties);
1075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
1095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_add_bonded_device
1115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Adds the newly bonded device to NVRAM
1135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  along with the link-key, Key type and Pin key length
1145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the store was successful,
1165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
1175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
1195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_add_bonded_device(bt_bdaddr_t *remote_bd_addr,
1205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                           LINK_KEY link_key,
1215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                           uint8_t key_type,
1225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                           uint8_t pin_length);
1235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
1255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_remove_bonded_device
1275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Deletes the bonded device from NVRAM
1295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the deletion was successful,
1315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
1325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
1345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_remove_bonded_device(bt_bdaddr_t *remote_bd_addr);
1355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
1375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_remove_bonded_device
1395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Deletes the bonded device from NVRAM
1415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the deletion was successful,
1435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
1445738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
1465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_load_bonded_devices(void);
1475738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
1495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_read_hl_apps_cb
1515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Read HL application control block from NVRAM
1535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the operation was successful,
1555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
1565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
1585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_read_hl_apps_cb(char *value, int value_size);
1595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
1615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_write_hl_apps_cb
1635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Write HL application control block to NVRAM
1655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the operation was successful,
1675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
1685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
1705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_write_hl_apps_cb(char *value, int value_size);
1715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
1735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_read_hl_apps_cb
1755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Read HL application configuration from NVRAM
1775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the operation was successful,
1795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
1805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
1825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_read_hl_app_data(UINT8 app_idx, char *value, int value_size);
1835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
1855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_write_hl_app_data
1875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Write HL application configuration to NVRAM
1895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the operation was successful,
1915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
1925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
1945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_write_hl_app_data(UINT8 app_idx, char *value, int value_size);
1955738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
1965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
1975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
1985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_read_hl_mdl_data
1995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Read HL application MDL configuration from NVRAM
2015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the operation was successful,
2035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
2045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
2065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_read_hl_mdl_data(UINT8 app_idx, char *value, int value_size);
2075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
2095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_write_hl_mdl_data
2115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Write HL application MDL configuration from NVRAM
2135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the operation was successful,
2155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
2165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
2185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_write_hl_mdl_data(UINT8 app_idx, char *value, int value_size);
2195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
2215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_add_hid_device_info
2235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Adds the hid information of bonded hid devices-to NVRAM
2255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the store was successful,
2275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
2285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
230ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta
2315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_add_hid_device_info(bt_bdaddr_t *remote_bd_addr,
2325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                                    UINT16 attr_mask, UINT8 sub_class,
2335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                                    UINT8 app_id, UINT16 vendor_id,
2345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project                                                    UINT16 product_id, UINT16 version,
2358a82348c04109cb85e3c0b676dd1c7c5cb461c24Adam Hampson                                                    UINT8 ctry_code, UINT16 ssr_max_latency,
2368a82348c04109cb85e3c0b676dd1c7c5cb461c24Adam Hampson                                                    UINT16 ssr_min_tout, UINT16 dl_len, UINT8 *dsc_list);
2375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
2395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_load_bonded_hid_info
2415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
242ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta** Description      BTIF storage API - Loads hid info for all the bonded devices from NVRAM
243ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta**                  and adds those devices  to the BTA_HH.
2445738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if successful, BT_STATUS_FAIL otherwise
2465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2475738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
2485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_load_bonded_hid_info(void);
2495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
2515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_remove_hid_info
2535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Deletes the bonded hid device info from NVRAM
2555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the deletion was successful,
2575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
2585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
2605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_remove_hid_info(bt_bdaddr_t *remote_bd_addr);
2615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
2635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_load_autopair_device_list
2655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Populates auto pair device list
2675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the auto pair blacklist is successfully populated
2695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
2705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
2725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectbt_status_t btif_storage_load_autopair_device_list();
2735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
2755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_is_device_autopair_blacklisted
2775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API  Checks if the given device is blacklisted for auto pairing
2795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          TRUE if the device is found in the auto pair blacklist
2815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  FALSE otherwise
2825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
284ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta
285ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi BattaBOOLEAN  btif_storage_is_device_autopair_blacklisted(bt_bdaddr_t *remote_bd_addr);
2865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
2875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
2885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_add_device_to_autopair_blacklist
2905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - Add a remote device to the auto pairing blacklist
2925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          BT_STATUS_SUCCESS if the device is successfully added to the auto pair blacklist
2945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  BT_STATUS_FAIL otherwise
2955738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
2965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
297ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta
298ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_add_device_to_autopair_blacklist(bt_bdaddr_t *remote_bd_addr);
2995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
3005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/*******************************************************************************
3015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
3025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function         btif_storage_is_fixed_pin_zeros_keyboard
3035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
3045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description      BTIF storage API - checks if this device has fixed PIN key device list
3055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
3065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns          TRUE   if the device is found in the fixed pin keyboard device list
3075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**                  FALSE otherwise
3085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project**
3095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/
310ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi BattaBOOLEAN btif_storage_is_fixed_pin_zeros_keyboard(bt_bdaddr_t *remote_bd_addr);
311ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta
312ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta#if (BLE_INCLUDED == TRUE)
313ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_add_ble_bonding_key( bt_bdaddr_t *remote_bd_addr,
314ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                              char *key,
315ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                              uint8_t key_type,
316ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                              uint8_t key_length);
317ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_get_ble_bonding_key(bt_bdaddr_t *remote_bd_addr,
318ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                             UINT8 key_type,
319ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                             char *key_value,
320ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                             int key_length);
321ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta
322ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_add_ble_local_key(char *key,
323ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                           uint8_t key_type,
324ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                           uint8_t key_length);
325ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_remove_ble_bonding_keys(bt_bdaddr_t *remote_bd_addr);
326ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_remove_ble_local_keys(void);
327ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_get_ble_local_key(UINT8 key_type,
328ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                           char *key_value,
329ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                           int key_len);
330ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta
331ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_get_remote_addr_type(bt_bdaddr_t *remote_bd_addr,
332ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                              int *addr_type);
333ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta
334ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_set_remote_addr_type(bt_bdaddr_t *remote_bd_addr,
335ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                              UINT8 addr_type);
336ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta
337ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta#endif
338ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta/*******************************************************************************
339ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta**
340ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta** Function         btif_storage_get_remote_version
341ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta**
342ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta** Description      Fetch remote version info on cached remote device
343ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta**
344ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta** Returns          BT_STATUS_SUCCESS if found
345ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta**                  BT_STATUS_FAIL otherwise
346ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta**
347ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta*******************************************************************************/
3485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project
349ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Battabt_status_t btif_storage_get_remote_version(const bt_bdaddr_t *remote_bd_addr,
350ead3cde4bac0c3e32cd31f149093f004eef8ceebGanesh Ganapathi Batta                                  bt_remote_version_t *p_ver);
3517fa4fba6f59f97df00aff07dbe8fb21b114b3c2cGanesh Ganapathi Batta
3525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif /* BTIF_STORAGE_H */
353