LF Demod bug fixes and add lf em em410xdemod

fixed a few bugs in lf demod that the streamlining added.  added new lf
em em410xdemod command that loops until button pressed. (similar to lf
hid fskdemod
This commit is contained in:
marshmellow42 2014-12-29 15:32:53 -05:00
commit 66707a3b3c
10 changed files with 105 additions and 365 deletions

View file

@ -442,10 +442,10 @@ int CmdBitstream(const char *Cmd)
bit ^= 1;
AppendGraph(0, clock, bit);
// for (j = 0; j < (int)(clock/2); j++)
// GraphBuffer[(i * clock) + j] = bit ^ 1;
// for (j = (int)(clock/2); j < clock; j++)
// GraphBuffer[(i * clock) + j] = bit;
// for (j = 0; j < (int)(clock/2); j++)
// GraphBuffer[(i * clock) + j] = bit ^ 1;
// for (j = (int)(clock/2); j < clock; j++)
// GraphBuffer[(i * clock) + j] = bit;
}
RepaintGraphWindow();
@ -477,18 +477,7 @@ int CmdDetectClockRate(const char *Cmd)
PrintAndLog("Auto-detected clock rate: %d", clock);
return 0;
}
/*
uint32_t bytebits_to_byte(uint8_t *src, int numbits)
{
uint32_t num = 0;
for(int i = 0 ; i < numbits ; i++)
{
num = (num << 1) | (*src);
src++;
}
return num;
}
*/
//by marshmellow
//fsk raw demod and print binary
//takes 2 arguments - Clock and invert

View file

@ -22,6 +22,20 @@
static int CmdHelp(const char *Cmd);
int CmdEMdemodASK(const char *Cmd)
{
int findone=0;
UsbCommand c={CMD_EM410X_DEMOD};
if(Cmd[0]=='1') findone=1;
c.arg[0]=findone;
SendCommand(&c);
return 0;
}
/* Read the ID of an EM410x tag.
* Format:
* 1111 1111 1 <-- standard non-repeatable header
@ -581,6 +595,7 @@ int CmdWriteWordPWD(const char *Cmd)
static command_t CommandTable[] =
{
{"help", CmdHelp, 1, "This help"},
{"em410xdemod", CmdEMdemodASK, 0, "[clock rate] -- Extract ID from EM410x tag"},
{"em410xread", CmdEM410xRead, 1, "[clock rate] -- Extract ID from EM410x tag"},
{"em410xsim", CmdEM410xSim, 0, "<UID> -- Simulate EM410x tag"},
{"em410xwatch", CmdEM410xWatch, 0, "['h'] -- Watches for EM410x 125/134 kHz tags (option 'h' for 134)"},

View file

@ -12,7 +12,7 @@
#define CMDLFEM4X_H__
int CmdLFEM4X(const char *Cmd);
int CmdEMdemodASK(const char *Cmd);
int CmdEM410xRead(const char *Cmd);
int CmdEM410xSim(const char *Cmd);
int CmdEM410xWatch(const char *Cmd);

View file

@ -47,6 +47,9 @@ local _commands = {
CMD_PCF7931_READ = 0x0217,
CMD_EM4X_READ_WORD = 0x0218,
CMD_EM4X_WRITE_WORD = 0x0219,
CMD_IO_DEMOD_FSK = 0x021A,
CMD_IO_CLONE_TAG = 0x021B,
CMD_EM410X_DEMOD = 0x021C,
--/* CMD_SET_ADC_MUX: ext1 is 0 for lopkd, 1 for loraw, 2 for hipkd, 3 for hiraw */
--// For the 13.56 MHz tags