blob: 75a1ac369f8aaa10f608d18bcdf4414cc670a7aa [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
3 * Copyright (C) 2009-2012 Broadcom Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18
19/*******************************************************************************
20 *
21 * Filename: btif_config.h
22 *
23 * Description: Bluetooth configuration Interface
24 *
25 *******************************************************************************/
26
27#ifndef BTIF_CONFIG_H
28#define BTIF_CONFIG_H
29
30#ifdef __cplusplus
31#include <stdint.h>
32extern "C" {
33#endif
34
35/*******************************************************************************
36** Constants & Macros
37********************************************************************************/
38
39#define BTIF_CFG_TYPE_INVALID 0
40#define BTIF_CFG_TYPE_STR 1
41#define BTIF_CFG_TYPE_INT (1 << 1)
42#define BTIF_CFG_TYPE_BIN (1 << 2)
43#define BTIF_CFG_TYPE_VOLATILE (1 << 15)
44
45
46/*******************************************************************************
47** Functions
48********************************************************************************/
49
50int btif_config_init();
51
52int btif_config_exist(const char* section, const char* key, const char* name);
53int btif_config_get_int(const char* section, const char* key, const char* name, int* value);
54int btif_config_set_int(const char* section, const char* key, const char* name, int value);
55int btif_config_get_str(const char* section, const char* key, const char* name, char* value, int* bytes);
56int btif_config_set_str(const char* section, const char* key, const char* name, const char* value);
57
58int btif_config_get(const char* section, const char* key, const char* name, char* value, int* bytes, int* type);
59int btif_config_set(const char* section, const char* key, const char* name, const char* value, int bytes, int type);
60
61int btif_config_remove(const char* section, const char* key, const char* name);
zzy7939ed02013-09-27 17:05:37 -070062int btif_config_filter_remove(const char* section, const char* filter[], int filter_count, int max_allowed);
The Android Open Source Project5738f832012-12-12 16:00:35 -080063
64short btif_config_next_key(short current_key_pos, const char* section, char * key_name, int* key_name_bytes);
65short btif_config_next_value(short pos, const char* section, const char* key, char* value_name, int* value_name_bytes);
66
67typedef void (*btif_config_enum_callback)(void* user_data, const char* section, const char* key, const char* name,
68 const char* value, int bytes, int type);
69int btif_config_enum(btif_config_enum_callback cb, void* user_data);
70
71int btif_config_save();
72void btif_config_flush();
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif