Roshan Pius | 80c3cc6 | 2021-08-27 12:55:02 -0700 | [diff] [blame] | 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 | |
| 17 | #ifndef ANDROID_HARDWARE_UWB_UWBCHIP |
| 18 | #define ANDROID_HARDWARE_UWB_UWBCHIP |
| 19 | |
| 20 | #include <vector> |
| 21 | |
| 22 | #include <aidl/android/hardware/uwb/BnUwbChip.h> |
| 23 | #include <aidl/android/hardware/uwb/IUwbClientCallback.h> |
| 24 | |
| 25 | namespace android { |
| 26 | namespace hardware { |
| 27 | namespace uwb { |
| 28 | namespace impl { |
| 29 | using namespace ::aidl::android::hardware::uwb; |
| 30 | // Default implementation mean't to be used on simulator targets. |
| 31 | class UwbChip : public BnUwbChip { |
| 32 | public: |
| 33 | UwbChip(const std::string& name); |
| 34 | virtual ~UwbChip(); |
| 35 | |
| 36 | ::ndk::ScopedAStatus getName(std::string* name) override; |
| 37 | ::ndk::ScopedAStatus open(const std::shared_ptr<IUwbClientCallback>& clientCallback) override; |
| 38 | ::ndk::ScopedAStatus close() override; |
| 39 | ::ndk::ScopedAStatus coreInit() override; |
Roshan Pius | f2c2939 | 2021-12-09 10:18:39 -0800 | [diff] [blame] | 40 | ::ndk::ScopedAStatus sessionInit(int sesionId) override; |
Roshan Pius | 1e1c842 | 2021-11-04 12:59:07 -0700 | [diff] [blame] | 41 | ::ndk::ScopedAStatus getSupportedAndroidUciVersion(int32_t* version) override; |
Roshan Pius | 80c3cc6 | 2021-08-27 12:55:02 -0700 | [diff] [blame] | 42 | ::ndk::ScopedAStatus sendUciMessage(const std::vector<uint8_t>& data, |
| 43 | int32_t* bytes_written) override; |
| 44 | |
| 45 | private: |
| 46 | std::string name_; |
Roshan Pius | 90f5171 | 2021-09-21 11:09:12 -0700 | [diff] [blame] | 47 | std::shared_ptr<IUwbClientCallback> mClientCallback; |
Roshan Pius | 80c3cc6 | 2021-08-27 12:55:02 -0700 | [diff] [blame] | 48 | }; |
| 49 | } // namespace impl |
| 50 | } // namespace uwb |
| 51 | } // namespace hardware |
| 52 | } // namespace android |
| 53 | |
| 54 | #endif // ANDROID_HARDWARE_UWB_UWBCHIP |