mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
data askedgedetect - now uses cliparser
This commit is contained in:
parent
e85ae1753d
commit
200cd1d2f2
1 changed files with 18 additions and 5 deletions
|
@ -1129,13 +1129,26 @@ int AskEdgeDetect(const int *in, int *out, int len, int threshold) {
|
|||
// similar to dirtheshold, threshold commands
|
||||
// takes a threshold length which is the measured length between two samples then determines an edge
|
||||
static int CmdAskEdgeDetect(const char *Cmd) {
|
||||
int thresLen = 25;
|
||||
int ans = 0;
|
||||
sscanf(Cmd, "%i", &thresLen);
|
||||
|
||||
ans = AskEdgeDetect(GraphBuffer, GraphBuffer, GraphTraceLen, thresLen);
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "data askedgedetect",
|
||||
"Adjust Graph for manual ASK demod using the length of sample differences\n"
|
||||
"to detect the edge of a wave",
|
||||
"data askedgedetect -t 20"
|
||||
);
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
arg_int0("t", "thres", "<dec>", "threshold, use 20 - 45 (def 25)"),
|
||||
arg_param_end
|
||||
};
|
||||
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||
int threshold = arg_get_int_def(ctx, 1, 25);
|
||||
CLIParserFree(ctx);
|
||||
|
||||
PrintAndLogEx(INFO, "using threshold " _YELLOW_("%i"), threshold);
|
||||
int res = AskEdgeDetect(GraphBuffer, GraphBuffer, GraphTraceLen, threshold);
|
||||
RepaintGraphWindow();
|
||||
return ans;
|
||||
return res;
|
||||
}
|
||||
|
||||
// Print our clock rate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue