Skip to content

Commit

Permalink
fix: switch Hitag S UID REQUEST to HITAGS_UID_REQ_ADV1 for Hitag 1 co…
Browse files Browse the repository at this point in the history
…mpatibility
  • Loading branch information
douniwan5788 committed Oct 15, 2024
1 parent bb3d36b commit 252d6a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions armsrc/hitagS.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ static void hts_handle_reader_command(uint8_t *rx, const size_t rxlen,
m = AC2K;
}

if (rx[0] == HITAGS_UID_REQ_ADV) {
if (rx[0] == HITAGS_UID_REQ_ADV1 || rx[0] == HITAGS_UID_REQ_ADV2) {
DBG Dbprintf("HT_ADVANCED");
tag.mode = HT_ADVANCED;
sof_bits = 3;
Expand Down Expand Up @@ -1112,7 +1112,7 @@ static int hts_select_tag(const lf_hitag_data_t *packet, uint8_t *tx, size_t siz
// UID request FAdvanced 11010
size_t txlen = 0;
size_t rxlen = 0;
uint8_t cmd = HITAGS_UID_REQ_ADV;
uint8_t cmd = HITAGS_UID_REQ_ADV1;
txlen = concatbits(tx, txlen, &cmd, 0, 5);
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, t_wait, ledcontrol, true);

Expand Down Expand Up @@ -1505,7 +1505,7 @@ int hts_read_uid(uint32_t *uid, bool ledcontrol, bool send_answer) {
// UID request standard 00110
// UID request Advanced 1100x
// UID request FAdvanced 11010
uint8_t cmd = HITAGS_UID_REQ_ADV;
uint8_t cmd = HITAGS_UID_REQ_ADV1;

size_t rxlen = 0;
uint8_t rx[HITAG_FRAME_LEN] = { 0x00 };
Expand Down
4 changes: 2 additions & 2 deletions include/protocols.h
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,8 @@ ISO 7816-4 Basic interindustry commands. For command APDU's.

// HITAG S commands
#define HITAGS_UID_REQ_STD 0x30 // 00110 UID REQUEST Std
#define HITAGS_UID_REQ_ADV 0xC0 // 11000 UID REQUEST Adv
#define HITAGS_UID_REQ_ADV2 0xC8 // 11001 UID REQUEST Adv
#define HITAGS_UID_REQ_ADV2 0xC0 // 11000 UID REQUEST Adv compatible with HITAG2_START_AUTH
#define HITAGS_UID_REQ_ADV1 0xC8 // 11001 UID REQUEST Adv compatible with HITAG1_SET_CCNEW
#define HITAGS_UID_REQ_FADV 0xD0 // 11010 UID REQUEST FAdv
#define HITAGS_SELECT 0x00 // 00000 SELECT (UID)
#define HITAGS_READ_PAGE 0xC0 // 1100 READ PAGE
Expand Down

0 comments on commit 252d6a2

Please sign in to comment.