1 /******************************************************************************
2  *
3  *  Copyright 2020 NXP
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 #ifndef ANDROID_HARDWARE_WEAVER_V1_0_WEAVER_H
19 #define ANDROID_HARDWARE_WEAVER_V1_0_WEAVER_H
20 
21 #include <android/hardware/weaver/1.0/IWeaver.h>
22 #include <android/hardware/weaver/1.0/types.h>
23 #include <hardware/hardware.h>
24 #include <hidl/MQDescriptor.h>
25 #include <hidl/Status.h>
26 #include <android-base/stringprintf.h>
27 
28 namespace android {
29 namespace hardware {
30 namespace weaver {
31 namespace V1_0 {
32 namespace implementation {
33 
34 using android::hardware::weaver::V1_0::IWeaver;
35 using ::android::hidl::base::V1_0::IBase;
36 using ::android::hardware::hidl_array;
37 using ::android::hardware::hidl_memory;
38 using ::android::hardware::hidl_string;
39 using ::android::hardware::hidl_vec;
40 using ::android::hardware::Return;
41 using ::android::hardware::Void;
42 using ::android::sp;
43 using android::base::StringPrintf;
44 
45 struct Weaver : public IWeaver, public hidl_death_recipient {
46   Weaver();
47   Return<void>
48     getConfig(getConfig_cb _hidl_cb) override;
49 
50   Return<::android::hardware::weaver::V1_0::WeaverStatus>
51    write(uint32_t slotId, const hidl_vec<uint8_t>& key, const hidl_vec<uint8_t>& value) override;
52   Return<void>
53   read(uint32_t slotId, const hidl_vec<uint8_t>& key, read_cb _hidl_cb) override;
54 
55   void serviceDied(uint64_t /*cookie*/, const wp<IBase>& /*who*/);
56 };
57 
58 }  // namespace implementation
59 }  // namespace V1_0
60 }  // namespace weaver
61 }  // namespace hardware
62 }  // namespace android
63 
64 #endif  // ANDROID_HARDWARE_WEAVER_V1_0_WEAVER_H
65