mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
- replaced return value BUTTON_SINGLE_CLICK by PM3_EOPABORTED
- changed 4x50_stdread to 4x50_reader
This commit is contained in:
parent
8215955ba8
commit
e6eb6af9e3
1 changed files with 22 additions and 25 deletions
|
@ -425,15 +425,12 @@ static int find_double_listen_window(bool bcommand) {
|
||||||
while (cnt_pulses < EM4X50_T_WAITING_FOR_DBLLIW) {
|
while (cnt_pulses < EM4X50_T_WAITING_FOR_DBLLIW) {
|
||||||
|
|
||||||
if (BUTTON_PRESS())
|
if (BUTTON_PRESS())
|
||||||
return BUTTON_SINGLE_CLICK;
|
return PM3_EOPABORTED;
|
||||||
|
|
||||||
// identification of listen window is done via evaluation of
|
// identification of listen window is done via evaluation of
|
||||||
// pulse lengths
|
// pulse lengths
|
||||||
if (check_pulse_length(get_pulse_length(), 3 * EM4X50_T_TAG_FULL_PERIOD)) {
|
if (check_pulse_length(get_pulse_length(), 3 * EM4X50_T_TAG_FULL_PERIOD)) {
|
||||||
|
|
||||||
//if (BUTTON_PRESS())
|
|
||||||
// return BUTTON_SINGLE_CLICK;
|
|
||||||
|
|
||||||
if (check_pulse_length(get_pulse_length(), 2 * EM4X50_T_TAG_FULL_PERIOD)) {
|
if (check_pulse_length(get_pulse_length(), 2 * EM4X50_T_TAG_FULL_PERIOD)) {
|
||||||
|
|
||||||
// first listen window found
|
// first listen window found
|
||||||
|
@ -652,7 +649,7 @@ static int get_word_from_bitstream(uint32_t *data) {
|
||||||
|
|
||||||
LED_C_OFF();
|
LED_C_OFF();
|
||||||
|
|
||||||
return BUTTON_SINGLE_CLICK;
|
return PM3_EOPABORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
@ -964,7 +961,7 @@ void em4x50_chk(uint32_t *offset) {
|
||||||
|
|
||||||
// manual interruption
|
// manual interruption
|
||||||
if (BUTTON_PRESS()) {
|
if (BUTTON_PRESS()) {
|
||||||
status = BUTTON_SINGLE_CLICK;
|
status = PM3_EOPABORTED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1114,24 +1111,6 @@ void em4x50_read(em4x50_data_t *etd) {
|
||||||
reply_ng(CMD_LF_EM4X50_READ, status, (uint8_t *)words, 136);
|
reply_ng(CMD_LF_EM4X50_READ, status, (uint8_t *)words, 136);
|
||||||
}
|
}
|
||||||
|
|
||||||
void em4x50_stdread(void) {
|
|
||||||
|
|
||||||
// reads data that tag transmits "voluntarily" -> standard read mode
|
|
||||||
|
|
||||||
int now = 0;
|
|
||||||
uint32_t words[EM4X50_NO_WORDS] = {0x0};
|
|
||||||
|
|
||||||
em4x50_setup_read();
|
|
||||||
|
|
||||||
// set gHigh and gLow
|
|
||||||
if (get_signalproperties() && find_em4x50_tag())
|
|
||||||
standard_read(&now, words);
|
|
||||||
|
|
||||||
LOW(GPIO_SSC_DOUT);
|
|
||||||
lf_finalize();
|
|
||||||
reply_ng(CMD_LF_EM4X50_STDREAD, now, (uint8_t *)words, 4 * now);
|
|
||||||
}
|
|
||||||
|
|
||||||
void em4x50_info(em4x50_data_t *etd) {
|
void em4x50_info(em4x50_data_t *etd) {
|
||||||
|
|
||||||
// collects as much information as possible via selective read mode
|
// collects as much information as possible via selective read mode
|
||||||
|
@ -1158,6 +1137,24 @@ void em4x50_info(em4x50_data_t *etd) {
|
||||||
reply_ng(CMD_LF_EM4X50_INFO, status, (uint8_t *)words, 136);
|
reply_ng(CMD_LF_EM4X50_INFO, status, (uint8_t *)words, 136);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void em4x50_reader(void) {
|
||||||
|
|
||||||
|
// reads data that tag transmits "voluntarily" -> standard read mode
|
||||||
|
|
||||||
|
int now = 0;
|
||||||
|
uint32_t words[EM4X50_NO_WORDS] = {0x0};
|
||||||
|
|
||||||
|
em4x50_setup_read();
|
||||||
|
|
||||||
|
// set gHigh and gLow
|
||||||
|
if (get_signalproperties() && find_em4x50_tag())
|
||||||
|
standard_read(&now, words);
|
||||||
|
|
||||||
|
LOW(GPIO_SSC_DOUT);
|
||||||
|
lf_finalize();
|
||||||
|
reply_ng(CMD_LF_EM4X50_READER, now, (uint8_t *)words, 4 * now);
|
||||||
|
}
|
||||||
|
|
||||||
void em4x50_watch() {
|
void em4x50_watch() {
|
||||||
|
|
||||||
// read continuously and display standard reads of tag
|
// read continuously and display standard reads of tag
|
||||||
|
@ -1175,7 +1172,7 @@ void em4x50_watch() {
|
||||||
|
|
||||||
if (get_signalproperties() && find_em4x50_tag()) {
|
if (get_signalproperties() && find_em4x50_tag()) {
|
||||||
|
|
||||||
if (standard_read(&now, words) == BUTTON_SINGLE_CLICK)
|
if (standard_read(&now, words) == PM3_EOPABORTED)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (now > 0) {
|
if (now > 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue