EndOfTransmissionTimestamp = timestamp + duration;
if (protocol == PROTO_MIFARE)
- annotateMifare(explanation, sizeof(explanation), frame, data_len, isResponse);
+ annotateMifare(explanation, sizeof(explanation), frame, data_len, parityBytes, parity_len, isResponse);
if(!isResponse)
{
(j == num_lines-1) ? explanation : "");
}
}
+
+// if (DecodeMifareData(frame, data_len, isResponse)) {
+// };
if (is_last_record(tracepos, trace, traceLen)) return traceLen;
return;
}
-void annotateMifare(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize, bool isResponse) {
+void annotateMifare(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize, uint8_t* parity, uint8_t paritysize, bool isResponse) {
// get UID
if (MifareAuthState == masNone) {
if (cmdsize == 7 && cmd[0] == ISO14443A_CMD_ANTICOLL_OR_SELECT && cmd[1] == 0x70) {
AuthData.nt = bytes_to_num(cmd, cmdsize);
else
AuthData.nt_enc = bytes_to_num(cmd, cmdsize);
+ AuthData.nt_enc_par = parity[0];
return;
} else {
MifareAuthState = masError;
MifareAuthState = masAt;
AuthData.nr_enc = bytes_to_num(cmd, cmdsize);
AuthData.ar_enc = bytes_to_num(&cmd[3], cmdsize);
+ AuthData.ar_enc_par = parity[0] << 4;
return;
} else {
MifareAuthState = masError;
snprintf(exp,size,"AUTH: at (enc)");
MifareAuthState = masFirstData;
AuthData.at_enc = bytes_to_num(cmd, cmdsize);
+ AuthData.at_enc_par = parity[0];
return;
} else {
MifareAuthState = masError;
extern uint8_t iso14443A_CRC_check(bool isResponse, uint8_t* data, uint8_t len);
extern uint8_t mifare_CRC_check(bool isResponse, uint8_t* data, uint8_t len);
extern void annotateIso14443a(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize);
-extern void annotateMifare(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize, bool isResponse);
+extern void annotateMifare(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize, uint8_t* parity, uint8_t paritysize, bool isResponse);
#endif // CMDHFLIST