blob: e900cbe12311843de8d8bb2d0ab4c201d803a407 [file] [log] [blame]
Roshan Pius80c3cc62021-08-27 12:55:02 -07001/*
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;
Roshan Piusf2c29392021-12-09 10:18:39 -080040 ::ndk::ScopedAStatus sessionInit(int sesionId) override;
Roshan Pius1e1c8422021-11-04 12:59:07 -070041 ::ndk::ScopedAStatus getSupportedAndroidUciVersion(int32_t* version) override;
Roshan Pius80c3cc62021-08-27 12:55:02 -070042 ::ndk::ScopedAStatus sendUciMessage(const std::vector<uint8_t>& data,
43 int32_t* bytes_written) override;
44
45 private:
46 std::string name_;
Roshan Pius90f51712021-09-21 11:09:12 -070047 std::shared_ptr<IUwbClientCallback> mClientCallback;
Roshan Pius80c3cc62021-08-27 12:55:02 -070048};
49} // namespace impl
50} // namespace uwb
51} // namespace hardware
52} // namespace android
53
54#endif // ANDROID_HARDWARE_UWB_UWBCHIP