chg: 'hf 15 sim' - now it loops until buttonpress or usb_received.

This commit is contained in:
iceman1001 2017-07-31 17:55:21 +02:00
commit 479a288543

View file

@ -408,8 +408,7 @@ static int GetIso15693AnswerFromTag(uint8_t *receivedResponse, int maxLen, int *
// Now the GetISO15693 message from sniffing command
static int GetIso15693AnswerFromSniff(uint8_t *receivedResponse, int maxLen, int *samples, int *elapsed)
{
static int GetIso15693AnswerFromSniff(uint8_t *receivedResponse, int maxLen, int *samples, int *elapsed) {
uint8_t *dest = BigBuf_get_addr();
int c = 0, getNext = false;
@ -987,10 +986,7 @@ void ReaderIso15693(uint32_t parameter)
}
}
LED_A_OFF();
LED_B_OFF();
LED_C_OFF();
LED_D_OFF();
LEDsoff();
}
// Simulate an ISO15693 TAG, perform anti-collision and then print any reader commands
@ -1025,6 +1021,9 @@ void SimTagIso15693(uint32_t parameter, uint8_t *uid)
LED_C_ON();
LED_D_OFF();
while(!BUTTON_PRESS() && !usb_poll_validate_length() ) {
WDT_HIT();
// Listen to reader
answerLen1 = GetIso15693AnswerFromSniff(buf, 100, &samples, &elapsed) ;
@ -1045,18 +1044,14 @@ void SimTagIso15693(uint32_t parameter, uint8_t *uid)
Dbprintf("Simulationg uid: %x %x %x %x %x %x %x %x",
uid[0], uid[1], uid[2], uid[3],
uid[4], uid[5], uid[6], uid[7]);
LED_A_OFF();
LED_B_OFF();
LED_C_OFF();
LED_D_OFF();
}
LEDsoff();
}
// Since there is no standardized way of reading the AFI out of a tag, we will brute force it
// (some manufactures offer a way to read the AFI, though)
void BruteforceIso15693Afi(uint32_t speed)
{
void BruteforceIso15693Afi(uint32_t speed) {
uint8_t data[20];
uint8_t *recv = data;
int datalen = 0, recvlen = 0;