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,
__anon64ba969c0102() 31 const uint16_t*) -> bool {
32 return false;
33 },
34 .SDP_CancelServiceSearch = nullptr,
35 .SDP_ServiceSearchRequest = nullptr,
36 .SDP_ServiceSearchAttributeRequest = nullptr,
37 .SDP_ServiceSearchAttributeRequest2 = nullptr,
38 },
39 .db =
40 {
41 .SDP_FindServiceInDb = nullptr,
42 .SDP_FindServiceUUIDInDb = nullptr,
43 .SDP_FindServiceInDb_128bit = nullptr,
44 },
45 .record =
46 {
47 .SDP_FindAttributeInRec = nullptr,
48 .SDP_FindServiceUUIDInRec_128bit = nullptr,
49 .SDP_FindProtocolListElemInRec = nullptr,
50 .SDP_FindProfileVersionInRec = nullptr,
51 .SDP_FindServiceUUIDInRec = nullptr,
52 },
53 .handle =
54 {
55 .SDP_CreateRecord = nullptr,
56 .SDP_DeleteRecord = nullptr,
57 .SDP_AddAttribute = nullptr,
58 .SDP_AddSequence = nullptr,
59 .SDP_AddUuidSequence = nullptr,
60 .SDP_AddProtocolList = nullptr,
61 .SDP_AddAdditionProtoLists = nullptr,
62 .SDP_AddProfileDescriptorList = nullptr,
63 .SDP_AddLanguageBaseAttrIDList = nullptr,
64 .SDP_AddServiceClassIdList = nullptr,
65 },
66 .device_id =
67 {
68 .SDP_SetLocalDiRecord = nullptr,
69 .SDP_DiDiscover = nullptr,
70 .SDP_GetNumDiRecords = nullptr,
71 .SDP_GetDiRecord = nullptr,
72 },
73 };
74
75 } // namespace stack_sdp_legacy
76 } // namespace mock
77 } // namespace test
78
79 const struct bluetooth::legacy::stack::sdp::tSdpApi*
get_legacy_stack_sdp_api()80 bluetooth::legacy::stack::sdp::get_legacy_stack_sdp_api() {
81 return &test::mock::stack_sdp_legacy::api_;
82 }
83