1 /****************************************************************************** 2 * 3 * Copyright 2014 Google, Inc. 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 #pragma once 20 21 #include <stdbool.h> 22 #include <stddef.h> 23 24 #include <list> 25 #include <string> 26 #include <vector> 27 28 #include "osi/include/config.h" 29 #include "types/ble_address_with_type.h" 30 #include "types/raw_address.h" 31 32 static const char BTIF_CONFIG_MODULE[] = "btif_config_module"; 33 34 bool btif_config_exist(const std::string& section, const std::string& key); 35 bool btif_config_get_int(const std::string& section, const std::string& key, int* value); 36 bool btif_config_set_int(const std::string& section, const std::string& key, int value); 37 bool btif_config_get_uint64(const std::string& section, const std::string& key, uint64_t* value); 38 bool btif_config_set_uint64(const std::string& section, const std::string& key, uint64_t value); 39 bool btif_config_get_str(const std::string& section, const std::string& key, char* value, 40 int* size_bytes); 41 bool btif_config_set_str(const std::string& section, const std::string& key, 42 const std::string& value); 43 bool btif_config_get_bin(const std::string& section, const std::string& key, uint8_t* value, 44 size_t* length); 45 bool btif_config_set_bin(const std::string& section, const std::string& key, const uint8_t* value, 46 size_t length); 47 bool btif_config_remove(const std::string& section, const std::string& key); 48 49 void btif_config_remove_device(const std::string& section); 50 51 void btif_config_remove_device_with_key(const std::string& key); 52 53 size_t btif_config_get_bin_length(const std::string& section, const std::string& key); 54 55 std::vector<RawAddress> btif_config_get_paired_devices(); 56 57 bool btif_config_clear(void); 58 bool btif_get_device_clockoffset(const RawAddress& bda, int* p_clock_offset); 59 bool btif_set_device_clockoffset(const RawAddress& bda, int clock_offset); 60