1 #ifndef __VTS_DRIVER__android_hardware_nfc_V1_0_INfcClientCallback__
2 #define __VTS_DRIVER__android_hardware_nfc_V1_0_INfcClientCallback__
3 
4 #undef LOG_TAG
5 #define LOG_TAG "FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback"
6 
7 #include <log/log.h>
8 #include <stdarg.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
12 
13 #include <driver_base/DriverBase.h>
14 #include <driver_base/DriverCallbackBase.h>
15 
16 #include <VtsDriverCommUtil.h>
17 
18 #include <android/hardware/nfc/1.0/INfcClientCallback.h>
19 #include <hidl/HidlSupport.h>
20 #include <android/hardware/nfc/1.0/types.h>
21 #include <android/hardware/nfc/1.0/types.vts.h>
22 #include <android/hidl/base/1.0/types.h>
23 
24 
25 using namespace android::hardware::nfc::V1_0;
26 namespace android {
27 namespace vts {
28 
29 class Vts_android_hardware_nfc_V1_0_INfcClientCallback : public ::android::hardware::nfc::V1_0::INfcClientCallback, public DriverCallbackBase {
30  public:
Vts_android_hardware_nfc_V1_0_INfcClientCallback(const string & callback_socket_name)31     Vts_android_hardware_nfc_V1_0_INfcClientCallback(const string& callback_socket_name)
32         : callback_socket_name_(callback_socket_name) {};
33 
34     virtual ~Vts_android_hardware_nfc_V1_0_INfcClientCallback() = default;
35 
36     ::android::hardware::Return<void> sendEvent(
37         ::android::hardware::nfc::V1_0::NfcEvent arg0,
38         ::android::hardware::nfc::V1_0::NfcStatus arg1) override;
39 
40     ::android::hardware::Return<void> sendData(
41         const ::android::hardware::hidl_vec<uint8_t>& arg0) override;
42 
43 
44  private:
45     string callback_socket_name_;
46 };
47 
48 sp<::android::hardware::nfc::V1_0::INfcClientCallback> VtsFuzzerCreateVts_android_hardware_nfc_V1_0_INfcClientCallback(const string& callback_socket_name);
49 
50 class FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback : public DriverBase {
51  public:
FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback()52     FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback() : DriverBase(HAL_HIDL), hw_binder_proxy_() {}
53 
FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback(::android::hardware::nfc::V1_0::INfcClientCallback * hw_binder_proxy)54     explicit FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback(::android::hardware::nfc::V1_0::INfcClientCallback* hw_binder_proxy) : DriverBase(HAL_HIDL), hw_binder_proxy_(hw_binder_proxy) {}
GetHidlInterfaceProxy()55     uint64_t GetHidlInterfaceProxy() const {
56         return reinterpret_cast<uintptr_t>(hw_binder_proxy_.get());
57     }
58  protected:
59     bool Fuzz(FunctionSpecificationMessage* func_msg, void** result, const string& callback_socket_name);
60     bool CallFunction(const FunctionSpecificationMessage& func_msg, const string& callback_socket_name, FunctionSpecificationMessage* result_msg);
61     bool VerifyResults(const FunctionSpecificationMessage& expected_result, const FunctionSpecificationMessage& actual_result);
62     bool GetAttribute(FunctionSpecificationMessage* func_msg, void** result);
63     bool GetService(bool get_stub, const char* service_name);
64 
65  private:
66     sp<::android::hardware::nfc::V1_0::INfcClientCallback> hw_binder_proxy_;
67 };
68 
69 
70 extern "C" {
71 extern android::vts::DriverBase* vts_func_4_android_hardware_nfc_V1_0_INfcClientCallback_();
72 extern android::vts::DriverBase* vts_func_4_android_hardware_nfc_V1_0_INfcClientCallback_with_arg(uint64_t hw_binder_proxy);
73 }
74 }  // namespace vts
75 }  // namespace android
76 #endif
77