hitag: stop detecting if response header is corrupted

This commit is contained in:
Philippe Teuwen 2020-01-16 00:26:15 +01:00
parent 7a27f5dddb
commit 9df6fa8e8e

View file

@ -1528,11 +1528,14 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) {
//Dbprintf("Detected unexpected number of manchester decoded samples [%d]", nrzs); //Dbprintf("Detected unexpected number of manchester decoded samples [%d]", nrzs);
break; break;
} else { } else {
for (size_t i = 0; i < 5; i++) { size_t i;
for (i = 0; i < 5; i++) {
if (nrz_samples[i] != 1) { if (nrz_samples[i] != 1) {
Dbprintf("Detected incorrect header, the bit [%d] is zero instead of one", i); Dbprintf("Detected incorrect header, the bit [%d] is zero instead of one, abort", i);
break;
} }
} }
if (i < 5) break;
} }
// Pack the response into a byte array // Pack the response into a byte array