1 /*
2  * Copyright 2021, 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 #ifndef ANDROID_HARDWARE_UWB_UWB
17 #define ANDROID_HARDWARE_UWB_UWB
18 
19 #include <map>
20 #include <vector>
21 
22 #include <aidl/android/hardware/uwb/BnUwb.h>
23 #include <aidl/android/hardware/uwb/IUwbChip.h>
24 
25 #include "uwb_chip.h"
26 
27 namespace android {
28 namespace hardware {
29 namespace uwb {
30 namespace impl {
31 using namespace ::aidl::android::hardware::uwb;
32 // Default implementation mean't to be used on simulator targets.
33 class Uwb : public BnUwb {
34   public:
35     Uwb();
36     virtual ~Uwb();
37 
38     ::ndk::ScopedAStatus getChips(std::vector<std::string>* names) override;
39     ::ndk::ScopedAStatus getChip(const std::string& name, std::shared_ptr<IUwbChip>* chip) override;
40 
41   private:
42     std::map<std::string, std::shared_ptr<UwbChip>> chips_;
43 };
44 }  // namespace impl
45 }  // namespace uwb
46 }  // namespace hardware
47 }  // namespace android
48 
49 #endif  // ANDROID_HARDWARE_UWB_UWB