Legic: Moved card simulator into separate file & cleaned interface.

Reader and card simulation have almost no common code. Moreover the sim
uses an SSP Clock at 212kHz for all timings to prevent any drifting from
the PRNG. This clock speed is not available in reader simulation mode (SSP
runs at up to 3.4MHz, and changes speed between TX and RX). For these
reasons having the code in separate files makes it significantly cleaner.
This commit is contained in:
AntiCat 2018-09-05 22:23:25 +02:00
commit 61e4eac2b2
7 changed files with 176 additions and 24 deletions

View file

@ -19,6 +19,7 @@
#include "printf.h"
#include "string.h"
#include "legicrf.h"
#include "legicrfsim.h"
#include "lfsampling.h"
#include "BigBuf.h"
#include "mifareutil.h"
@ -796,10 +797,10 @@ void UsbPacketReceived(uint8_t *packet, int len) {
#ifdef WITH_LEGICRF
case CMD_SIMULATE_TAG_LEGIC_RF:
LegicRfSimulate(c->arg[0], c->arg[1], c->arg[2]);
LegicRfSimulate(c->arg[0]);
break;
case CMD_WRITER_LEGIC_RF:
LegicRfWriter( c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
LegicRfWriter(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
break;
case CMD_READER_LEGIC_RF:
LegicRfReader(c->arg[0], c->arg[1], c->arg[2]);