]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/graph.c
Inital test for the "lf em4x 410xsim / lf em4x 410xwatch" which I try to verify that...
[proxmark3-svn] / client / graph.c
index 4a966676539f2c541cc7a1dd03be1ce6cb929075..98dc80436db6f5660400d7d22d7a7f9fe5bf9a4b 100644 (file)
@@ -1,4 +1,15 @@
+//-----------------------------------------------------------------------------
+// Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
+//
+// 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.
+//-----------------------------------------------------------------------------
+// Graph utilities
+//-----------------------------------------------------------------------------
+
 #include <stdio.h>
+#include <stdbool.h>
 #include <string.h>
 #include "ui.h"
 #include "graph.h"
@@ -25,8 +36,10 @@ void AppendGraph(int redraw, int clock, int bit)
 int ClearGraph(int redraw)
 {
   int gtl = GraphTraceLen;
-  GraphTraceLen = 0;
+  memset(GraphBuffer, 0x00, GraphTraceLen);
 
+  GraphTraceLen = 0;
   if (redraw)
     RepaintGraphWindow();
 
@@ -83,3 +96,15 @@ int GetClock(const char *str, int peak, int verbose)
 
   return clock;
 }
+
+
+/* A simple test to see if there is any data inside Graphbuffer. 
+*/
+bool HasGraphData(){
+
+       if ( GraphTraceLen <= 0) {
+               PrintAndLog("No data available, try reading something first");
+               return false;
+       }
+       return true;    
+}
\ No newline at end of file
Impressum, Datenschutz