replaced hardcoded values

This commit is contained in:
tharexde 2020-12-16 20:44:04 +01:00
parent ffd1fe1dde
commit daaa3578ec

View file

@ -45,6 +45,7 @@
#define EM4X50_TAG_TOLERANCE 8
#define EM4X50_TAG_WORD 45
#define EM4X50_TAG_MAX_NO_BYTES 136
#define EM4X50_COMMAND_LOGIN 0x01
#define EM4X50_COMMAND_RESET 0x80
@ -1015,8 +1016,7 @@ void em4x50_read(em4x50_data_t *etd) {
LOW(GPIO_SSC_DOUT);
lf_finalize();
// iceman: this hardcoded 136 value....
reply_ng(CMD_LF_EM4X50_READ, status, (uint8_t *)words, 136);
reply_ng(CMD_LF_EM4X50_READ, status, (uint8_t *)words, EM4X50_TAG_MAX_NO_BYTES);
}
// collects as much information as possible via selective read mode
@ -1041,8 +1041,7 @@ void em4x50_info(em4x50_data_t *etd) {
lf_finalize();
// iceman: this hardcoded 136 value....
reply_ng(CMD_LF_EM4X50_INFO, status, (uint8_t *)words, 136);
reply_ng(CMD_LF_EM4X50_INFO, status, (uint8_t *)words, EM4X50_TAG_MAX_NO_BYTES);
}
// reads data that tag transmits "voluntarily" -> standard read mode
@ -1193,7 +1192,7 @@ void em4x50_write(em4x50_data_t *etd) {
}
lf_finalize();
reply_ng(CMD_LF_EM4X50_WRITE, status, (uint8_t *)words, 136);
reply_ng(CMD_LF_EM4X50_WRITE, status, (uint8_t *)words, EM4X50_TAG_MAX_NO_BYTES);
}
// simple change of password