X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/7fe9b0b742d7dae9c5af1d292d11840b5c3cbfae..0f7f9edc140b0b9fd3d9d2dd78015fe0acae6c2a:/client/cmdlfem4x.c diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c index 52d407ab..09bd1920 100644 --- a/client/cmdlfem4x.c +++ b/client/cmdlfem4x.c @@ -1,4 +1,15 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Low frequency EM4x commands +//----------------------------------------------------------------------------- + #include +#include #include "proxusb.h" #include "ui.h" #include "graph.h" @@ -23,7 +34,7 @@ int CmdEM410xRead(const char *Cmd) int parity[4]; char id[11]; int retested = 0; - int BitStream[MAX_GRAPH_TRACE_LEN]; + uint8_t BitStream[MAX_GRAPH_TRACE_LEN]; high = low = 0; /* Detect high and lows and clock */ @@ -235,16 +246,11 @@ int CmdEM410xSim(const char *Cmd) * looped until an EM410x tag is detected */ int CmdEM410xWatch(const char *Cmd) { - char *zero = ""; - char *twok = "2000"; - - int stop = 0; do { - CmdLFRead(zero); - CmdLFSamples(twok); - stop = CmdEM410xRead(zero); - } while (!stop); + CmdLFRead(""); + CmdSamples("2000"); + } while ( ! CmdEM410xRead("")); return 0; } @@ -276,6 +282,7 @@ int CmdEM4x50Read(const char *Cmd) high= low= 0; clock= 64; + memset(tmpbuff, 0, MAX_GRAPH_TRACE_LEN / 64); /* first get high and low values */ for (i = 0; i < GraphTraceLen; i++)