1 /****************************************************************************** 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> 32 extern "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 50 int btif_config_init(); 51 52 int btif_config_exist(const char* section, const char* key, const char* name); 53 int btif_config_get_int(const char* section, const char* key, const char* name, int* value); 54 int btif_config_set_int(const char* section, const char* key, const char* name, int value); 55 int btif_config_get_str(const char* section, const char* key, const char* name, char* value, int* bytes); 56 int btif_config_set_str(const char* section, const char* key, const char* name, const char* value); 57 58 int btif_config_get(const char* section, const char* key, const char* name, char* value, int* bytes, int* type); 59 int btif_config_set(const char* section, const char* key, const char* name, const char* value, int bytes, int type); 60 61 int btif_config_remove(const char* section, const char* key, const char* name); 62 int btif_config_filter_remove(const char* section, const char* filter[], int filter_count, int max_allowed); 63 64 short btif_config_next_key(short current_key_pos, const char* section, char * key_name, int* key_name_bytes); 65 short btif_config_next_value(short pos, const char* section, const char* key, char* value_name, int* value_name_bytes); 66 67 typedef 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); 69 int btif_config_enum(btif_config_enum_callback cb, void* user_data); 70 71 int btif_config_save(); 72 void btif_config_flush(); 73 74 #ifdef __cplusplus 75 } 76 #endif 77 78 #endif 79