+// Get or auto-detect ask clock rate
+int GetAskClock(const char str[], bool printAns, bool verbose)
+{
+ int clock;
+ sscanf(str, "%i", &clock);
+ if (!strcmp(str, ""))
+ clock = 0;
+
+ if (clock != 0)
+ return clock;
+ // Auto-detect clock
+ uint8_t grph[MAX_GRAPH_TRACE_LEN]={0};
+ size_t size = getFromGraphBuf(grph);
+ if (size == 0) {
+ if (verbose)
+ PrintAndLog("Failed to copy from graphbuffer");
+ return -1;
+ }
+ DetectASKClock(grph, size, &clock, 20);
+ // Only print this message if we're not looping something
+ if (printAns){
+ PrintAndLog("Auto-detected clock rate: %d", clock);
+ }
+ return clock;
+}
+
+int GetPskClock(const char str[], bool printAns, bool verbose)
+{
+ int clock;
+ sscanf(str, "%i", &clock);
+ if (!strcmp(str, ""))
+ clock = 0;
+
+ if (clock!=0)
+ return clock;
+ // Auto-detect clock
+ uint8_t grph[MAX_GRAPH_TRACE_LEN]={0};
+ size_t size = getFromGraphBuf(grph);
+ if ( size == 0 ) {
+ if (verbose)
+ PrintAndLog("Failed to copy from graphbuffer");
+ return -1;
+ }
+ clock = DetectPSKClock(grph,size,0);
+ // Only print this message if we're not looping something
+ if (printAns){
+ PrintAndLog("Auto-detected clock rate: %d", clock);
+ }
+ return clock;
+}
+
+uint8_t GetNrzClock(const char str[], bool printAns, bool verbose)