1 /*
2  * Copyright 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <cstdint>
18 
19 #include "stack/include/sdp_api.h"
20 #include "types/bluetooth/uuid.h"
21 
22 namespace test {
23 namespace mock {
24 namespace stack_sdp_legacy {
25 
26 bluetooth::legacy::stack::sdp::tSdpApi api_ = {
27         .service =
28                 {
29                         .SDP_InitDiscoveryDb = [](tSDP_DISCOVERY_DB*, uint32_t, uint16_t,
30                                                   const bluetooth::Uuid*, uint16_t,
__anon7da8f7d20102() 31                                                   const uint16_t*) -> bool { return false; },
32                         .SDP_CancelServiceSearch = nullptr,
33                         .SDP_ServiceSearchRequest = nullptr,
34                         .SDP_ServiceSearchAttributeRequest = nullptr,
35                         .SDP_ServiceSearchAttributeRequest2 = nullptr,
36                 },
37         .db =
38                 {
39                         .SDP_FindServiceInDb = nullptr,
40                         .SDP_FindServiceUUIDInDb = nullptr,
41                         .SDP_FindServiceInDb_128bit = nullptr,
42                 },
43         .record =
44                 {
45                         .SDP_FindAttributeInRec = nullptr,
46                         .SDP_FindServiceUUIDInRec_128bit = nullptr,
47                         .SDP_FindProtocolListElemInRec = nullptr,
48                         .SDP_FindProfileVersionInRec = nullptr,
49                         .SDP_FindServiceUUIDInRec = nullptr,
50                 },
51         .handle =
52                 {
53                         .SDP_CreateRecord = nullptr,
54                         .SDP_DeleteRecord = nullptr,
55                         .SDP_AddAttribute = nullptr,
56                         .SDP_AddSequence = nullptr,
57                         .SDP_AddUuidSequence = nullptr,
58                         .SDP_AddProtocolList = nullptr,
59                         .SDP_AddAdditionProtoLists = nullptr,
60                         .SDP_AddProfileDescriptorList = nullptr,
61                         .SDP_AddLanguageBaseAttrIDList = nullptr,
62                         .SDP_AddServiceClassIdList = nullptr,
63                 },
64         .device_id =
65                 {
66                         .SDP_SetLocalDiRecord = nullptr,
67                         .SDP_DiDiscover = nullptr,
68                         .SDP_GetNumDiRecords = nullptr,
69                         .SDP_GetDiRecord = nullptr,
70                 },
71 };
72 
73 }  // namespace stack_sdp_legacy
74 }  // namespace mock
75 }  // namespace test
76 
77 const struct bluetooth::legacy::stack::sdp::tSdpApi*
get_legacy_stack_sdp_api()78 bluetooth::legacy::stack::sdp::get_legacy_stack_sdp_api() {
79   return &test::mock::stack_sdp_legacy::api_;
80 }
81