blob: e900cbe12311843de8d8bb2d0ab4c201d803a407 [file] [log] [blame]
Sam Wu63bcd882023-04-07 18:35:20 +00001/*
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
25namespace android {
26namespace hardware {
27namespace uwb {
28namespace impl {
29using namespace ::aidl::android::hardware::uwb;
30// Default implementation mean't to be used on simulator targets.
31class 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;
40 ::ndk::ScopedAStatus sessionInit(int sesionId) override;
41 ::ndk::ScopedAStatus getSupportedAndroidUciVersion(int32_t* version) override;
42 ::ndk::ScopedAStatus sendUciMessage(const std::vector<uint8_t>& data,
43 int32_t* bytes_written) override;
44
45 private:
46 std::string name_;
47 std::shared_ptr<IUwbClientCallback> mClientCallback;
48};
49} // namespace impl
50} // namespace uwb
51} // namespace hardware
52} // namespace android
53
54#endif // ANDROID_HARDWARE_UWB_UWBCHIP