mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-07-21 11:12:01 +00:00
Merge pull request #2983 from horrordash/master
fix broken iso15693.c:SendRawCommand15693 (double answers)
This commit is contained in:
+19
-16
@@ -2729,26 +2729,29 @@ void SendRawCommand15693(iso15_raw_cmd_t *packet) {
|
||||
} else {
|
||||
|
||||
// if tag answers with an error code, it don't care about EOF packet
|
||||
if (recvlen) {
|
||||
recvlen = MIN(recvlen, ISO15693_MAX_RESPONSE_LENGTH);
|
||||
reply_ng(CMD_HF_ISO15693_COMMAND, res, buf, recvlen);
|
||||
}
|
||||
// normal tag answer without Option_flag also processed here
|
||||
if (recvlen || !request_answer) {
|
||||
if (request_answer || read_respone) {
|
||||
recvlen = MIN(recvlen, ISO15693_MAX_RESPONSE_LENGTH);
|
||||
reply_ng(CMD_HF_ISO15693_COMMAND, res, buf, recvlen);
|
||||
} else {
|
||||
reply_ng(CMD_HF_ISO15693_COMMAND, PM3_SUCCESS, NULL, 0);
|
||||
}
|
||||
} else {
|
||||
// looking at the first byte of the RAW bytes to determine Subcarrier, datarate, request option
|
||||
bool fsk = ((packet->raw[0] & ISO15_REQ_SUBCARRIER_TWO) == ISO15_REQ_SUBCARRIER_TWO);
|
||||
bool recv_speed = ((packet->raw[0] & ISO15_REQ_DATARATE_HIGH) == ISO15_REQ_DATARATE_HIGH);
|
||||
|
||||
// looking at the first byte of the RAW bytes to determine Subcarrier, datarate, request option
|
||||
bool fsk = ((packet->raw[0] & ISO15_REQ_SUBCARRIER_TWO) == ISO15_REQ_SUBCARRIER_TWO);
|
||||
bool recv_speed = ((packet->raw[0] & ISO15_REQ_DATARATE_HIGH) == ISO15_REQ_DATARATE_HIGH);
|
||||
|
||||
// send a single EOF to get the tag response
|
||||
if (request_answer) {
|
||||
// send a single EOF to get the tag response
|
||||
start_time = eof_time + DELAY_ISO15693_VICC_TO_VCD_READER;
|
||||
res = SendDataTagEOF((read_respone ? buf : NULL), sizeof(buf), start_time, ISO15693_READER_TIMEOUT, &eof_time, fsk, recv_speed, &recvlen);
|
||||
}
|
||||
|
||||
if (read_respone) {
|
||||
recvlen = MIN(recvlen, ISO15693_MAX_RESPONSE_LENGTH);
|
||||
reply_ng(CMD_HF_ISO15693_COMMAND, res, buf, recvlen);
|
||||
} else {
|
||||
reply_ng(CMD_HF_ISO15693_COMMAND, PM3_SUCCESS, NULL, 0);
|
||||
if (read_respone) {
|
||||
recvlen = MIN(recvlen, ISO15693_MAX_RESPONSE_LENGTH);
|
||||
reply_ng(CMD_HF_ISO15693_COMMAND, res, buf, recvlen);
|
||||
} else {
|
||||
reply_ng(CMD_HF_ISO15693_COMMAND, PM3_SUCCESS, NULL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user