File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
applications/debug/unit_tests/nfc Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -203,10 +203,21 @@ static void mf_ultralight_reader_test(const char* path) {
203203 NfcDevice * nfc_device = nfc_device_alloc ();
204204 mu_assert (nfc_device_load (nfc_device , path ), "nfc_device_load() failed\r\n" );
205205
206- NfcListener * mfu_listener = nfc_listener_alloc (
207- listener ,
208- NfcProtocolMfUltralight ,
209- nfc_device_get_data (nfc_device , NfcProtocolMfUltralight ));
206+ MfUltralightData * data =
207+ (MfUltralightData * )nfc_device_get_data (nfc_device , NfcProtocolMfUltralight );
208+
209+ uint32_t features = mf_ultralight_get_feature_support_set (data -> type );
210+ bool pwd_supported =
211+ mf_ultralight_support_feature (features , MfUltralightFeatureSupportPasswordAuth );
212+ uint8_t pwd_num = mf_ultralight_get_pwd_page_num (data -> type );
213+ const uint8_t zero_pwd [4 ] = {0 , 0 , 0 , 0 };
214+
215+ if (pwd_supported && !memcmp (data -> page [pwd_num ].data , zero_pwd , sizeof (zero_pwd ))) {
216+ data -> pages_read -= 2 ;
217+ }
218+
219+ NfcListener * mfu_listener = nfc_listener_alloc (listener , NfcProtocolMfUltralight , data );
220+
210221 nfc_listener_start (mfu_listener , NULL , NULL );
211222
212223 MfUltralightData * mfu_data = mf_ultralight_alloc ();
You can’t perform that action at this time.
0 commit comments