1 #include "android/hardware/nfc/1.0/types.vts.h"
2 #include "vts_measurement.h"
3 #include <android-base/logging.h>
4 #include <android/hidl/allocator/1.0/IAllocator.h>
5 #include <fmq/MessageQueue.h>
6 #include <sys/stat.h>
7 #include <unistd.h>
8
9
10 using namespace android::hardware::nfc::V1_0;
11 namespace android {
12 namespace vts {
MessageTo__android__hardware__nfc__V1_0__NfcEvent(const VariableSpecificationMessage & var_msg,::android::hardware::nfc::V1_0::NfcEvent * arg,const string & callback_socket_name)13 extern "C" void MessageTo__android__hardware__nfc__V1_0__NfcEvent(const VariableSpecificationMessage& var_msg __attribute__((__unused__)), ::android::hardware::nfc::V1_0::NfcEvent* arg __attribute__((__unused__)), const string& callback_socket_name __attribute__((__unused__))) {
14 *arg = (::android::hardware::nfc::V1_0::NfcEvent)var_msg.scalar_value().uint32_t();
15 }
Random__android__hardware__nfc__V1_0__NfcEvent()16 uint32_t Random__android__hardware__nfc__V1_0__NfcEvent() {
17 uint32_t choice = (uint32_t) rand() / 7;
18 if (choice == (uint32_t) 0UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::OPEN_CPLT);
19 if (choice == (uint32_t) 1UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::CLOSE_CPLT);
20 if (choice == (uint32_t) 2UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::POST_INIT_CPLT);
21 if (choice == (uint32_t) 3UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::PRE_DISCOVER_CPLT);
22 if (choice == (uint32_t) 4UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::REQUEST_CONTROL);
23 if (choice == (uint32_t) 5UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::RELEASE_CONTROL);
24 if (choice == (uint32_t) 6UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::ERROR);
25 return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::OPEN_CPLT);
26 }
Verify__android__hardware__nfc__V1_0__NfcEvent(const VariableSpecificationMessage & expected_result,const VariableSpecificationMessage & actual_result)27 bool Verify__android__hardware__nfc__V1_0__NfcEvent(const VariableSpecificationMessage& expected_result __attribute__((__unused__)), const VariableSpecificationMessage& actual_result __attribute__((__unused__))){
28 if (actual_result.scalar_value().uint32_t() != expected_result.scalar_value().uint32_t()) { return false; }
29 return true;
30 }
31
SetResult__android__hardware__nfc__V1_0__NfcEvent(VariableSpecificationMessage * result_msg,::android::hardware::nfc::V1_0::NfcEvent result_value)32 extern "C" void SetResult__android__hardware__nfc__V1_0__NfcEvent(VariableSpecificationMessage* result_msg, ::android::hardware::nfc::V1_0::NfcEvent result_value __attribute__((__unused__))){
33 result_msg->set_type(TYPE_ENUM);
34 result_msg->set_scalar_type("uint32_t");
35 result_msg->mutable_scalar_value()->set_uint32_t(static_cast<uint32_t>(result_value));
36 }
37
MessageTo__android__hardware__nfc__V1_0__NfcStatus(const VariableSpecificationMessage & var_msg,::android::hardware::nfc::V1_0::NfcStatus * arg,const string & callback_socket_name)38 extern "C" void MessageTo__android__hardware__nfc__V1_0__NfcStatus(const VariableSpecificationMessage& var_msg __attribute__((__unused__)), ::android::hardware::nfc::V1_0::NfcStatus* arg __attribute__((__unused__)), const string& callback_socket_name __attribute__((__unused__))) {
39 *arg = (::android::hardware::nfc::V1_0::NfcStatus)var_msg.scalar_value().uint32_t();
40 }
Random__android__hardware__nfc__V1_0__NfcStatus()41 uint32_t Random__android__hardware__nfc__V1_0__NfcStatus() {
42 uint32_t choice = (uint32_t) rand() / 5;
43 if (choice == (uint32_t) 0UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::OK);
44 if (choice == (uint32_t) 1UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::FAILED);
45 if (choice == (uint32_t) 2UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::ERR_TRANSPORT);
46 if (choice == (uint32_t) 3UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::ERR_CMD_TIMEOUT);
47 if (choice == (uint32_t) 4UL) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::REFUSED);
48 return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::OK);
49 }
Verify__android__hardware__nfc__V1_0__NfcStatus(const VariableSpecificationMessage & expected_result,const VariableSpecificationMessage & actual_result)50 bool Verify__android__hardware__nfc__V1_0__NfcStatus(const VariableSpecificationMessage& expected_result __attribute__((__unused__)), const VariableSpecificationMessage& actual_result __attribute__((__unused__))){
51 if (actual_result.scalar_value().uint32_t() != expected_result.scalar_value().uint32_t()) { return false; }
52 return true;
53 }
54
SetResult__android__hardware__nfc__V1_0__NfcStatus(VariableSpecificationMessage * result_msg,::android::hardware::nfc::V1_0::NfcStatus result_value)55 extern "C" void SetResult__android__hardware__nfc__V1_0__NfcStatus(VariableSpecificationMessage* result_msg, ::android::hardware::nfc::V1_0::NfcStatus result_value __attribute__((__unused__))){
56 result_msg->set_type(TYPE_ENUM);
57 result_msg->set_scalar_type("uint32_t");
58 result_msg->mutable_scalar_value()->set_uint32_t(static_cast<uint32_t>(result_value));
59 }
60
61 } // namespace vts
62 } // namespace android
63