diff --git a/nfc/1.1/vts/functional/VtsHalNfcV1_1TargetTest.cpp b/nfc/1.1/vts/functional/VtsHalNfcV1_1TargetTest.cpp index bef412b6c2..0b7c88bbc2 100644 --- a/nfc/1.1/vts/functional/VtsHalNfcV1_1TargetTest.cpp +++ b/nfc/1.1/vts/functional/VtsHalNfcV1_1TargetTest.cpp @@ -30,6 +30,7 @@ using ::android::hardware::nfc::V1_1::INfc; using ::android::hardware::nfc::V1_1::INfcClientCallback; using ::android::hardware::nfc::V1_1::NfcEvent; +using ::android::hardware::nfc::V1_1::NfcConfig; using ::android::hardware::nfc::V1_0::NfcStatus; using ::android::hardware::nfc::V1_0::NfcData; using ::android::hardware::Return; @@ -37,6 +38,9 @@ using ::android::hardware::Void; using ::android::hardware::hidl_vec; using ::android::sp; +// 261 bytes is the default and minimum transceive length +constexpr unsigned int MIN_ISO_DEP_TRANSCEIVE_LENGTH = 261; + constexpr char kCallbackNameSendEvent[] = "sendEvent"; constexpr char kCallbackNameSendData[] = "sendData"; @@ -209,6 +213,17 @@ TEST_F(NfcHidlTest, CloseForPowerCaseOffAfterClose) { EXPECT_EQ(NfcStatus::OK, res.args->last_status_); } +/* + * getConfig: + * Calls getConfig() + * checks if fields in NfcConfig are populated correctly + */ +TEST_F(NfcHidlTest, GetConfig) { + nfc_->getConfig([](NfcConfig config) { + EXPECT_GE(config.maxIsoDepTransceiveLength, MIN_ISO_DEP_TRANSCEIVE_LENGTH); + }); +} + int main(int argc, char** argv) { ::testing::AddGlobalTestEnvironment(NfcHidlEnvironment::Instance()); ::testing::InitGoogleTest(&argc, argv);