fix support for waveshare 1.54

This commit is contained in:
Philippe Teuwen 2020-10-19 15:48:45 +02:00
commit f1d39f7e53
2 changed files with 21 additions and 4 deletions

View file

@ -1681,10 +1681,16 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
} }
getTagLabel(card.uid[0], card.uid[1]); getTagLabel(card.uid[0], card.uid[1]);
break; break;
case 0x57: // Qualcomm case 0x46:
if (memcmp(card.uid, "FSTN10m", 7) == 0) {
isMifareClassic = false;
printTag("Waveshare NFC-Powered e-Paper 1.54\" (please disregard MANUFACTURER mapping above)");
}
break;
case 0x57:
if (memcmp(card.uid, "WSDZ10m", 7) == 0) { if (memcmp(card.uid, "WSDZ10m", 7) == 0) {
isMifareClassic = false; isMifareClassic = false;
printTag("Waveshare NFC-Powered e-Paper"); printTag("Waveshare NFC-Powered e-Paper (please disregard MANUFACTURER mapping above)");
} }
break; break;
default: default:

View file

@ -693,11 +693,21 @@ static int start_drawing(uint8_t model_nr, uint8_t *black, uint8_t *red) {
return PM3_ESOFT; return PM3_ESOFT;
} }
if ((card.uidlen != 7) || (memcmp(card.uid, "WSDZ10m", 7) != 0)) { if ((card.uidlen != 7) || ((memcmp(card.uid, "FSTN10m", 7) != 0) && (memcmp(card.uid, "WSDZ10m", 7) != 0))) {
PrintAndLogEx(WARNING, "Card doesn't look like Waveshare tag"); PrintAndLogEx(WARNING, "Card doesn't look like Waveshare tag");
DropField(); DropField();
return PM3_ESOFT; return PM3_ESOFT;
} }
if (((model_nr != M1in54B) && (memcmp(card.uid, "FSTN10m", 7) == 0))) {
PrintAndLogEx(WARNING, "Card is a Waveshare tag 1.54\", not %s", models[model_nr].desc);
DropField();
return PM3_ESOFT;
}
if (((model_nr == M1in54B) && (memcmp(card.uid, "FSTN10m", 7) != 0))) {
PrintAndLogEx(WARNING, "Card is not a Waveshare tag 1.54\", check your model number");
DropField();
return PM3_ESOFT;
}
PrintAndLogEx(DEBUG, "model_nr = %d", model_nr); PrintAndLogEx(DEBUG, "model_nr = %d", model_nr);
int ret; int ret;
PrintAndLogEx(DEBUG, "Step0"); PrintAndLogEx(DEBUG, "Step0");
@ -921,6 +931,7 @@ static int start_drawing(uint8_t model_nr, uint8_t *black, uint8_t *red) {
msleep(200); msleep(200);
} }
PrintAndLogEx(DEBUG, "Step11: Wait tag to be ready"); PrintAndLogEx(DEBUG, "Step11: Wait tag to be ready");
PrintAndLogEx(INPLACE, "E-paper Reflashing, Waiting");
if (model_nr == M2in13B || model_nr == M1in54B) { // Black, white and red screen refresh time is longer, wait first if (model_nr == M2in13B || model_nr == M1in54B) { // Black, white and red screen refresh time is longer, wait first
msleep(9000); msleep(9000);
} else if (model_nr == M7in5HD) { } else if (model_nr == M7in5HD) {
@ -950,7 +961,7 @@ static int start_drawing(uint8_t model_nr, uint8_t *black, uint8_t *red) {
} else { } else {
fail_num++; fail_num++;
PrintAndLogEx(INPLACE, "E-paper Reflashing, Waiting"); PrintAndLogEx(INPLACE, "E-paper Reflashing, Waiting");
msleep(100); msleep(400);
} }
} }
} }