Merge pull request #2572 from douniwan5788/hitag1comp

fix: switch Hitag S UID REQUEST to HITAGS_UID_REQ_ADV1 for Hitag 1 co…
This commit is contained in:
Iceman 2024-10-15 13:47:28 +02:00 committed by GitHub
commit e9445851e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -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;
@ -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);
@ -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 };

View file

@ -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