1 /****************************************************************************** 2 * 3 * Copyright (c) 2016, The Linux Foundation. 4 * Copyright (C) 2014 Google, Inc. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at: 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 ******************************************************************************/ 19 20 #pragma once 21 22 #include <errno.h> 23 #include <stdbool.h> 24 25 #include "device/include/interop.h" 26 #include "device/include/interop_database.h" 27 28 typedef uint16_t UINT16; 29 30 // API's for adding entries to dynamic interop database 31 void interop_database_add_addr(const uint16_t feature, const RawAddress* addr, 32 size_t length); 33 void interop_database_add_name(const uint16_t feature, const char* name); 34 void interop_database_add_manufacturer(const interop_feature_t feature, 35 uint16_t manufacturer); 36 void interop_database_add_vndr_prdt(const interop_feature_t feature, 37 uint16_t vendor_id, uint16_t product_id); 38 void interop_database_add_addr_max_lat(const interop_feature_t feature, 39 const RawAddress* addr, 40 uint16_t max_lat); 41 void interop_database_add_version(const interop_feature_t feature, 42 uint16_t version); 43 void interop_database_add_addr_lmp_version(const interop_feature_t feature, 44 const RawAddress* addr, 45 uint8_t lmp_ver, 46 uint16_t lmp_sub_ver); 47 48 // API's for removing entries from dynamic interop database 49 bool interop_database_remove_addr(const interop_feature_t feature, 50 const RawAddress* addr); 51 bool interop_database_remove_name(const interop_feature_t feature, 52 const char* name); 53 bool interop_database_remove_manufacturer(const interop_feature_t feature, 54 uint16_t manufacturer); 55 bool interop_database_remove_vndr_prdt(const interop_feature_t feature, 56 uint16_t vendor_id, uint16_t product_id); 57 bool interop_database_remove_addr_max_lat(const interop_feature_t feature, 58 const RawAddress* addr, 59 uint16_t max_lat); 60 bool interop_database_remove_version(const interop_feature_t feature, 61 uint16_t version); 62 bool interop_database_remove_feature(const interop_feature_t feature); 63 bool interop_database_remove_addr_lmp_version(const interop_feature_t feature, 64 const RawAddress* addr, 65 uint8_t lmp_ver, 66 uint16_t lmp_sub_ver); 67 68 // API's to match entries with in dynamic interop database 69 bool interop_database_match_addr(const interop_feature_t feature, 70 const RawAddress* addr); 71 bool interop_database_match_name(const interop_feature_t feature, 72 const char* name); 73 bool interop_database_match_manufacturer(const interop_feature_t feature, 74 uint16_t manufacturer); 75 bool interop_database_match_vndr_prdt(const interop_feature_t feature, 76 uint16_t vendor_id, uint16_t product_id); 77 bool interop_database_match_addr_get_max_lat(const interop_feature_t feature, 78 const RawAddress* addr, 79 uint16_t* max_lat); 80 bool interop_database_match_version(const interop_feature_t feature, 81 uint16_t version); 82 bool interop_database_match_addr_get_lmp_ver(const interop_feature_t feature, 83 const RawAddress* addr, 84 uint8_t* lmp_ver, 85 uint16_t* lmp_sub_ver); 86 bool interop_get_allowlisted_media_players_list(list_t* p_bl_devices); 87