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 <stdbool.h>
23 
24 #include "device/include/interop.h"
25 
26 typedef uint16_t UINT16;
27 
28 // API's for adding entries to dynamic interop database
29 void interop_database_add_addr(const uint16_t feature, const RawAddress* addr, size_t length);
30 void interop_database_add_name(const uint16_t feature, const char* name);
31 void interop_database_add_manufacturer(const interop_feature_t feature, uint16_t manufacturer);
32 void interop_database_add_vndr_prdt(const interop_feature_t feature, uint16_t vendor_id,
33                                     uint16_t product_id);
34 void interop_database_add_addr_max_lat(const interop_feature_t feature, const RawAddress* addr,
35                                        uint16_t max_lat);
36 void interop_database_add_version(const interop_feature_t feature, uint16_t version);
37 void interop_database_add_addr_lmp_version(const interop_feature_t feature, const RawAddress* addr,
38                                            uint8_t lmp_ver, uint16_t lmp_sub_ver);
39 
40 // API's for removing entries from dynamic interop database
41 bool interop_database_remove_addr(const interop_feature_t feature, const RawAddress* addr);
42 bool interop_database_remove_name(const interop_feature_t feature, const char* name);
43 bool interop_database_remove_manufacturer(const interop_feature_t feature, uint16_t manufacturer);
44 bool interop_database_remove_vndr_prdt(const interop_feature_t feature, uint16_t vendor_id,
45                                        uint16_t product_id);
46 bool interop_database_remove_addr_max_lat(const interop_feature_t feature, const RawAddress* addr,
47                                           uint16_t max_lat);
48 bool interop_database_remove_version(const interop_feature_t feature, uint16_t version);
49 bool interop_database_remove_feature(const interop_feature_t feature);
50 bool interop_database_remove_addr_lmp_version(const interop_feature_t feature,
51                                               const RawAddress* addr, uint8_t lmp_ver,
52                                               uint16_t lmp_sub_ver);
53 
54 // API's to match entries with in dynamic interop database
55 bool interop_database_match_addr(const interop_feature_t feature, const RawAddress* addr);
56 bool interop_database_match_name(const interop_feature_t feature, const char* name);
57 bool interop_database_match_manufacturer(const interop_feature_t feature, uint16_t manufacturer);
58 bool interop_database_match_vndr_prdt(const interop_feature_t feature, uint16_t vendor_id,
59                                       uint16_t product_id);
60 bool interop_database_match_addr_get_max_lat(const interop_feature_t feature,
61                                              const RawAddress* addr, uint16_t* max_lat);
62 bool interop_database_match_version(const interop_feature_t feature, uint16_t version);
63 bool interop_database_match_addr_get_lmp_ver(const interop_feature_t feature,
64                                              const RawAddress* addr, uint8_t* lmp_ver,
65                                              uint16_t* lmp_sub_ver);
66