From 36be4d955612760dd2b992b325e249197a92b685 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 15 Jan 2024 01:14:58 +0100 Subject: [PATCH] text and style for comparing --- armsrc/iso15693.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index 9c566c48f..403eac546 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -2452,9 +2452,14 @@ void SendRawCommand15693(iso15_raw_cmd_t *packet) { bool read_respone = ((packet->flags & ISO15_READ_RESPONSE) == ISO15_READ_RESPONSE); bool init = ((packet->flags & ISO15_CONNECT) == ISO15_CONNECT); - // This isn't part of the RAW FLAGS from the client. // This is part of ISO15693 protocol definitions where the following commands needs to request option. + // note: + // it seem like previous we just guessed and never followed the fISO145_REQ_OPTION flag if it was set / not set from client side. + // this is a problem. Since without this the response from the tag is one byte shorter. And a lot of client side functions has been + // hardcoded to assume for the extra byte in the response. + bool request_answer = false; + switch (packet->raw[1]) { case ISO15693_SET_PASSWORD: case ISO15693_ENABLE_PRIVACY: @@ -2486,8 +2491,8 @@ void SendRawCommand15693(iso15_raw_cmd_t *packet) { } 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; - bool recv_speed = packet->raw[0] & ISO15_REQ_DATARATE_HIGH; + 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) { @@ -2503,8 +2508,6 @@ void SendRawCommand15693(iso15_raw_cmd_t *packet) { } } - // note: this prevents using hf 15 cmd with s option - which isn't implemented yet anyway - if (keep_field_on == false) { switch_off(); // disconnect raw SpinDelay(20);