+//by marshmellow
+//fsk raw demod and print binary
+//takes 4 arguments - Clock, invert, fchigh, fclow
+//defaults: clock = 50, invert=1, fchigh=10, fclow=8 (RF/10 RF/8 (fsk2a))
+int CmdFSKrawdemod(const char *Cmd)
+{
+ char cmdp = param_getchar(Cmd, 0);
+ if (strlen(Cmd) > 10 || cmdp == 'h' || cmdp == 'H') {
+ PrintAndLog("Usage: data rawdemod fs [clock] <invert> [fchigh] [fclow]");
+ PrintAndLog(" [set clock as integer] optional, omit for autodetect.");
+ PrintAndLog(" <invert>, 1 for invert output, can be used even if the clock is omitted");
+ PrintAndLog(" [fchigh], larger field clock length, omit for autodetect");
+ PrintAndLog(" [fclow], small field clock length, omit for autodetect");
+ PrintAndLog("");
+ PrintAndLog(" sample: data rawdemod fs = demod an fsk tag from GraphBuffer using autodetect");
+ PrintAndLog(" : data rawdemod fs 32 = demod an fsk tag from GraphBuffer using a clock of RF/32, autodetect fc");
+ PrintAndLog(" : data rawdemod fs 1 = demod an fsk tag from GraphBuffer using autodetect, invert output");
+ PrintAndLog(" : data rawdemod fs 32 1 = demod an fsk tag from GraphBuffer using a clock of RF/32, invert output, autodetect fc");
+ PrintAndLog(" : data rawdemod fs 64 0 8 5 = demod an fsk1 RF/64 tag from GraphBuffer");
+ PrintAndLog(" : data rawdemod fs 50 0 10 8 = demod an fsk2 RF/50 tag from GraphBuffer");
+ PrintAndLog(" : data rawdemod fs 50 1 10 8 = demod an fsk2a RF/50 tag from GraphBuffer");
+ return 0;
+ }
+ return FSKrawDemod(Cmd, TRUE);
+}
+