- UsbCommand c = {CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K};
- sscanf(Cmd, "%"lli" %"lli" %"lli" %s %s", &c.arg[0], &c.arg[1], &c.arg[2],(char*)(&c.d.asBytes),(char*)(&dummy+1));
- // in case they specified 'h'
- strcpy((char *)&c.d.asBytes + strlen((char *)c.d.asBytes), dummy);
- SendCommand(&c);
- return 0;
+ while(param_getchar(Cmd, cmdp) != 0x00) {
+ switch(param_getchar(Cmd, cmdp))
+ {
+ case 'h':
+ return usage_lf_cmdread();
+ case 'H':
+ dummy[1]='h';
+ cmdp++;
+ break;
+ case 'L':
+ cmdp++;
+ break;
+ case 'c':
+ strLength = param_getstr(Cmd, cmdp+1, (char *)&c.d.asBytes);
+ cmdp+=2;
+ break;
+ case 'd':
+ c.arg[0] = param_get32ex(Cmd, cmdp+1, 0, 10);
+ cmdp+=2;
+ break;
+ case 'z':
+ c.arg[1] = param_get32ex(Cmd, cmdp+1, 0, 10);
+ cmdp+=2;
+ break;
+ case 'o':
+ c.arg[2] = param_get32ex(Cmd, cmdp+1, 0, 10);
+ cmdp+=2;
+ break;
+ default:
+ PrintAndLog("Unknown parameter '%c'", param_getchar(Cmd, cmdp));
+ errors = 1;
+ break;
+ }
+ if(errors) break;
+ }
+ // No args
+ if (cmdp == 0) errors = 1;
+
+ //Validations
+ if (errors) return usage_lf_cmdread();
+
+ // in case they specified 'H'
+ // added to the end..
+ strcpy((char *)&c.d.asBytes + strLength, dummy);
+
+ clearCommandBuffer();
+ SendCommand(&c);
+ return 0;